geoips.pydantic package#

Submodules#

geoips.pydantic.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.bases.DynamicModel[source]#

Bases: PrettyBaseModel

Pydantic model with a customized ConfigDict configurations for GeoIPS.

This model extends PrettyBaseModel and uses Pydantic’s ConfigDict to provide customized configurations. It is intended for use in cases where additional fields are not allowed, but the object data can be modified after initialization.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': False, 'populate_by_name': True, '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.bases.FrozenModel[source]#

Bases: PrettyBaseModel

Pydantic model with a customized ConfigDict configurations for GeoIPS.

This model extends PrettyBaseModel and uses Pydantic’s ConfigDict to provide customized configurations. It is intended for use in cases where additional fields are not allowed, and the object data cannot be modified after initialization.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True, 'populate_by_name': True, '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.bases.PermissiveDynamicModel(**extra_data: Any)[source]#

Bases: PrettyBaseModel

Pydantic model with a customized ConfigDict configurations for GeoIPS.

This model extends PrettyBaseModel and uses Pydantic’s ConfigDict to provide customized configurations. It is intended for use in cases where additional fields are allowed, and the object data can be modified after initialization.

model_config: ClassVar[ConfigDict] = {'extra': 'allow', 'frozen': False, 'populate_by_name': True, '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.bases.PermissiveFrozenModel(**extra_data: Any)[source]#

Bases: PrettyBaseModel

Pydantic model with a customized ConfigDict configurations for GeoIPS.

This model extends PrettyBaseModel and uses Pydantic’s ConfigDict to provide customized configurations. It is intended for use in cases where additional fields are allowed, but the object data cannot be modified after initialization.

model_config: ClassVar[ConfigDict] = {'extra': 'allow', 'frozen': True, 'populate_by_name': True, '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.bases.PluginModel(*, 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 = 'geoips/v1'#
apiVerson: ClassVar[str | None] = None#
description: str#
docstring: str#
family: str#
interface: str#
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True, 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: str#
package: str#
relpath: str#
class geoips.pydantic.bases.PluginModelMetadata(name, bases, namespace, **kwargs)[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

class geoips.pydantic.bases.PrettyBaseModel[source]#

Bases: BaseModel

Make Pydantic models pretty-print by default.

This model overrides the default string representation of Pydantic models to generate a user-friendly, JSON-formatted output with two-space indentation.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

geoips.pydantic.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.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.feature_annotators module#

Pydantic models used to validate GeoIPS feature annotator plugins.

class geoips.pydantic.feature_annotators.CartopyFeature(*, enabled: bool, edgecolor: Tuple[float, float, float] | Tuple[float, float, float, float] | str | None = 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 | None#
enabled: bool#
linewidth: float | None#
model_config: ClassVar[ConfigDict] = {'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

classmethod validate_enabled_fields(values)[source]#

Validate edgecolor and linewidth based on the value of ‘enabled’.

If enabled is True, then both edgecolor and linewidth must be provided.

class geoips.pydantic.feature_annotators.FeatureAnnotatorPluginModel(*, 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] = {'extra': 'forbid', 'frozen': True, 'populate_by_name': True, '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.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] = {'extra': 'forbid', 'frozen': True, 'populate_by_name': True, '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.gridline_annotators module#

Pydantic models used to validate GeoIPS gridline annotator plugins.

class geoips.pydantic.gridline_annotators.GridlineAnnotatorPluginModel(*, 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] = {'extra': 'forbid', 'frozen': True, 'populate_by_name': True, '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.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#
labels: Labels#
lines: Lines#
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True, 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

spacing: Spacing#
class geoips.pydantic.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] = {'extra': 'allow', 'frozen': True, 'populate_by_name': True, '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.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] = {'extra': 'forbid', 'frozen': True, 'populate_by_name': True, '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.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] = {'extra': 'forbid', 'frozen': True, 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

geoips.pydantic.sectors module#

Pydantic models used to validate GeoIPS sector plugins.

class geoips.pydantic.sectors.AreaDefinitionSpec(*, area_id: str = None, description: str = None, projection: ~geoips.pydantic.sectors.SectorProjection, shape: ~typing.Tuple[int, int] | ~geoips.pydantic.sectors.SectorShape = None, area_extent: ~typing.Tuple[float, float, float, float] | ~geoips.pydantic.sectors.SectorAreaExtent = None, resolution: float | ~typing.Tuple[float, float] | ~geoips.pydantic.sectors.SectorResolution = None, units: ~typing.Literal['m', 'km', 'meters', 'kilometers', 'deg', 'degrees'] = 'm', center: ~geoips.pydantic.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] = {'extra': 'forbid', 'frozen': True, 'populate_by_name': True, '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.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] = {'extra': 'forbid', 'frozen': True, 'populate_by_name': True, '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.sectors.EarthConstants(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: float, Enum

A simple class containing constant values relative to the geometry of Earth.

SEMI_MAJOR_AXIS = 6371228.0#
class geoips.pydantic.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] = {'coerce_numbers_to_str': False, 'extra': 'forbid', 'frozen': True, 'populate_by_name': True, '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.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] = {'extra': 'forbid', 'frozen': True, 'populate_by_name': True, '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.sectors.SectorPluginModel(*, 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] = {'extra': 'allow', 'frozen': True, 'populate_by_name': True, '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.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. 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#
a: EarthConstants#
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] = {'extra': 'allow', 'frozen': True, 'populate_by_name': True, '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.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] = {'extra': 'forbid', 'frozen': True, 'populate_by_name': True, '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.sectors.SectorShape(*, height: int, width: int)[source]#

Bases: FrozenModel

The shape of the sector in pixels.

height: int#
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True, 'populate_by_name': True, '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.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] = {'extra': 'forbid', 'frozen': True, 'populate_by_name': True, '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.sectors.StitchedMetadata(*, region: RegionMetadata, primary_area_definition: str)[source]#

Bases: StaticMetadata

Metadata for stitched imagery sectors.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True, 'populate_by_name': True, '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.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] = {'extra': 'forbid', 'frozen': True, 'populate_by_name': True, '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.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] = {'extra': 'forbid', 'frozen': True, 'populate_by_name': True, '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.sectors.XYCoordinate(*, x: float, y: float)[source]#

Bases: FrozenModel

A coordinate in projection units.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True, 'populate_by_name': True, '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.sectors.lat_lon_coordinate(arg: tuple[float, float]) tuple[float, float][source]#

Validate a latitude and longitude coordinate.

geoips.pydantic.workflows module#

Workflow plugin models.

Defines pydantic models related to Workflow plugins, including top-level callable interfaces (eg. Readers, OutputFormatters, etc.).

class geoips.pydantic.workflows.AlgorithmArgumentsModel(**extra_data: Any)[source]#

Bases: PermissiveFrozenModel

Validate Algorithm arguments.

model_config: ClassVar[ConfigDict] = {'extra': 'allow', 'frozen': True, 'populate_by_name': True, '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.workflows.CoverageCheckerArgumentsModel(**extra_data: Any)[source]#

Bases: PermissiveFrozenModel

Validate Coverage Checker arguments.

model_config: ClassVar[ConfigDict] = {'extra': 'allow', 'frozen': True, 'populate_by_name': True, '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.workflows.FilenameFormatterArgumentsModel(**extra_data: Any)[source]#

Bases: PermissiveFrozenModel

Validate FilenameFormatter arguments.

model_config: ClassVar[ConfigDict] = {'extra': 'allow', 'frozen': True, 'populate_by_name': True, '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.workflows.InterpolatorArgumentsModel(**extra_data: Any)[source]#

Bases: PermissiveFrozenModel

Validate Interpolator arguments.

model_config: ClassVar[ConfigDict] = {'extra': 'allow', 'frozen': True, 'populate_by_name': True, '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.workflows.OutputFormatterArgumentsModel(**extra_data: Any)[source]#

Bases: PermissiveFrozenModel

Validate Output Formatter arguments.

model_config: ClassVar[ConfigDict] = {'extra': 'allow', 'frozen': True, 'populate_by_name': True, '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.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] = {'extra': 'allow', 'frozen': True, 'populate_by_name': True, '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.workflows.WorkflowArgumentsModel(**extra_data: Any)[source]#

Bases: PermissiveFrozenModel

Validate Workflow arguments.

model_config: ClassVar[ConfigDict] = {'extra': 'allow', 'frozen': True, 'populate_by_name': True, '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.workflows.WorkflowPluginModel(*, 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] = {'extra': 'allow', 'frozen': True, 'populate_by_name': True, '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.workflows.WorkflowSpecModel(*, steps: Dict[str, WorkflowStepDefinitionModel])[source]#

Bases: FrozenModel

The specification for a workflow.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True, 'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

steps: Dict[str, WorkflowStepDefinitionModel]#
class geoips.pydantic.workflows.WorkflowStepDefinitionModel(*, kind: str, name: str, arguments: ~typing.Dict[str, ~typing.Any] = <factory>)[source]#

Bases: FrozenModel

Validate step definition : kind, name, and arguments.

arguments: Dict[str, Any]#
kind: str#
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True, 'populate_by_name': True, '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.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.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 pydantic models init file.

geoips.pydantic.collect_classes(modules)[source]#

Extract all classes from the given modules.

Parameters:

modules (dict) –

  • A dictionary of mod_name: module objects found within geoips.pydantic

geoips.pydantic.collect_modules()[source]#

Dynamically find and import all submodules within a package.