geoips.pydantic_models.v1 package#
Submodules#
geoips.pydantic_models.v1.bases module#
Pydantic base models for GeoIPS.
Intended for use by other base models.
PluginModel
should be used as the parent class of all other plugin models.
Other models defined here validate field types within child plugin models.
- class geoips.pydantic_models.v1.bases.CoreBaseModel[source]#
Bases:
BaseModel
CoreBaseModel for GeoIPS Order-Based Procflow data model validation.
This model provides a standardized Pydantic base class with custom configuration and validation logic for all GeoIPS models built using Pydantic library. It consolidates useful configurations, custom validators, and utility methods.
Features#
- Pretty-printing:
Make Pydantic models pretty-print by default. Overrides the default string representation of Pydantic models to generate a user-friendly, JSON-formatted output with two-space indentation.
- Configured Options:
Includes a customized
ConfigDict
with the following options set:str_strip_whitespace=True to trim whitespace around input.
validate_by_alias=True to populate data using aliased field names.
validate_by_name=True to populate an aliased using its model-defined name.
loc_by_alias=False to disallow usage of alias field name in error locations.
validate_assignment=False Disables model revalidation when data is changed.
arbitrary_types_allowed=True to allow custom data types as field types.
strict=False to disallow coercion of values to declared type when possible.
- allow_inf_nan=False to disallow +/-infinity and NaN values in float and
decimal fields.
- check_restricted_fields:
Model-level validator that disallows user input for restricted fields.
Allows defining a list of restricted fields globally or at the class level.
Raises a validation error if a restricted field is provided by the user.
- model_name:
Prints the model name along with the data.
Useful for debugging and logging purposes(for dev).
This method would be further enhanced in future PR
- classmethod check_restricted_fields(values)[source]#
Validate restricted fields and warn if the user tries to set them.
- Parameters:
values (dict) – dictionary containing step details.
- Returns:
dictionary containing step details.
- Return type:
dict
- Raises:
ValueError – If a restricted field is found in the input.
Notes
This function was initially implemented to handle a restricted field called plugin_type, which was removed as part of of architectural changes. Although it is currently unused, we anticipate a strong use case moving forward.
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- property model_name#
Return the model name for logging and end-user interactions.
- restricted_fields: ClassVar[Tuple[str, ...]] = ()#
- class geoips.pydantic_models.v1.bases.DynamicModel[source]#
Bases:
CoreBaseModel
Inherits all of the configuration from CoreBaseModel.
The following overrides are applied: - extra=”forbid”: Forbids additional fields beyond those defined in the model. - frozen=False: Allows modification of field values after object instantiation.
This model is intended for cases where additional fields are not permitted and the object data remains mutable after initialization.
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': False, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class geoips.pydantic_models.v1.bases.FrozenModel[source]#
Bases:
CoreBaseModel
Inherits all of the configuration from CoreBaseModel.
The following overrides are applied: - extra=”forbid”: Forbids additional fields beyond those defined in the model. - frozen=True: Disallows modification of field values after object instantiation.
This model is intended for cases where additional fields are not permitted and the object data must remain immutable after initialization.
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class geoips.pydantic_models.v1.bases.PermissiveDynamicModel(**extra_data: Any)[source]#
Bases:
CoreBaseModel
Inherits all of the configuration from CoreBaseModel.
The following overrides are applied: - extra=”allow”: Allows additional fields beyond those defined in the model. - frozen=False: Allows modification of field values after object instantiation.
This model is intended for cases where additional fields are permitted and the object data remains immutable after initialization.
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'allow', 'frozen': False, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class geoips.pydantic_models.v1.bases.PermissiveFrozenModel(**extra_data: Any)[source]#
Bases:
CoreBaseModel
Inherits all of the configuration from CoreBaseModel.
The following overrides are applied: - extra=”allow”: Allows additional fields beyond those defined in the model. - frozen=True: Disallows modification of field values after object instantiation.
This model is intended for cases where additional fields are permitted and the object data must remain immutable after initialization.
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'allow', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class geoips.pydantic_models.v1.bases.PluginModel(*, apiVersion: str = 'geoips/v1', interface: str, family: str, name: str, docstring: str, description: str = None, package: str = (FieldInfo(annotation=NoneType, required=True, description='Package that contains this plugin.'),), relpath: str = None, abspath: str = None)[source]#
Bases:
FrozenModel
Base Plugin model for all GeoIPS plugins.
This should be used as the base class for all top-level PluginModels. It adds standard plugin attributes for inheritance. It validates YAML plugins for the order based procflow.
See the YAML plugin documentation here for more information about how this is used.
- abspath: str#
- apiVersion: str = 'geoips/v1'#
- description: str#
- docstring: str#
- family: PythonIdentifier#
- interface: PythonIdentifier#
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- name: PythonIdentifier#
- package: PythonIdentifier#
- relpath: str#
- class geoips.pydantic_models.v1.bases.PluginModelMetadata(name: str, bases: Tuple[type, ...], namespace: Dict[str, Any], **kwargs: Any)[source]#
Bases:
ModelMetaclass
API version and namespace metadata for the corresponding plugin model.
This is used to derive ‘apiVersion’ and ‘namespace’ for any given PluginModel. PluginModel can be instantiated directly or a child class of PluginModel can be instantiated and the functionality will for the same.
Initially attempted to use __init_subclass__ in the PluginModel class itself, but that only supported child classes of PluginModel (i.e. WorkflowPluginModel, …), but not instantiation of PluginModel itself.
NOTE: Need to inherit from ModelMetaclass, otherwise we’ll wind up with this error:
E TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
- geoips.pydantic_models.v1.bases.get_interfaces(namespace) set[str] [source]#
Return a set of distinct interfaces.
This function returns all available plugin interfaces. The results are cached for runtime memory optimization.
- Returns:
set of interfaces
- Return type:
set of str
- geoips.pydantic_models.v1.bases.python_identifier(val: str) str [source]#
Validate if a string is a valid Python identifier.
Validate if a string is a valid Python identifier and not a reserved Python keyword. See for more information on Python identifiers and reserved keywords.
Validation is performed by calling str.isidentifier and keyword.iskeyword.
- Parameters:
val (str) – The input string to validate.
- Returns:
The input string if it is a valid Python identifier.
- Return type:
str
- Raises:
ValueError – If the input string is invalid as a Python identifier or a reserved keyword.
geoips.pydantic_models.v1.feature_annotators module#
Pydantic models used to validate GeoIPS feature annotator plugins.
- class geoips.pydantic_models.v1.feature_annotators.CartopyFeature(*, enabled: bool, edgecolor: Tuple[float, float, float] | Tuple[float, float, float, float] | str = None, linewidth: float | None = None, **extra_data: Any)[source]#
Bases:
PermissiveFrozenModel
Generic model for cartopy features.
- edgecolor: Tuple[float, float, float] | Tuple[float, float, float, float] | str#
- enabled: bool#
- linewidth: float | None#
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'allow', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class geoips.pydantic_models.v1.feature_annotators.FeatureAnnotatorPluginModel(*, apiVersion: str = 'geoips/v1', interface: str, family: str, name: str, docstring: str, description: str = None, package: str = (FieldInfo(annotation=NoneType, required=True, description='Package that contains this plugin.'),), relpath: str = None, abspath: str = None, spec: FeatureAnnotatorSpec)[source]#
Bases:
PluginModel
Feature Annotator plugin format.
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- spec: FeatureAnnotatorSpec#
- class geoips.pydantic_models.v1.feature_annotators.FeatureAnnotatorSpec(*, coastline: CartopyFeature, borders: CartopyFeature, rivers: CartopyFeature, states: CartopyFeature, background: Tuple[float, float, float] | Tuple[float, float, float, float] | str | None = None)[source]#
Bases:
FrozenModel
Feature Annotator spec (specification) format.
- background: Tuple[float, float, float] | Tuple[float, float, float, float] | str | None#
- borders: CartopyFeature#
- coastline: CartopyFeature#
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- rivers: CartopyFeature#
- states: CartopyFeature#
geoips.pydantic_models.v1.gridline_annotators module#
Pydantic models used to validate GeoIPS gridline annotator plugins.
- class geoips.pydantic_models.v1.gridline_annotators.GridlineAnnotatorPluginModel(*, apiVersion: str = 'geoips/v1', interface: str, family: str, name: str, docstring: str, description: str = None, package: str = (FieldInfo(annotation=NoneType, required=True, description='Package that contains this plugin.'),), relpath: str = None, abspath: str = None, spec: GridlineAnnotatorSpec)[source]#
Bases:
PluginModel
Gridline Annotator plugin format.
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- spec: GridlineAnnotatorSpec#
- class geoips.pydantic_models.v1.gridline_annotators.GridlineAnnotatorSpec(*, spacing: Spacing, labels: Labels, lines: Lines, background: Tuple[float, float, float] | Tuple[float, float, float, float] | str | None = None)[source]#
Bases:
FrozenModel
Gridline Annotator spec (specification) format.
- background: Tuple[float, float, float] | Tuple[float, float, float, float] | str | None#
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class geoips.pydantic_models.v1.gridline_annotators.Labels(*, top: bool, bottom: bool, left: bool, right: bool, alpha: float | None = None, backgroundcolor: Tuple[float, float, float] | Tuple[float, float, float, float] | str | None = None, color: Tuple[float, float, float] | Tuple[float, float, float, float] | str | None = None, fontfamily: str | None = None, fontsize: float | str | None = None, fontstretch: int | str | None = None, fontstyle: str | None = None, fontvariant: str | None = None, fontweight: int | str | None = None, linespacing: float | None = None, mouseover: bool | None = None, position: List[float] | None = None, rotation: float | str | None = None, rotation_mode: str | None = None, snap: bool | None = None, wrap: bool | None = None, zorder: float | None = None, xpadding: int | None = None, ypadding: int | None = None, **extra_data: Any)[source]#
Bases:
PermissiveFrozenModel
Model used to format labels in annotated imagery.
For more information, visit https://matplotlib.org/stable/ to see more context in how to specify these fields.
- alpha: float | None#
- backgroundcolor: Tuple[float, float, float] | Tuple[float, float, float, float] | str | None#
- bottom: bool#
- color: Tuple[float, float, float] | Tuple[float, float, float, float] | str | None#
- fontfamily: str | None#
- fontsize: float | str | None#
- fontstretch: int | str | None#
- fontstyle: str | None#
- fontvariant: str | None#
- fontweight: int | str | None#
- left: bool#
- linespacing: float | None#
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'allow', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- mouseover: bool | None#
- position: List[float] | None#
- right: bool#
- rotation: float | str | None#
- rotation_mode: str | None#
- snap: bool | None#
- top: bool#
- wrap: bool | None#
- xpadding: int | None#
- ypadding: int | None#
- zorder: float | None#
- class geoips.pydantic_models.v1.gridline_annotators.Lines(*, color: Tuple[float, float, float] | Tuple[float, float, float, float] | str, linestyle: List[int], linewidth: float)[source]#
Bases:
FrozenModel
Model used to format gridlines in annotated imagery.
For more information, visit https://matplotlib.org/stable/ to see more context in how to specify these fields.
- color: Tuple[float, float, float] | Tuple[float, float, float, float] | str#
- linestyle: List[int]#
- linewidth: float#
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class geoips.pydantic_models.v1.gridline_annotators.Spacing(*, latitude: float | Literal['auto'], longitude: float | Literal['auto'])[source]#
Bases:
FrozenModel
Model used to format the spacing of gridlines in annotated imagery.
- latitude: float | Literal['auto']#
- longitude: float | Literal['auto']#
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
geoips.pydantic_models.v1.sectors module#
Pydantic models used to validate GeoIPS sector plugins.
- class geoips.pydantic_models.v1.sectors.AreaDefinitionSpec(*, area_id: str = None, description: str = None, projection: ~geoips.pydantic_models.v1.sectors.SectorProjection, shape: ~typing.Tuple[int, int] | ~geoips.pydantic_models.v1.sectors.SectorShape = None, area_extent: ~typing.Tuple[float, float, float, float] | ~geoips.pydantic_models.v1.sectors.SectorAreaExtent = None, resolution: float | ~typing.Tuple[float, float] | ~geoips.pydantic_models.v1.sectors.SectorResolution = None, units: ~typing.Literal['m', 'km', 'meters', 'kilometers', 'deg', 'degrees'] = 'm', center: ~geoips.pydantic_models.v1.sectors.XYCoordinate = <factory>)[source]#
Bases:
FrozenModel
Defines an AreaDefinition for use with pyresample.
The resulting dictionary should be able to just be passed to
pyresample.create_area_def()
.- area_extent: Tuple[float, float, float, float] | SectorAreaExtent#
- area_id: str#
- center: XYCoordinate#
- description: str#
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- projection: SectorProjection#
- resolution: float | Tuple[float, float] | SectorResolution#
- shape: Tuple[int, int] | SectorShape#
- units: Literal['m', 'km', 'meters', 'kilometers', 'deg', 'degrees']#
- class geoips.pydantic_models.v1.sectors.BoxMetadata(*, min_lat: float, min_lon: float, max_lat: float, max_lon: float, box_resolution_km: float)[source]#
Bases:
FrozenModel
Metadata format for pyroCb sectors.
- box_resolution_km: float#
- max_lat: float#
- max_lon: float#
- min_lat: float#
- min_lon: float#
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class geoips.pydantic_models.v1.sectors.EarthConstants(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Bases:
float
,Enum
A class with Earth related geometrical constants.
- SEMI_MAJOR_AXIS = 6371228.0#
- class geoips.pydantic_models.v1.sectors.RegionMetadata(*, continent: str, country: str, area: str, subarea: str, state: str, city: str)[source]#
Bases:
FrozenModel
Metadata format for standard static sectors.
- area: str#
- city: str#
- continent: str#
- country: str#
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'coerce_numbers_to_str': False, 'extra': 'forbid', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- state: str#
- subarea: str#
- class geoips.pydantic_models.v1.sectors.SectorAreaExtent(*, lower_left_xy: Tuple[int, int], upper_right_xy: Tuple[int, int])[source]#
Bases:
FrozenModel
The extent of the sector in projection units.
For more information on how this is used, see the pyresample documentation.
- lower_left_xy: Tuple[int, int]#
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- upper_right_xy: Tuple[int, int]#
- class geoips.pydantic_models.v1.sectors.SectorPluginModel(*, apiVersion: str = 'geoips/v1', interface: str, family: str, name: str, docstring: str, description: str = None, package: str = (FieldInfo(annotation=NoneType, required=True, description='Package that contains this plugin.'),), relpath: str = None, abspath: str = None, spec: AreaDefinitionSpec, metadata: BoxMetadata | StaticMetadata | StitchedMetadata | TCMetadata | VolcanoMetadata, **extra_data: Any)[source]#
Bases:
PluginModel
Sector plugin format.
- classmethod add_parent(value, info)[source]#
Collect default area_id and description from parent.
This is a field validator that runs before the root validator. It accesses the properties of the parent object to fill in area_id and description if they are not provided. These values come from the parent’s name and docstring.
- classmethod coerce_metadata(value)[source]#
Coerce metadata to StaticMetadata if possible.
Doing this as pydantic by default will return the last class that validates correctly, and this applies to other metadata classes.
- metadata: BoxMetadata | StaticMetadata | StitchedMetadata | TCMetadata | VolcanoMetadata#
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'allow', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- spec: AreaDefinitionSpec#
- class geoips.pydantic_models.v1.sectors.SectorProjection(*, proj: str, a: EarthConstants = EarthConstants.SEMI_MAJOR_AXIS, R: float = None, ellipsoid: str = 'GRS80', h: float = None, k_0: float = 1.0, lat_0: float = None, lat_1: float = 0.0, lat_2: float = 0.0, lat_ts: float = 0.0, lon_0: float = None, t_epoch: float = None, t_final: float = None, x_0: float = 0.0, y_0: float = 0.0, units: Literal['m', 'km', 'degrees'] = 'm', **extra_data: Any)[source]#
Bases:
PermissiveFrozenModel
Projection information for a sector.
This is a dictionary that provides Proj projection information for the sector. For more information on what parameters can be supplied, see the Proj documentation.
Validation has only been implemented for some of the most common options. Additional sector projection parameters are supported but not validated. If you need validation for a parameter that is not currently implemented, please open an issue and, if possible, a pull request on GitHub.
- R: float#
- ellipsoid: str#
- h: float#
- k_0: float#
- lat_0: float#
- lat_1: float#
- lat_2: float#
- lat_ts: float#
- lon_0: float#
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'allow', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- proj: str#
- t_epoch: float#
- t_final: float#
- units: Literal['m', 'km', 'degrees']#
- x_0: float#
- y_0: float#
- class geoips.pydantic_models.v1.sectors.SectorResolution(*, dx: float, dy: float)[source]#
Bases:
FrozenModel
The resolution of the sector in projection units.
The height and width of pixels in the units specified by the sector’s projection units.
- dx: float#
- dy: float#
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class geoips.pydantic_models.v1.sectors.SectorShape(*, height: int, width: int)[source]#
Bases:
FrozenModel
The shape of the sector in pixels.
- height: int#
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- width: int#
- class geoips.pydantic_models.v1.sectors.StaticMetadata(*, region: RegionMetadata)[source]#
Bases:
FrozenModel
Metadata format for standard static sectors.
This is the same as StaticMetadata, just with an additional ‘region’ level. This is a convenience model for specifying static sector plugins in a legacy format.
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- region: RegionMetadata#
- class geoips.pydantic_models.v1.sectors.StitchedMetadata(*, region: RegionMetadata, primary_area_definition: str)[source]#
Bases:
StaticMetadata
Metadata for stitched imagery sectors.
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- primary_area_definition: str#
- class geoips.pydantic_models.v1.sectors.TCMetadata(*, pressure: float, velocity_max: float, center_lat: float, center_lon: float, synoptic_time: datetime, aid_type: str, storm_num: int, storm_name: str, storm_basin: str, storm_year: int, deck_line: str, source_file: str, final_storm_name: str)[source]#
Bases:
FrozenModel
Metdata format for Tropical Cyclone sectors.
- aid_type: str#
- center_lat: float#
- center_lon: float#
- deck_line: str#
- final_storm_name: str#
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- pressure: float#
- source_file: str#
- storm_basin: str#
- storm_name: str#
- storm_num: int#
- storm_year: int#
- synoptic_time: datetime#
- velocity_max: float#
- class geoips.pydantic_models.v1.sectors.VolcanoMetadata(*, summit_elevation: float, plume_height: float, wind_speed: float, wind_dir: float, clat: float, clon: float)[source]#
Bases:
FrozenModel
Metadata format for Volcano sectors.
- clat: float#
- clon: float#
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- plume_height: float#
- summit_elevation: float#
- wind_dir: float#
- wind_speed: float#
- class geoips.pydantic_models.v1.sectors.XYCoordinate(*, x: float, y: float)[source]#
Bases:
FrozenModel
A coordinate in projection units.
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- x: float#
- y: float#
geoips.pydantic_models.v1.workflows module#
Workflow plugin models.
Defines pydantic models related to Workflow plugins, including top-level callable interfaces (eg. Readers, OutputFormatters, etc.).
- class geoips.pydantic_models.v1.workflows.AlgorithmArgumentsModel(**extra_data: Any)[source]#
Bases:
PermissiveFrozenModel
Validate Algorithm arguments.
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'allow', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class geoips.pydantic_models.v1.workflows.CoverageCheckerArgumentsModel(**extra_data: Any)[source]#
Bases:
PermissiveFrozenModel
Validate Coverage Checker arguments.
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'allow', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class geoips.pydantic_models.v1.workflows.FilenameFormatterArgumentsModel(**extra_data: Any)[source]#
Bases:
PermissiveFrozenModel
Validate FilenameFormatter arguments.
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'allow', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class geoips.pydantic_models.v1.workflows.InterpolatorArgumentsModel(**extra_data: Any)[source]#
Bases:
PermissiveFrozenModel
Validate Interpolator arguments.
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'allow', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class geoips.pydantic_models.v1.workflows.OutputFormatterArgumentsModel(**extra_data: Any)[source]#
Bases:
PermissiveFrozenModel
Validate Output Formatter arguments.
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'allow', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class geoips.pydantic_models.v1.workflows.ReaderArgumentsModel(*, area_def: str = None, chans: List[str] = None, metadata_only: bool = False, self_register: List[str] = None, fnames: List[str] = None, **extra_data: Any)[source]#
Bases:
PermissiveFrozenModel
Reader step argument definition.
Pydantic model defining and validating Reader step arguments.
- area_def: str#
- fnames: List[str]#
- metadata_only: bool#
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'allow', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- self_register: List[str]#
- variables: List[str]#
- class geoips.pydantic_models.v1.workflows.WorkflowArgumentsModel(**extra_data: Any)[source]#
Bases:
PermissiveFrozenModel
Validate Workflow arguments.
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'allow', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class geoips.pydantic_models.v1.workflows.WorkflowPluginModel(*, apiVersion: str = 'geoips/v1', interface: str, family: str, name: str, docstring: str, description: str = None, package: str = (FieldInfo(annotation=NoneType, required=True, description='Package that contains this plugin.'),), relpath: str = None, abspath: str = None, spec: WorkflowSpecModel, **extra_data: Any)[source]#
Bases:
PluginModel
A plugin that produces a workflow.
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'allow', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- spec: WorkflowSpecModel#
- class geoips.pydantic_models.v1.workflows.WorkflowSpecModel(*, steps: Dict[str, WorkflowStepDefinitionModel])[source]#
Bases:
FrozenModel
The specification for a workflow.
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- steps: Dict[PythonIdentifier, WorkflowStepDefinitionModel]#
- class geoips.pydantic_models.v1.workflows.WorkflowStepDefinitionModel(*, kind: ~geoips.utils.types.partial_lexeme.Lexeme, name: str, arguments: ~typing.Dict[str, ~typing.Any] = <factory>)[source]#
Bases:
FrozenModel
Validate step definition : kind, name, and arguments.
- arguments: Dict[str, Any]#
- kind: Lexeme#
- model_config: ClassVar[ConfigDict] = {'allow_inf_nan': False, 'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'loc_by_alias': False, 'str_strip_whitespace': True, 'strict': False, 'validate_assignment': False, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- name: str#
- geoips.pydantic_models.v1.workflows.get_plugin_kinds() set[str] [source]#
Return plugin kinds from available interfaces.
- Returns:
singular names of distinct plugin kinds
- Return type:
set of str
- geoips.pydantic_models.v1.workflows.get_plugin_names(plugin_kind: str) List[str] [source]#
Return valid plugin names for passed plugin kind.
- Parameters:
plugin_kind (str) – valid plugin interface name
- Returns:
A list of plugin names for a valid plugin kind
- Return type:
list
- Raises:
AttributeError – If the plugin kind is invalid
Module contents#
GeoIPS order-based procflow v1 models init file.