Skip to content

Instantly share code, notes, and snippets.

@charlesbmi
Created February 12, 2025 18:27
Show Gist options
  • Save charlesbmi/561f59a2f5cb06b896238653c346fe50 to your computer and use it in GitHub Desktop.
Save charlesbmi/561f59a2f5cb06b896238653c346fe50 to your computer and use it in GitHub Desktop.
from typing import Annotated, Union
import numpy as np
from pydantic import (
AfterValidator,
BaseModel,
)
FloatInfAsNone = Annotated[
Union[float, None], AfterValidator(lambda x: None if x == np.inf else x)
]
class TransmitSteeringList(BaseModel):
"""Transmit angle and focus parameters."""
tx_az_angle_deg: list[float]
tx_el_angle_deg: list[float]
tx_az_focus: list[FloatInfAsNone]
tx_el_focus: list[FloatInfAsNone]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment