geoips.interfaces.yaml_based package#

Submodules#

geoips.interfaces.yaml_based.feature_annotators module#

Feature Annotator interface module.

class geoips.interfaces.yaml_based.feature_annotators.FeatureAnnotatorsInterface[source]#

Bases: BaseYamlInterface

Interface for feature annotator plugins.

name = 'feature_annotators'#
use_pydantic = False#

geoips.interfaces.yaml_based.gridline_annotators module#

Gridline Annotator interface module.

class geoips.interfaces.yaml_based.gridline_annotators.GridlineAnnotatorsInterface[source]#

Bases: BaseYamlInterface

Interface for gridline annotator plugins.

label_kwargs = {'alpha': ['number'], 'backgroundcolor': ['string'], 'color': ['string'], 'fontfamily': ['string'], 'fontsize': ['number', 'string'], 'fontstretch': ['integer', 'string'], 'fontstyle': ['string'], 'fontvariant': ['string'], 'fontweight': ['integer', 'string'], 'linespacing': ['number'], 'mouseover': ['boolean'], 'position': ['array'], 'rotation': ['number', 'string'], 'rotation_mode': ['string'], 'snap': ['boolean'], 'wrap': ['boolean'], 'zorder': ['number']}#
name = 'gridline_annotators'#
use_pydantic = False#

geoips.interfaces.yaml_based.product_defaults module#

Product Defaults interface module.

class geoips.interfaces.yaml_based.product_defaults.ProductDefaultsInterface[source]#

Bases: BaseYamlInterface

Default values that can be applied to products.

name = 'product_defaults'#
use_pydantic = False#

geoips.interfaces.yaml_based.products module#

Products interface module.

class geoips.interfaces.yaml_based.products.ProductsInterface[source]#

Bases: BaseYamlInterface

GeoIPS interface for Products plugins.

get_plugin(source_name, name, product_spec_override=None, rebuild_registries=None)[source]#

Retrieve a Product plugin by source_name, name, and product_spec_override.

If product_spec_override dict is passed, values contained within product_spec_override will be used in place of those found in products list and product_defaults.

product_spec_override[product_name] matches the format of the product “spec” field.

Additionally, if the special key product_spec_override[“all”] is included, it will apply to all products not specified by name within the dictionary.

Parameters:
  • source_name (str) –

    • The name the source which the product is derived from.

  • name (str) –

    • The name the desired plugin.

  • dict (str) –

    • Dictionary specifying what information of the product’s spec that is to be overridden at runtime.

  • rebuild_registries (bool (default=None)) –

    • Whether or not to rebuild the registries if get_plugin fails. If set to None, default to what we have set in geoips.filenames.base_paths, which defaults to True. If specified, use the input value of rebuild_registries, which should be a boolean value. If rebuild registries is true and get_plugin fails, rebuild the plugin registry, call then call get_plugin once more with rebuild_registries toggled off, so it only gets rebuilt once.

get_plugin_metadata(source_name, name)[source]#

Retrieve a product plugin’s metadata.

Where the metadata of the plugin matches the plugin’s corresponding entry in the plugin registry.

Parameters:
  • source_name (str) –

    • The source (sensor) which this product is derived from.

  • name (str) –

    • The name of the product plugin whose metadata we’d like to retrieve.

Returns:

metadata

  • A dictionary of metadata for the requested plugin.

Return type:

dict

get_plugins()[source]#

Retrieve a plugin by name.

name = 'products'#
plugin_is_valid(source_name, name)[source]#

Test that the named plugin is valid.

test_interface()[source]#

Test interface method.

use_pydantic = False#
validator = <geoips.interfaces.yaml_based.products.ProductsPluginValidator object>#
class geoips.interfaces.yaml_based.products.ProductsPluginValidator[source]#

Bases: YamlPluginValidator

Validator for Products plugins.

This differs from other validators for two reasons:

  1. Most plugins are identified solely by ‘name’. Products are identified by ‘source_name’ and ‘name.

  2. Most plugins supply their ‘family’ directly. Products can supply it directly, but can, alternatively, specify a ‘product_defaults’ plugin from which to pull ‘family’ and most other properties. This validator handles filling in a product plugin based on its specified product defaults plugin.

validate(plugin, validator_id=None)[source]#

Validate a Products plugin against the relevant schema.

The relevant schema is determined based on the interface and family of the plugin.

validate_product(product)[source]#

Validate single product.

geoips.interfaces.yaml_based.sectors module#

Sector interface module.

class geoips.interfaces.yaml_based.sectors.SectorPluginBase(*args, **kwargs)[source]#

Bases: BaseYamlPlugin

The base class for all sector plugins.

This class provides the functionality specific to sector plugin classes. It should not be instantiated directly. To access sector plugins, use geoips.interfaces.sectors.

property area_definition#

Return the pyresample AreaDefinition for the sector.

call(data=None, **kwargs)[source]#

Return a DataTree with the sector’s area-definition metadata.

Parameters:
  • data (xr.DataTree or None) – Upstream DataTree (unused for sectors).

  • \*\*kwargs – Step arguments (unused).

Returns:

A DataTreeDitto whose ds.attrs carry area_id, area_extent, shape, and projection for downstream consumers (e.g. interpolator, filename formatter). Per the DataTree spec, this metadata lives in the step node’s attrs (there is no separate /metadata node).

Return type:

xr.DataTree

create_test_plot(fname, return_fig_ax_map=False, overlay=False, gridlines=False, gridline_labels=[], noborder=True)[source]#

Create a test PNG image for this sector.

Parameters:
  • fname (str) –

    • The full path to the output image.

  • return_fix_ax_map (bool, default=False) –

    • Whether or not we should save the image to disk or return the figure, axes, and mapobj variables in memory

  • overlay (bool, default=False) –

    • If true, overlay this sector on the global grid and make it slightly transparent. Useful for projecting tiny sectors on the global grid to get a sense of where they’ll end up and what they’ll look like.

  • gridlines (bool, default=False) –

    • If true, add latitude longitude gridlines to the sector image.

  • gridline_labels (list[constants], default=[]) –

    • A list of constants (strings) that refer to which gridline labels to turn on.

  • noborder (bool, default=True) –

    • If true, no border will be added to the axes instance. Otherwise, add a simple border (useful for gridline labels).

data_tree = True#
class geoips.interfaces.yaml_based.sectors.SectorsInterface[source]#

Bases: BaseYamlInterface

Interface for sector plugins.

name = 'sectors'#
plugin_class#

alias of SectorPluginBase

use_pydantic = False#

geoips.interfaces.yaml_based.workflows module#

Workflow interface module.

class geoips.interfaces.yaml_based.workflows.WorkflowsInterface[source]#

Bases: BaseYamlInterface

Interface for workflow plugins.

get_plugin(name, rebuild_registries=None, _expand=False)[source]#

Get a workflow plugin by its name.

This overrides BaseYamlInterface:get_plugin as we need to support ‘expand’ functionality for the CLI command ‘geoips expand <workflow>’.

Parameters:
  • name (str) – The name of the workflow plugin.

  • rebuild_registries (bool (default=None)) – Whether or not to rebuild the registries if get_plugin fails. If set to None, default to what we have set in geoips.filenames.base_paths, which defaults to True. If specified, use the input value of rebuild_registries, which should be a boolean value. If rebuild registries is true and get_plugin fails, rebuild the plugin registry, call then call get_plugin once more with rebuild_registries toggled off, so it only gets rebuilt once.

  • _expand (private bool (default=False)) – If true, fully expand the workflow plugin in place. Otherwise, load as is done usually. This should only be used for the ‘geoips expand <workflow>’ command.

global_override_type(value: str)[source]#

Ensure an override string fits the following format.

Expected Format#

‘<global_variable_name>=<some_value>’

param value:

The full global override string for a geoips run order_based command.

type value:

str

returns:

override_dict – The validated contents of an override string in a dictionary.

rtype:

dict

kind_override_type(value: str)[source]#

Ensure an override string fits the following format.

Expected Format#

‘<kind>.<argument_name>=<some_value>’

param value:

The full kind override string for a geoips run order_based command.

type value:

str

returns:

override_dict – The validated contents of an override string in a dictionary.

rtype:

dict

name = 'workflows'#
step_override_type(value: str)[source]#

Ensure an override string fits the following format.

Expected Format#

‘<step_id>.<string1>.<optional_string2>.<optional_string3>…=<some_value>’

param value:

The full step override string for a geoips run order_based command.

type value:

str

returns:

override_dict – The validated contents of an override string in a dictionary.

rtype:

dict

use_pydantic = True#

Module contents#

YAML based interfaces init file.