geoips.interfaces package#

Subpackages#

Submodules#

geoips.interfaces.base module#

Base classes for interfaces, plugins, and plugin validation machinery.

class geoips.interfaces.base.BaseInterface[source]#

Bases: object

Base class for GeoIPS interfaces.

This class should not be instantiated directly. Instead, interfaces should be accessed by importing them from geoips.interfaces. For example: ` from geoips.interfaces import algorithms ` will retrieve an instance of AlgorithmsInterface which will provide access to the GeoIPS algorithm plugins.

class geoips.interfaces.base.BaseModuleInterface[source]#

Bases: BaseInterface

Base Class for GeoIPS Interfaces.

This class should not be instantiated directly. Instead, interfaces should be accessed by importing them from geoips.interfaces. For example: ` from geoips.interfaces import algorithms ` will retrieve an instance of AlgorithmsInterface which will provide access to the GeoIPS algorithm plugins.

get_plugin(name)[source]#

Retrieve a plugin from this interface by name.

Parameters:

name (str) – The name the desired plugin.

Returns:

  • An object of type <interface>Plugin where <interface> is the name of

  • this interface.

Raises:

PluginError – If the specified plugin isn’t found within the interface.

get_plugins()[source]#

Get a list of plugins for this interface.

plugin_is_valid(name)[source]#

Check that an interface is valid.

Check that the requested interface function has the correct call signature. Return values should be as specified below, but are not programmatically verified.

Parameters:

name (str) – Name of the interface to be validated

Returns:

True if valid, False if invalid

Return type:

bool

plugins_all_valid()[source]#

Test the current interface by validating every Plugin.

Return type:

True if all plugins are valid, False if any plugin is invalid.

test_interface()[source]#

Test the current interface by validating each Plugin and testing each method.

Test this interface by opening every Plugin available to the interface, and validating each plugin by calling plugin_is_valid for each. Additionally, ensure all methods of this interface work as expected:

  • get_plugins

  • get_plugin

  • plugin_is_valid

  • plugins_all_valid

Returns:

  • A dictionary containing three keys

  • ’by_family’, ‘validity_check’, ‘func’, and ‘family’. The value for each

  • of these keys is a dictionary whose keys are the names of the Plugins.

  • - ‘by_family’ contains a dictionary of plugin names sorted by family.

  • - ‘validity_check’ contains a dict whose keys are plugin names and whose – values are bools where True indicates that the Plugin’s function is valid according to plugin_is_valid.

  • - ‘func’ contains a dict whose keys are plugin names and whose values are – the function for each Plugin.

  • - ‘family’ contains a dict whose keys are plugin names and whose vlaues – are the contents of the ‘family’ attribute for each Plugin.

class geoips.interfaces.base.BaseModulePlugin[source]#

Bases: object

Base class for GeoIPS plugins.

class geoips.interfaces.base.BaseYamlInterface[source]#

Bases: BaseInterface

Base class for GeoIPS yaml-based plugin interfaces.

This class should not be instantiated directly. Instead, interfaces should be accessed by importing them from geoips.interfaces. For example: ` from geoips.interfaces import products ` will retrieve an instance of ProductsInterface which will provide access to the GeoIPS products plugins.

get_plugin(name)[source]#

Get a plugin by its name.

This default method can be overridden to provide different search functionality for an interface. An example of this is in the ProductsInterface which uses a tuple containing ‘source_name’ and ‘name’.

get_plugins()[source]#

Retrieve a plugin by name.

plugin_is_valid(name)[source]#

Plugin is valid method.

plugins_all_valid()[source]#

Plugins all valid method.

test_interface()[source]#

Test interface method.

validator = <geoips.interfaces.base.YamlPluginValidator object>#
class geoips.interfaces.base.BaseYamlPlugin(*args, **kwargs)[source]#

Bases: dict

Base class for GeoIPS plugins.

class geoips.interfaces.base.YamlPluginValidator[source]#

Bases: object

PluginValidator class.

schemas = {'bases.docstring': {'$id': 'bases.docstring', 'description': 'A docstring that describes the plugin following numpy docstring style', 'type': 'string'}, 'bases.family': {'$id': 'bases.family', '$ref': 'bases.valid_identifier', 'description': 'The family that the plugin belongs to within its interface'}, 'bases.interface': {'$id': 'bases.interface', '$ref': 'bases.valid_identifier', 'description': 'The name of the interface that the plugin belongs to'}, 'bases.name': {'$id': 'bases.name', '$ref': 'bases.valid_identifier', 'description': 'The name of the plugin', 'type': 'string'}, 'bases.product_defaults': {'$id': 'bases.product_defaults', '$ref': 'bases.valid_identifier', 'description': 'The name of the product defaults plugin to use'}, 'bases.top': {'$id': 'bases.top', 'properties': {'abspath': {'type': 'string'}, 'docstring': {'$ref': 'bases.docstring'}, 'family': {'$ref': 'bases.family'}, 'interface': {'$ref': 'bases.interface'}, 'name': {'$ref': 'bases.name'}, 'package': {'type': 'string'}, 'relpath': {'type': 'string'}}, 'required': ['interface', 'family', 'name', 'docstring'], 'type': 'object'}, 'bases.valid_identifier': {'$id': 'bases.valid_identifier', 'description': 'A valid Python identifier', 'type': 'string'}, 'feature_annotators.cartopy': {'$id': 'feature_annotators.cartopy', '$ref': 'bases.top', 'description': 'Defines which geographical boundaries should be drawn over the output products and\nhow they should be drawn. Can enable coastlines, countries, states, and rivers and\ncontrol their line width and color.\n', 'properties': {'spec': {'default': {}, 'properties': {'borders': {'if': {'properties': {'enabled': {'const': True}}}, 'properties': {'enabled': {'type': 'boolean'}}, 'then': {'properties': {'edgecolor': {'type': 'string'}, 'linewidth': {'type': 'number'}}, 'required': ['edgecolor', 'linewidth']}, 'type': 'object', 'unevaluatedProperties': False}, 'coastline': {'if': {'properties': {'enabled': {'const': True}}}, 'properties': {'enabled': {'type': 'boolean'}}, 'then': {'properties': {'edgecolor': {'type': 'string'}, 'linewidth': {'type': 'number'}}, 'required': ['edgecolor', 'linewidth']}, 'type': 'object', 'unevaluatedProperties': False}, 'rivers': {'if': {'properties': {'enabled': {'const': True}}}, 'properties': {'enabled': {'type': 'boolean'}}, 'then': {'properties': {'edgecolor': {'type': 'string'}, 'linewidth': {'type': 'number'}}, 'required': ['edgecolor', 'linewidth']}, 'type': 'object', 'unevaluatedProperties': False}, 'states': {'if': {'properties': {'enabled': {'const': True}}}, 'properties': {'enabled': {'type': 'boolean'}}, 'then': {'properties': {'edgecolor': {'type': 'string'}, 'linewidth': {'type': 'number'}}, 'required': ['edgecolor', 'linewidth']}, 'type': 'object', 'unevaluatedProperties': False}}, 'required': ['coastline', 'borders', 'rivers', 'states'], 'type': 'object', 'unevaluatedProperties': False}}, 'required': ['spec'], 'title': 'Feature Annotators'}, 'gridline_annotators.cartopy': {'$id': 'gridline_annotators.cartopy', '$ref': 'bases.top', 'description': 'Defines latitude and longitude gridlines and associated labels. Both latitude and\nlongitude lines will always be drawn. Their color, style, width, and spacing in\ndegrees can be controlled. Labels can be turned on and off for the top, bottom, left,\nand right sides of the imagery.\n', 'properties': {'spec': {'properties': {'labels': {'properties': {'bottom': {'type': 'boolean'}, 'left': {'type': 'boolean'}, 'right': {'type': 'boolean'}, 'top': {'type': 'boolean'}}, 'required': ['top', 'bottom', 'left', 'right'], 'type': 'object', 'unevaluatedProperties': False}, 'lines': {'properties': {'color': {'type': 'string'}, 'linestyle': {'items': {'type': 'integer'}, 'maxItems': 2, 'minItems': 2, 'type': 'array'}, 'linewidth': {'type': 'number'}}, 'required': ['color', 'linestyle', 'linewidth'], 'type': 'object', 'unevaluatedProperties': False}, 'spacing': {'properties': {'latitude': {'type': ['number', 'string']}, 'longitude': {'type': ['number', 'string']}}, 'required': ['latitude', 'longitude'], 'type': 'object', 'unevaluatedProperties': False}}, 'required': ['spacing', 'labels', 'lines'], 'type': 'object', 'unevaluatedProperties': False}}, 'required': ['spec'], 'title': 'Gridline Annotator'}, 'product_defaults.algorithm': {'$id': 'product_defaults.algorithm', '$ref': 'bases.top', 'properties': {'family': {'const': 'algorithm'}, 'spec': {'$ref': 'product_defaults.specs.algorithm', 'unevaluatedProperties': False}}, 'required': ['spec'], 'type': 'object'}, 'product_defaults.algorithm_colormapper': {'$id': 'product_defaults.algorithm_colormapper', '$ref': 'bases.top', 'properties': {'family': {'const': 'algorithm_colormapper'}, 'spec': {'$ref': 'product_defaults.specs.algorithm_colormapper', 'unevaluatedProperties': False}}, 'required': ['spec'], 'type': 'object'}, 'product_defaults.algorithm_interpolator_colormapper': {'$id': 'product_defaults.algorithm_interpolator_colormapper', '$ref': 'bases.top', 'properties': {'family': {'const': 'algorithm_interpolator_colormapper'}, 'spec': {'$ref': 'product_defaults.specs.algorithm_interpolator_colormapper', 'unevaluatedProperties': False}}, 'required': ['spec'], 'type': 'object'}, 'product_defaults.bases.algorithm': {'$id': 'product_defaults.bases.algorithm', 'properties': {'plugin': {'properties': {'arguments': {'type': 'object', 'unevaluatedProperties': True}, 'name': {'type': 'string'}}, 'required': ['name', 'arguments'], 'type': 'object'}}, 'required': ['plugin'], 'title': 'Algorithm', 'type': 'object', 'unevaluatedProperties': False}, 'product_defaults.bases.colormapper': {'$id': 'product_defaults.bases.colormapper', 'properties': {'plugin': {'properties': {'arguments': {'properties': {'cbar_full_width': {'type': 'boolean'}, 'cbar_label': {'type': 'string'}, 'cbar_spacing': {'type': 'string'}, 'cbar_tick_labels': {'items': {'type': 'number'}, 'type': 'array'}, 'cbar_ticks': {'items': {'type': 'number'}, 'type': 'array'}, 'cmap_name': {'type': 'string'}, 'cmap_path': {'type': 'string'}, 'cmap_source': {'type': 'string'}, 'colorbar_kwargs': {'type': 'object', 'unevaluatedProperties': True}, 'create_colorbar': {'type': 'boolean'}, 'data_range': {'items': {'type': 'number'}, 'maxItems': 2, 'minItems': 2, 'type': 'array'}, 'set_label_kwargs': {'type': 'object', 'unevaluatedProperties': True}, 'set_ticks_kwargs': {'type': 'object', 'unevaluatedProperties': True}}, 'type': 'object', 'unevaluatedProperties': False}, 'name': {'type': 'string'}}, 'required': ['name', 'arguments'], 'type': 'object'}}, 'required': ['plugin'], 'title': 'Colormap', 'type': 'object', 'unevaluatedProperties': False}, 'product_defaults.bases.coverage_checker': {'$id': 'product_defaults.bases.coverage_checker', 'properties': {'plugin': {'properties': {'arguments': {'type': 'object', 'unevaluatedProperties': True}, 'name': {'type': 'string'}}, 'required': ['name', 'arguments'], 'type': 'object'}}, 'required': ['plugin'], 'title': 'Coverage Checker', 'unevaluatedProperties': False}, 'product_defaults.bases.interpolator': {'$id': 'product_defaults.bases.interpolator', 'properties': {'plugin': {'properties': {'arguments': {'type': 'object', 'unevaluatedProperties': True}, 'name': {'type': 'string'}}, 'required': ['name', 'arguments'], 'type': 'object'}}, 'required': ['plugin'], 'title': 'Interpolator', 'unevaluatedProperties': False}, 'product_defaults.bases.unvalidated': {'$id': 'product_defaults.bases.unvalidated', 'properties': {'spec': {'type': 'object', 'unevaluatedProperties': True}}, 'required': ['spec'], 'type': 'object'}, 'product_defaults.bases.windbarb_plotter': {'$id': 'product_defaults.bases.windbarb_plotter', 'properties': {'plugin': {'properties': {'arguments': {'properties': {'length': {'type': 'number'}, 'rain_size': {'type': 'number'}, 'sizes_dict': {'properties': {'height': {'type': 'number'}, 'spacing': {'type': 'number'}}, 'type': 'object'}, 'thinning': {'type': 'number'}, 'width': {'type': 'number'}}, 'required': ['thinning', 'length', 'width', 'sizes_dict', 'rain_size'], 'type': 'object', 'unevaluatedProperties': False}, 'name': {'type': 'string'}}, 'required': ['name', 'arguments'], 'type': 'object'}}, 'required': ['plugin'], 'title': 'Windbarb Plotter', 'type': 'object', 'unevaluatedProperties': False}, 'product_defaults.interpolator': {'$id': 'product_defaults.interpolator', '$ref': 'bases.top', 'properties': {'family': {'const': 'interpolator'}, 'spec': {'$ref': 'product_defaults.specs.interpolator', 'unevaluatedProperties': False}}, 'required': ['spec'], 'type': 'object'}, 'product_defaults.interpolator_algorithm': {'$id': 'product_defaults.interpolator_algorithm', '$ref': 'bases.top', 'properties': {'family': {'const': 'interpolator_algorithm'}, 'spec': {'$ref': 'product_defaults.specs.interpolator_algorithm', 'unevaluatedProperties': False}}, 'required': ['spec'], 'type': 'object'}, 'product_defaults.interpolator_algorithm_colormapper': {'$id': 'product_defaults.interpolator_algorithm_colormapper', '$ref': 'bases.top', 'properties': {'family': {'const': 'interpolator_algorithm_colormapper'}, 'spec': {'$ref': 'product_defaults.specs.interpolator_algorithm_colormapper', 'unevaluatedProperties': False}}, 'required': ['spec'], 'type': 'object'}, 'product_defaults.sectored_xarray_dict_to_output_format': {'$id': 'product_defaults.sectored_xarray_dict_to_output_format', '$ref': 'product_defaults.bases.unvalidated', 'properties': {'family': {'const': 'sectored_xarray_dict_to_output_format'}}}, 'product_defaults.specs.algorithm': {'$id': 'product_defaults.specs.algorithm', 'properties': {'algorithm': {'$ref': 'product_defaults.bases.algorithm'}, 'coverage_checker': {'$ref': 'product_defaults.bases.coverage_checker'}, 'display_name': {'type': 'string'}, 'filename_coverage_checker': {'$ref': 'product_defaults.bases.coverage_checker'}, 'full_coverage_checker': {'$ref': 'product_defaults.bases.coverage_checker'}, 'image_production_coverage_checker': {'$ref': 'product_defaults.bases.coverage_checker'}, 'mtif_type': {'type': 'string'}, 'pad_area_definition': {'type': 'boolean'}, 'windbarb_plotter': {'$ref': 'product_defaults.bases.windbarb_plotter'}}, 'required': ['algorithm'], 'type': 'object'}, 'product_defaults.specs.algorithm_colormapper': {'$id': 'product_defaults.specs.algorithm_colormapper', 'properties': {'algorithm': {'$ref': 'product_defaults.bases.algorithm'}, 'colormapper': {'$ref': 'product_defaults.bases.colormapper'}, 'coverage_checker': {'$ref': 'product_defaults.bases.coverage_checker'}, 'display_name': {'type': 'string'}, 'filename_coverage_checker': {'$ref': 'product_defaults.bases.coverage_checker'}, 'full_coverage_checker': {'$ref': 'product_defaults.bases.coverage_checker'}, 'image_production_coverage_checker': {'$ref': 'product_defaults.bases.coverage_checker'}, 'mtif_type': {'type': 'string'}, 'pad_area_definition': {'type': 'boolean'}, 'windbarb_plotter': {'$ref': 'product_defaults.bases.windbarb_plotter'}}, 'required': ['algorithm', 'colormapper'], 'type': 'object'}, 'product_defaults.specs.algorithm_interpolator_colormapper': {'$id': 'product_defaults.specs.algorithm_interpolator_colormapper', 'properties': {'algorithm': {'$ref': 'product_defaults.bases.algorithm'}, 'colormapper': {'$ref': 'product_defaults.bases.colormapper'}, 'coverage_checker': {'$ref': 'product_defaults.bases.coverage_checker'}, 'display_name': {'type': 'string'}, 'filename_coverage_checker': {'$ref': 'product_defaults.bases.coverage_checker'}, 'full_coverage_checker': {'$ref': 'product_defaults.bases.coverage_checker'}, 'image_production_coverage_checker': {'$ref': 'product_defaults.bases.coverage_checker'}, 'interpolator': {'$ref': 'product_defaults.bases.interpolator'}, 'mtif_type': {'type': 'string'}, 'pad_area_definition': {'type': 'boolean'}, 'windbarb_plotter': {'$ref': 'product_defaults.bases.windbarb_plotter'}}, 'required': ['interpolator', 'algorithm', 'colormapper'], 'type': 'object'}, 'product_defaults.specs.interpolator': {'$id': 'product_defaults.specs.interpolator', 'properties': {'coverage_checker': {'$ref': 'product_defaults.bases.coverage_checker'}, 'display_name': {'type': 'string'}, 'filename_coverage_checker': {'$ref': 'product_defaults.bases.coverage_checker'}, 'full_coverage_checker': {'$ref': 'product_defaults.bases.coverage_checker'}, 'image_production_coverage_checker': {'$ref': 'product_defaults.bases.coverage_checker'}, 'interpolator': {'$ref': 'product_defaults.bases.interpolator'}, 'mtif_type': {'type': 'string'}, 'pad_area_definition': {'type': 'boolean'}, 'windbarb_plotter': {'$ref': 'product_defaults.bases.windbarb_plotter'}}, 'required': ['interpolator'], 'type': 'object'}, 'product_defaults.specs.interpolator_algorithm': {'$id': 'product_defaults.specs.interpolator_algorithm', 'properties': {'algorithm': {'$ref': 'product_defaults.bases.algorithm'}, 'coverage_checker': {'$ref': 'product_defaults.bases.coverage_checker'}, 'display_name': {'type': 'string'}, 'filename_coverage_checker': {'$ref': 'product_defaults.bases.coverage_checker'}, 'full_coverage_checker': {'$ref': 'product_defaults.bases.coverage_checker'}, 'image_production_coverage_checker': {'$ref': 'product_defaults.bases.coverage_checker'}, 'interpolator': {'$ref': 'product_defaults.bases.interpolator'}, 'mtif_type': {'type': 'string'}, 'pad_area_definition': {'type': 'boolean'}, 'windbarb_plotter': {'$ref': 'product_defaults.bases.windbarb_plotter'}}, 'required': ['interpolator', 'algorithm'], 'type': 'object'}, 'product_defaults.specs.interpolator_algorithm_colormapper': {'$id': 'product_defaults.specs.interpolator_algorithm_colormapper', 'properties': {'algorithm': {'$ref': 'product_defaults.bases.algorithm'}, 'colormapper': {'$ref': 'product_defaults.bases.colormapper'}, 'coverage_checker': {'$ref': 'product_defaults.bases.coverage_checker'}, 'display_name': {'type': 'string'}, 'filename_coverage_checker': {'$ref': 'product_defaults.bases.coverage_checker'}, 'full_coverage_checker': {'$ref': 'product_defaults.bases.coverage_checker'}, 'image_production_coverage_checker': {'$ref': 'product_defaults.bases.coverage_checker'}, 'interpolator': {'$ref': 'product_defaults.bases.interpolator'}, 'mtif_type': {'type': 'string'}, 'pad_area_definition': {'type': 'boolean'}, 'windbarb_plotter': {'$ref': 'product_defaults.bases.windbarb_plotter'}}, 'required': ['interpolator', 'algorithm', 'colormapper'], 'type': 'object'}, 'product_defaults.specs.xarray_dict_to_output_format': {'$id': 'product_defaults.specs.xarray_dict_to_output_format', 'type': 'object', 'unevaluatedProperties': True}, 'product_defaults.unmodified': {'$id': 'product_defaults.unmodified', '$ref': 'product_defaults.bases.unvalidated', 'properties': {'family': {'const': 'unmodified'}}}, 'product_defaults.unsectored_xarray_dict_area_to_output_format': {'$id': 'product_defaults.unsectored_xarray_dict_area_to_output_format', '$ref': 'product_defaults.bases.unvalidated', 'properties': {'family': {'const': 'unsectored_xarray_dict_area_to_output_format'}}}, 'product_defaults.unsectored_xarray_dict_to_output_format': {'$id': 'product_defaults.unsectored_xarray_dict_to_output_format', '$ref': 'product_defaults.bases.unvalidated', 'properties': {'family': {'const': 'unsectored_xarray_dict_to_output_format'}}}, 'product_defaults.xarray_dict_to_output_format': {'$id': 'product_defaults.xarray_dict_to_output_format', '$ref': 'product_defaults.bases.unvalidated', 'properties': {'family': {'const': 'xarray_dict_to_output_format'}}}, 'products.algorithm': {'$id': 'products.algorithm', '$ref': 'bases.top', 'properties': {'family': {'const': 'algorithm'}, 'source_names': {'items': {'type': 'string'}, 'type': 'array'}, 'spec': {'$ref': 'product_defaults.specs.algorithm', 'properties': {'variables': {'items': {'type': 'string'}, 'type': 'array'}}, 'unevaluatedProperties': False}}, 'required': ['spec'], 'type': 'object'}, 'products.algorithm_colormapper': {'$id': 'products.algorithm_colormapper', '$ref': 'bases.top', 'properties': {'family': {'const': 'algorithm_colormapper'}, 'source_names': {'items': {'type': 'string'}, 'type': 'array'}, 'spec': {'$ref': 'product_defaults.specs.algorithm_colormapper', 'properties': {'variables': {'items': {'type': 'string'}, 'type': 'array'}}, 'unevaluatedProperties': False}}, 'required': ['spec'], 'type': 'object'}, 'products.algorithm_interpolator_colormapper': {'$id': 'products.algorithm_interpolator_colormapper', '$ref': 'bases.top', 'properties': {'family': {'const': 'algorithm_interpolator_colormapper'}, 'source_names': {'items': {'type': 'string'}, 'type': 'array'}, 'spec': {'$ref': 'product_defaults.specs.algorithm_interpolator_colormapper', 'properties': {'variables': {'items': {'type': 'string'}, 'type': 'array'}}, 'unevaluatedProperties': False}}, 'required': ['spec'], 'type': 'object'}, 'products.bases.product': {'$id': 'products.bases.product', 'oneOf': [{'required': ['family', 'docstring']}, {'required': ['product_defaults']}], 'properties': {'docstring': {'$ref': 'bases.docstring'}, 'family': {'$ref': 'bases.family'}, 'name': {'$ref': 'bases.name'}, 'product_defaults': {'$ref': 'bases.product_defaults'}, 'source_names': {'items': {'type': 'string'}, 'type': 'array'}, 'spec': {'properties': {'variables': {'items': {'type': 'string'}, 'minItems': 1, 'type': 'array'}}, 'type': 'object'}}, 'required': ['name', 'source_names'], 'type': 'object', 'unevaluatedProperties': False}, 'products.interpolator': {'$id': 'products.interpolator', '$ref': 'bases.top', 'properties': {'family': {'const': 'interpolator'}, 'source_names': {'items': {'type': 'string'}, 'type': 'array'}, 'spec': {'$ref': 'product_defaults.specs.interpolator', 'properties': {'variables': {'items': {'type': 'string'}, 'type': 'array'}}, 'unevaluatedProperties': False}}, 'required': ['spec'], 'type': 'object'}, 'products.interpolator_algorithm': {'$id': 'products.interpolator_algorithm', '$ref': 'bases.top', 'properties': {'family': {'const': 'interpolator_algorithm'}, 'source_names': {'items': {'type': 'string'}, 'type': 'array'}, 'spec': {'$ref': 'product_defaults.specs.interpolator_algorithm', 'properties': {'variables': {'items': {'type': 'string'}, 'type': 'array'}}, 'unevaluatedProperties': False}}, 'required': ['spec'], 'type': 'object'}, 'products.interpolator_algorithm_colormapper': {'$id': 'products.interpolator_algorithm_colormapper', '$ref': 'bases.top', 'properties': {'family': {'const': 'interpolator_algorithm_colormapper'}, 'source_names': {'items': {'type': 'string'}, 'type': 'array'}, 'spec': {'$ref': 'product_defaults.specs.interpolator_algorithm_colormapper', 'properties': {'variables': {'items': {'type': 'string'}, 'type': 'array'}}, 'unevaluatedProperties': False}}, 'required': ['spec'], 'type': 'object'}, 'products.list': {'$id': 'products.list', '$ref': 'bases.top', 'properties': {'spec': {'properties': {'products': {'items': {'$ref': 'products.bases.product', 'type': 'object'}, 'type': 'array'}}, 'type': 'object'}}, 'required': ['spec']}, 'products.sectored_xarray_dict_to_output_format': {'$id': 'products.sectored_xarray_dict_to_output_format', '$ref': 'bases.top', 'properties': {'family': {'const': 'sectored_xarray_dict_to_output_format'}, 'source_names': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['spec'], 'type': 'object'}, 'products.single': {'$id': 'products.single', '$ref': 'bases.top', 'properties': {'spec': {'properties': {'product': {'$ref': 'products.bases.product'}}, 'required': ['product'], 'type': 'object'}}, 'required': ['spec']}, 'products.unmodified': {'$id': 'products.unmodified', '$ref': 'bases.top', 'properties': {'family': {'const': 'unmodified'}, 'source_names': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['spec'], 'type': 'object'}, 'products.unsectored_xarray_dict_area_to_output_format': {'$id': 'products.unsectored_xarray_dict_area_to_output_format', '$ref': 'bases.top', 'properties': {'family': {'const': 'unsectored_xarray_dict_area_to_output_format'}, 'source_names': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['spec'], 'type': 'object'}, 'products.unsectored_xarray_dict_to_output_format': {'$id': 'products.unsectored_xarray_dict_to_output_format', '$ref': 'bases.top', 'properties': {'family': {'const': 'unsectored_xarray_dict_to_output_format'}, 'source_names': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['spec'], 'type': 'object'}, 'products.xarray_dict_to_output_format': {'$id': 'products.xarray_dict_to_output_format', '$ref': 'bases.top', 'properties': {'family': {'const': 'xarray_dict_to_output_format'}, 'source_names': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['spec'], 'type': 'object'}, 'sectors.area_definition_atmosriver': {'$id': 'sectors.area_definition_atmosriver', '$ref': 'bases.top', 'properties': {'metadata': {'$ref': 'sectors.metadata_families.atmosriver'}, 'spec': {'$ref': 'sectors.specs.area_definition'}}, 'required': ['spec', 'metadata']}, 'sectors.area_definition_pyrocb': {'$id': 'sectors.area_definition_pyrocb', '$ref': 'bases.top', 'properties': {'metadata': {'$ref': 'sectors.metadata_families.pyrocb'}, 'spec': {'$ref': 'sectors.specs.area_definition'}}, 'required': ['spec', 'metadata']}, 'sectors.area_definition_static': {'$id': 'sectors.area_definition_static', '$ref': 'bases.top', 'properties': {'metadata': {'$ref': 'sectors.metadata_families.static'}, 'spec': {'$ref': 'sectors.specs.area_definition'}}, 'required': ['spec', 'metadata']}, 'sectors.area_definition_stitched': {'$id': 'sectors.area_definition_stitched', '$ref': 'bases.top', 'properties': {'metadata': {'$ref': 'sectors.metadata_families.stitched'}, 'spec': {'$ref': 'sectors.specs.area_definition'}}, 'required': ['spec', 'metadata']}, 'sectors.area_definition_tc': {'$id': 'sectors.area_definition_tc', '$ref': 'bases.top', 'properties': {'metadata': {'$ref': 'sectors.metadata_families.tc'}, 'spec': {'$ref': 'sectors.specs.area_definition'}}, 'required': ['spec', 'metadata']}, 'sectors.area_definition_volcano': {'$id': 'sectors.area_definition_volcano', '$ref': 'bases.top', 'properties': {'metadata': {'$ref': 'sectors.metadata_families.volcano'}, 'spec': {'$ref': 'sectors.specs.area_definition'}}, 'required': ['spec', 'metadata']}, 'sectors.generated': {'$id': 'sectors.generated', '$ref': 'bases.top', 'properties': {'spec': {'properties': {'sector_spec_generator': {'properties': {'arguments': {'type': 'object'}, 'name': {'type': 'string'}}, 'required': ['name', 'arguments'], 'type': 'object'}}, 'required': ['sector_spec_generator'], 'type': 'object'}}, 'required': ['spec']}, 'sectors.metadata_families.atmosriver': {'$id': 'sectors.metadata_families.atmosriver', 'properties': {'box_resolution_km': {'type': 'number'}, 'max_lat': {'type': 'number'}, 'max_lon': {'type': 'number'}, 'min_lat': {'type': 'number'}, 'min_lon': {'type': 'number'}}, 'type': 'object'}, 'sectors.metadata_families.pyrocb': {'$id': 'sectors.metadata_families.pyrocb', 'properties': {'box_resolution_km': {'type': 'number'}, 'max_lat': {'type': 'number'}, 'max_lon': {'type': 'number'}, 'min_lat': {'type': 'number'}, 'min_lon': {'type': 'number'}}, 'type': 'object'}, 'sectors.metadata_families.static': {'$id': 'sectors.metadata_families.static', 'properties': {'region': {'properties': {'area': {'type': 'string'}, 'city': {'type': 'string'}, 'continent': {'type': 'string'}, 'country': {'type': 'string'}, 'state': {'type': 'string'}, 'subarea': {'type': 'string'}}, 'type': 'object'}}, 'type': 'object'}, 'sectors.metadata_families.stitched': {'$id': 'sectors.metadata_families.stitched', 'properties': {'area': {'type': 'string'}, 'city': {'type': 'string'}, 'continent': {'type': 'string'}, 'country': {'type': 'string'}, 'primary_area_definition': {'type': 'string'}, 'state': {'type': 'string'}, 'subarea': {'type': 'string'}}, 'type': 'object'}, 'sectors.metadata_families.tc': {'$id': 'sectors.metadata_families.tc', 'properties': {'aid_type': {'type': 'string'}, 'clat': {'type': 'number'}, 'clon': {'type': 'number'}, 'deck_line': {'type': 'object'}, 'final_storm_name': {'type': 'string'}, 'pressure': {'type': 'number'}, 'source_file': {'type': 'string'}, 'storm_basin': {'type': 'string'}, 'storm_name': {'type': 'string'}, 'storm_num': {'type': 'integer'}, 'storm_year': {'type': 'integer'}, 'synoptic_time': {'type': 'object'}, 'vmax': {'type': 'number'}}, 'type': 'object'}, 'sectors.metadata_families.volcano': {'$id': 'sectors.metadata_families.volcano', 'properties': {'clat': {'type': 'number'}, 'clon': {'type': 'number'}, 'plume_height': {'type': 'number'}, 'summit_elevation': {'type': 'number'}, 'wind_dir': {'type': 'number'}, 'wind_speed': {'type': 'number'}}, 'type': 'object'}, 'sectors.specs.area_definition': {'$id': 'sectors.specs.area_definition', 'properties': {'area_extent': {'properties': {'lower_left_xy': {'items': {'type': 'integer'}, 'maxItems': 2, 'minItems': 2, 'type': 'array'}, 'upper_right_xy': {'items': {'type': 'integer'}, 'maxItems': 2, 'minItems': 2, 'type': 'array'}}, 'required': ['lower_left_xy', 'upper_right_xy'], 'type': 'object'}, 'area_id': {'type': 'string'}, 'description': {'type': 'string'}, 'projection': {'type': 'object'}, 'resolution': {'items': {'type': 'integer'}, 'maxItems': 2, 'minItems': 2, 'type': 'array'}, 'shape': {'properties': {'height': {'type': 'integer'}, 'width': {'type': 'integer'}}, 'required': ['height', 'width'], 'type': 'object'}}, 'required': ['area_id'], 'type': 'object'}}#
validate(plugin, validator_id=None)[source]#

Validate a YAML plugin against the relevant schema.

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

validate_list(plugin)[source]#

Validate a list of YAML plugins.

Some interfaces allow a ‘list’ family. These list plugins will contain a property that is the same as the interface’s name. Under that is a list of individual plugins.

This function will add the interface property to each plugin in the list, then validate each plugin.

validators = {'bases.docstring': Draft202012Validator(schema={'$id': 'bases.docstring', 'description': 'A docstring ...cstring style', 'type': 'string'}, format_checker=None), 'bases.family': Draft202012Validator(schema={'$id': 'bases.family', '$ref': 'bases.valid_identifier', 'description': 'The family t...its interface'}, format_checker=None), 'bases.interface': Draft202012Validator(schema={'$id': 'bases.interface', '$ref': 'bases.valid_identifier', 'description': 'The name of ...in belongs to'}, format_checker=None), 'bases.name': Draft202012Validator(schema={'$id': 'bases.name', '$ref': 'bases.valid_identifier', 'description': 'The name of the plugin', 'type': 'string'}, format_checker=None), 'bases.product_defaults': Draft202012Validator(schema={'$id': 'bases.product_defaults', '$ref': 'bases.valid_identifier', 'description': 'The name of ...plugin to use'}, format_checker=None), 'bases.top': Draft202012Validator(schema={'$id': 'bases.top', 'properties': {'abspath': {'type': 'string'}, 'docstring': {'$ref': 'bases.docstring'}, 'family': {'$ref': 'bases.family'}, 'interface': {'$ref': 'bases.interface'}, ...}, 'required': ['interface', 'family', 'name', 'docstring'], 'type': 'object'}, format_checker=None), 'bases.valid_identifier': Draft202012Validator(schema={'$id': 'bases.valid_identifier', 'description': 'A valid Python identifier', 'type': 'string'}, format_checker=None), 'feature_annotators.cartopy': Draft202012Validator(schema={'$id': 'feature_annotators.cartopy', '$ref': 'bases.top', 'description': 'Defines whic... and color.\n', 'properties': {'spec': {'default': {}, 'properties': {'borders': {'if': {'properties': {...}}, 'properties': {'enabled': {...}}, 'then': {'properties': {...}, 'required': [...]}, 'type': 'object', ...}, 'coastline': {'if': {'properties': {...}}, 'properties': {'enabled': {...}}, 'then': {'properties': {...}, 'required': [...]}, 'type': 'object', ...}, 'rivers': {'if': {'properties': {...}}, 'properties': {'enabled': {...}}, 'then': {'properties': {...}, 'required': [...]}, 'type': 'object', ...}, 'states': {'if': {'properties': {...}}, 'properties': {'enabled': {...}}, 'then': {'properties': {...}, 'required': [...]}, 'type': 'object', ...}}, 'required': ['coastline', 'borders', 'rivers', 'states'], 'type': 'object', ...}}, ...}, format_checker=None), 'gridline_annotators.cartopy': Draft202012Validator(schema={'$id': 'gridline_annotators.cartopy', '$ref': 'bases.top', 'description': 'Defines lati...he imagery.\n', 'properties': {'spec': {'properties': {'labels': {'properties': {'bottom': {...}, 'left': {...}, 'right': {...}, 'top': {...}}, 'required': ['top', 'bottom', 'left', 'right'], 'type': 'object', 'unevaluatedProperties': False}, 'lines': {'properties': {'color': {...}, 'linestyle': {...}, 'linewidth': {...}}, 'required': ['color', 'linestyle', 'linewidth'], 'type': 'object', 'unevaluatedProperties': False}, 'spacing': {'properties': {'latitude': {...}, 'longitude': {...}}, 'required': ['latitude', 'longitude'], 'type': 'object', 'unevaluatedProperties': False}}, 'required': ['spacing', 'labels', 'lines'], 'type': 'object', 'unevaluatedProperties': False}}, ...}, format_checker=None), 'product_defaults.algorithm': Draft202012Validator(schema={'$id': 'product_defaults.algorithm', '$ref': 'bases.top', 'properties': {'family': {'const': 'algorithm'}, 'spec': {'$ref': 'product_defa...ecs.algorithm', 'unevaluatedProperties': False}}, 'required': ['spec'], ...}, format_checker=None), 'product_defaults.algorithm_colormapper': Draft202012Validator(schema={'$id': 'product_defa...m_colormapper', '$ref': 'bases.top', 'properties': {'family': {'const': 'algorithm_colormapper'}, 'spec': {'$ref': 'product_defa...m_colormapper', 'unevaluatedProperties': False}}, 'required': ['spec'], ...}, format_checker=None), 'product_defaults.algorithm_interpolator_colormapper': Draft202012Validator(schema={'$id': 'product_defa...r_colormapper', '$ref': 'bases.top', 'properties': {'family': {'const': 'algorithm_in...r_colormapper'}, 'spec': {'$ref': 'product_defa...r_colormapper', 'unevaluatedProperties': False}}, 'required': ['spec'], ...}, format_checker=None), 'product_defaults.bases.algorithm': Draft202012Validator(schema={'$id': 'product_defa...ses.algorithm', 'properties': {'plugin': {'properties': {'arguments': {'type': 'object', 'unevaluatedProperties': True}, 'name': {'type': 'string'}}, 'required': ['name', 'arguments'], 'type': 'object'}}, 'required': ['plugin'], 'title': 'Algorithm', ...}, format_checker=None), 'product_defaults.bases.colormapper': Draft202012Validator(schema={'$id': 'product_defa...s.colormapper', 'properties': {'plugin': {'properties': {'arguments': {'properties': {'cbar_full_width': {...}, 'cbar_label': {...}, 'cbar_spacing': {...}, 'cbar_tick_labels': {...}, ...}, 'type': 'object', 'unevaluatedProperties': False}, 'name': {'type': 'string'}}, 'required': ['name', 'arguments'], 'type': 'object'}}, 'required': ['plugin'], 'title': 'Colormap', ...}, format_checker=None), 'product_defaults.bases.coverage_checker': Draft202012Validator(schema={'$id': 'product_defa...erage_checker', 'properties': {'plugin': {'properties': {'arguments': {'type': 'object', 'unevaluatedProperties': True}, 'name': {'type': 'string'}}, 'required': ['name', 'arguments'], 'type': 'object'}}, 'required': ['plugin'], 'title': 'Coverage Checker', ...}, format_checker=None), 'product_defaults.bases.interpolator': Draft202012Validator(schema={'$id': 'product_defa....interpolator', 'properties': {'plugin': {'properties': {'arguments': {'type': 'object', 'unevaluatedProperties': True}, 'name': {'type': 'string'}}, 'required': ['name', 'arguments'], 'type': 'object'}}, 'required': ['plugin'], 'title': 'Interpolator', ...}, format_checker=None), 'product_defaults.bases.unvalidated': Draft202012Validator(schema={'$id': 'product_defa...s.unvalidated', 'properties': {'spec': {'type': 'object', 'unevaluatedProperties': True}}, 'required': ['spec'], 'type': 'object'}, format_checker=None), 'product_defaults.bases.windbarb_plotter': Draft202012Validator(schema={'$id': 'product_defa...dbarb_plotter', 'properties': {'plugin': {'properties': {'arguments': {'properties': {'length': {...}, 'rain_size': {...}, 'sizes_dict': {...}, 'thinning': {...}, ...}, 'required': ['thinning', 'length', 'width', 'sizes_dict', 'rain_size'], 'type': 'object', 'unevaluatedProperties': False}, 'name': {'type': 'string'}}, 'required': ['name', 'arguments'], 'type': 'object'}}, 'required': ['plugin'], 'title': 'Windbarb Plotter', ...}, format_checker=None), 'product_defaults.interpolator': Draft202012Validator(schema={'$id': 'product_defa....interpolator', '$ref': 'bases.top', 'properties': {'family': {'const': 'interpolator'}, 'spec': {'$ref': 'product_defa....interpolator', 'unevaluatedProperties': False}}, 'required': ['spec'], ...}, format_checker=None), 'product_defaults.interpolator_algorithm': Draft202012Validator(schema={'$id': 'product_defa...tor_algorithm', '$ref': 'bases.top', 'properties': {'family': {'const': 'interpolator_algorithm'}, 'spec': {'$ref': 'product_defa...tor_algorithm', 'unevaluatedProperties': False}}, 'required': ['spec'], ...}, format_checker=None), 'product_defaults.interpolator_algorithm_colormapper': Draft202012Validator(schema={'$id': 'product_defa...m_colormapper', '$ref': 'bases.top', 'properties': {'family': {'const': 'interpolator...m_colormapper'}, 'spec': {'$ref': 'product_defa...m_colormapper', 'unevaluatedProperties': False}}, 'required': ['spec'], ...}, format_checker=None), 'product_defaults.sectored_xarray_dict_to_output_format': Draft202012Validator(schema={'$id': 'product_defa...output_format', '$ref': 'product_defa...s.unvalidated', 'properties': {'family': {'const': 'sectored_xar...output_format'}}}, format_checker=None), 'product_defaults.specs.algorithm': Draft202012Validator(schema={'$id': 'product_defa...ecs.algorithm', 'properties': {'algorithm': {'$ref': 'product_defa...ses.algorithm'}, 'coverage_checker': {'$ref': 'product_defa...erage_checker'}, 'display_name': {'type': 'string'}, 'filename_coverage_checker': {'$ref': 'product_defa...erage_checker'}, ...}, 'required': ['algorithm'], 'type': 'object'}, format_checker=None), 'product_defaults.specs.algorithm_colormapper': Draft202012Validator(schema={'$id': 'product_defa...m_colormapper', 'properties': {'algorithm': {'$ref': 'product_defa...ses.algorithm'}, 'colormapper': {'$ref': 'product_defa...s.colormapper'}, 'coverage_checker': {'$ref': 'product_defa...erage_checker'}, 'display_name': {'type': 'string'}, ...}, 'required': ['algorithm', 'colormapper'], 'type': 'object'}, format_checker=None), 'product_defaults.specs.algorithm_interpolator_colormapper': Draft202012Validator(schema={'$id': 'product_defa...r_colormapper', 'properties': {'algorithm': {'$ref': 'product_defa...ses.algorithm'}, 'colormapper': {'$ref': 'product_defa...s.colormapper'}, 'coverage_checker': {'$ref': 'product_defa...erage_checker'}, 'display_name': {'type': 'string'}, ...}, 'required': ['interpolator', 'algorithm', 'colormapper'], 'type': 'object'}, format_checker=None), 'product_defaults.specs.interpolator': Draft202012Validator(schema={'$id': 'product_defa....interpolator', 'properties': {'coverage_checker': {'$ref': 'product_defa...erage_checker'}, 'display_name': {'type': 'string'}, 'filename_coverage_checker': {'$ref': 'product_defa...erage_checker'}, 'full_coverage_checker': {'$ref': 'product_defa...erage_checker'}, ...}, 'required': ['interpolator'], 'type': 'object'}, format_checker=None), 'product_defaults.specs.interpolator_algorithm': Draft202012Validator(schema={'$id': 'product_defa...tor_algorithm', 'properties': {'algorithm': {'$ref': 'product_defa...ses.algorithm'}, 'coverage_checker': {'$ref': 'product_defa...erage_checker'}, 'display_name': {'type': 'string'}, 'filename_coverage_checker': {'$ref': 'product_defa...erage_checker'}, ...}, 'required': ['interpolator', 'algorithm'], 'type': 'object'}, format_checker=None), 'product_defaults.specs.interpolator_algorithm_colormapper': Draft202012Validator(schema={'$id': 'product_defa...m_colormapper', 'properties': {'algorithm': {'$ref': 'product_defa...ses.algorithm'}, 'colormapper': {'$ref': 'product_defa...s.colormapper'}, 'coverage_checker': {'$ref': 'product_defa...erage_checker'}, 'display_name': {'type': 'string'}, ...}, 'required': ['interpolator', 'algorithm', 'colormapper'], 'type': 'object'}, format_checker=None), 'product_defaults.specs.xarray_dict_to_output_format': Draft202012Validator(schema={'$id': 'product_defa...output_format', 'type': 'object', 'unevaluatedProperties': True}, format_checker=None), 'product_defaults.unmodified': Draft202012Validator(schema={'$id': 'product_defaults.unmodified', '$ref': 'product_defa...s.unvalidated', 'properties': {'family': {'const': 'unmodified'}}}, format_checker=None), 'product_defaults.unsectored_xarray_dict_area_to_output_format': Draft202012Validator(schema={'$id': 'product_defa...output_format', '$ref': 'product_defa...s.unvalidated', 'properties': {'family': {'const': 'unsectored_x...output_format'}}}, format_checker=None), 'product_defaults.unsectored_xarray_dict_to_output_format': Draft202012Validator(schema={'$id': 'product_defa...output_format', '$ref': 'product_defa...s.unvalidated', 'properties': {'family': {'const': 'unsectored_x...output_format'}}}, format_checker=None), 'product_defaults.xarray_dict_to_output_format': Draft202012Validator(schema={'$id': 'product_defa...output_format', '$ref': 'product_defa...s.unvalidated', 'properties': {'family': {'const': 'xarray_dict_to_output_format'}}}, format_checker=None), 'products.algorithm': Draft202012Validator(schema={'$id': 'products.algorithm', '$ref': 'bases.top', 'properties': {'family': {'const': 'algorithm'}, 'source_names': {'items': {'type': 'string'}, 'type': 'array'}, 'spec': {'$ref': 'product_defa...ecs.algorithm', 'properties': {'variables': {'items': {'type': 'string'}, 'type': 'array'}}, 'unevaluatedProperties': False}}, 'required': ['spec'], ...}, format_checker=None), 'products.algorithm_colormapper': Draft202012Validator(schema={'$id': 'products.alg...m_colormapper', '$ref': 'bases.top', 'properties': {'family': {'const': 'algorithm_colormapper'}, 'source_names': {'items': {'type': 'string'}, 'type': 'array'}, 'spec': {'$ref': 'product_defa...m_colormapper', 'properties': {'variables': {'items': {'type': 'string'}, 'type': 'array'}}, 'unevaluatedProperties': False}}, 'required': ['spec'], ...}, format_checker=None), 'products.algorithm_interpolator_colormapper': Draft202012Validator(schema={'$id': 'products.alg...r_colormapper', '$ref': 'bases.top', 'properties': {'family': {'const': 'algorithm_in...r_colormapper'}, 'source_names': {'items': {'type': 'string'}, 'type': 'array'}, 'spec': {'$ref': 'product_defa...r_colormapper', 'properties': {'variables': {'items': {'type': 'string'}, 'type': 'array'}}, 'unevaluatedProperties': False}}, 'required': ['spec'], ...}, format_checker=None), 'products.bases.product': Draft202012Validator(schema={'$id': 'products.bases.product', 'oneOf': [{'required': ['family', 'docstring']}, {'required': ['product_defaults']}], 'properties': {'docstring': {'$ref': 'bases.docstring'}, 'family': {'$ref': 'bases.family'}, 'name': {'$ref': 'bases.name'}, 'product_defaults': {'$ref': 'bases.product_defaults'}, ...}, 'required': ['name', 'source_names'], ...}, format_checker=None), 'products.interpolator': Draft202012Validator(schema={'$id': 'products.interpolator', '$ref': 'bases.top', 'properties': {'family': {'const': 'interpolator'}, 'source_names': {'items': {'type': 'string'}, 'type': 'array'}, 'spec': {'$ref': 'product_defa....interpolator', 'properties': {'variables': {'items': {'type': 'string'}, 'type': 'array'}}, 'unevaluatedProperties': False}}, 'required': ['spec'], ...}, format_checker=None), 'products.interpolator_algorithm': Draft202012Validator(schema={'$id': 'products.int...tor_algorithm', '$ref': 'bases.top', 'properties': {'family': {'const': 'interpolator_algorithm'}, 'source_names': {'items': {'type': 'string'}, 'type': 'array'}, 'spec': {'$ref': 'product_defa...tor_algorithm', 'properties': {'variables': {'items': {'type': 'string'}, 'type': 'array'}}, 'unevaluatedProperties': False}}, 'required': ['spec'], ...}, format_checker=None), 'products.interpolator_algorithm_colormapper': Draft202012Validator(schema={'$id': 'products.int...m_colormapper', '$ref': 'bases.top', 'properties': {'family': {'const': 'interpolator...m_colormapper'}, 'source_names': {'items': {'type': 'string'}, 'type': 'array'}, 'spec': {'$ref': 'product_defa...m_colormapper', 'properties': {'variables': {'items': {'type': 'string'}, 'type': 'array'}}, 'unevaluatedProperties': False}}, 'required': ['spec'], ...}, format_checker=None), 'products.list': Draft202012Validator(schema={'$id': 'products.list', '$ref': 'bases.top', 'properties': {'spec': {'properties': {'products': {'items': {'$ref': 'products.bases.product', 'type': 'object'}, 'type': 'array'}}, 'type': 'object'}}, 'required': ['spec']}, format_checker=None), 'products.sectored_xarray_dict_to_output_format': Draft202012Validator(schema={'$id': 'products.sec...output_format', '$ref': 'bases.top', 'properties': {'family': {'const': 'sectored_xar...output_format'}, 'source_names': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['spec'], ...}, format_checker=None), 'products.single': Draft202012Validator(schema={'$id': 'products.single', '$ref': 'bases.top', 'properties': {'spec': {'properties': {'product': {'$ref': 'products.bases.product'}}, 'required': ['product'], 'type': 'object'}}, 'required': ['spec']}, format_checker=None), 'products.unmodified': Draft202012Validator(schema={'$id': 'products.unmodified', '$ref': 'bases.top', 'properties': {'family': {'const': 'unmodified'}, 'source_names': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['spec'], ...}, format_checker=None), 'products.unsectored_xarray_dict_area_to_output_format': Draft202012Validator(schema={'$id': 'products.uns...output_format', '$ref': 'bases.top', 'properties': {'family': {'const': 'unsectored_x...output_format'}, 'source_names': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['spec'], ...}, format_checker=None), 'products.unsectored_xarray_dict_to_output_format': Draft202012Validator(schema={'$id': 'products.uns...output_format', '$ref': 'bases.top', 'properties': {'family': {'const': 'unsectored_x...output_format'}, 'source_names': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['spec'], ...}, format_checker=None), 'products.xarray_dict_to_output_format': Draft202012Validator(schema={'$id': 'products.xar...output_format', '$ref': 'bases.top', 'properties': {'family': {'const': 'xarray_dict_to_output_format'}, 'source_names': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['spec'], ...}, format_checker=None), 'sectors.area_definition_atmosriver': Draft202012Validator(schema={'$id': 'sectors.area...on_atmosriver', '$ref': 'bases.top', 'properties': {'metadata': {'$ref': 'sectors.meta...es.atmosriver'}, 'spec': {'$ref': 'sectors.spec...ea_definition'}}, 'required': ['spec', 'metadata']}, format_checker=None), 'sectors.area_definition_pyrocb': Draft202012Validator(schema={'$id': 'sectors.area...nition_pyrocb', '$ref': 'bases.top', 'properties': {'metadata': {'$ref': 'sectors.meta...milies.pyrocb'}, 'spec': {'$ref': 'sectors.spec...ea_definition'}}, 'required': ['spec', 'metadata']}, format_checker=None), 'sectors.area_definition_static': Draft202012Validator(schema={'$id': 'sectors.area...nition_static', '$ref': 'bases.top', 'properties': {'metadata': {'$ref': 'sectors.meta...milies.static'}, 'spec': {'$ref': 'sectors.spec...ea_definition'}}, 'required': ['spec', 'metadata']}, format_checker=None), 'sectors.area_definition_stitched': Draft202012Validator(schema={'$id': 'sectors.area...tion_stitched', '$ref': 'bases.top', 'properties': {'metadata': {'$ref': 'sectors.meta...lies.stitched'}, 'spec': {'$ref': 'sectors.spec...ea_definition'}}, 'required': ['spec', 'metadata']}, format_checker=None), 'sectors.area_definition_tc': Draft202012Validator(schema={'$id': 'sectors.area_definition_tc', '$ref': 'bases.top', 'properties': {'metadata': {'$ref': 'sectors.metadata_families.tc'}, 'spec': {'$ref': 'sectors.spec...ea_definition'}}, 'required': ['spec', 'metadata']}, format_checker=None), 'sectors.area_definition_volcano': Draft202012Validator(schema={'$id': 'sectors.area...ition_volcano', '$ref': 'bases.top', 'properties': {'metadata': {'$ref': 'sectors.meta...ilies.volcano'}, 'spec': {'$ref': 'sectors.spec...ea_definition'}}, 'required': ['spec', 'metadata']}, format_checker=None), 'sectors.generated': Draft202012Validator(schema={'$id': 'sectors.generated', '$ref': 'bases.top', 'properties': {'spec': {'properties': {'sector_spec_generator': {'properties': {'arguments': {...}, 'name': {...}}, 'required': ['name', 'arguments'], 'type': 'object'}}, 'required': ['sector_spec_generator'], 'type': 'object'}}, 'required': ['spec']}, format_checker=None), 'sectors.metadata_families.atmosriver': Draft202012Validator(schema={'$id': 'sectors.meta...es.atmosriver', 'properties': {'box_resolution_km': {'type': 'number'}, 'max_lat': {'type': 'number'}, 'max_lon': {'type': 'number'}, 'min_lat': {'type': 'number'}, ...}, 'type': 'object'}, format_checker=None), 'sectors.metadata_families.pyrocb': Draft202012Validator(schema={'$id': 'sectors.meta...milies.pyrocb', 'properties': {'box_resolution_km': {'type': 'number'}, 'max_lat': {'type': 'number'}, 'max_lon': {'type': 'number'}, 'min_lat': {'type': 'number'}, ...}, 'type': 'object'}, format_checker=None), 'sectors.metadata_families.static': Draft202012Validator(schema={'$id': 'sectors.meta...milies.static', 'properties': {'region': {'properties': {'area': {'type': 'string'}, 'city': {'type': 'string'}, 'continent': {'type': 'string'}, 'country': {'type': 'string'}, ...}, 'type': 'object'}}, 'type': 'object'}, format_checker=None), 'sectors.metadata_families.stitched': Draft202012Validator(schema={'$id': 'sectors.meta...lies.stitched', 'properties': {'area': {'type': 'string'}, 'city': {'type': 'string'}, 'continent': {'type': 'string'}, 'country': {'type': 'string'}, ...}, 'type': 'object'}, format_checker=None), 'sectors.metadata_families.tc': Draft202012Validator(schema={'$id': 'sectors.metadata_families.tc', 'properties': {'aid_type': {'type': 'string'}, 'clat': {'type': 'number'}, 'clon': {'type': 'number'}, 'deck_line': {'type': 'object'}, ...}, 'type': 'object'}, format_checker=None), 'sectors.metadata_families.volcano': Draft202012Validator(schema={'$id': 'sectors.meta...ilies.volcano', 'properties': {'clat': {'type': 'number'}, 'clon': {'type': 'number'}, 'plume_height': {'type': 'number'}, 'summit_elevation': {'type': 'number'}, ...}, 'type': 'object'}, format_checker=None), 'sectors.specs.area_definition': Draft202012Validator(schema={'$id': 'sectors.spec...ea_definition', 'properties': {'area_extent': {'properties': {'lower_left_xy': {'items': {'type': 'integer'}, 'maxItems': 2, 'minItems': 2, 'type': 'array'}, 'upper_right_xy': {'items': {'type': 'integer'}, 'maxItems': 2, 'minItems': 2, 'type': 'array'}}, 'required': ['lower_left_xy', 'upper_right_xy'], 'type': 'object'}, 'area_id': {'type': 'string'}, 'description': {'type': 'string'}, 'projection': {'type': 'object'}, ...}, 'required': ['area_id'], 'type': 'object'}, format_checker=None)}#
geoips.interfaces.base.extend_with_default(validator_class)[source]#

Extend a jsonschema validator to make it respect default values.

Note: This does not pollute the input validator object. Calling jsonschema.validators.extend returns a new object.

This will cause the validator to fill in fields that have default values. In cases where fields with default values are contained inside a mapping, that mapping must have default: {} and may not have requires.

geoips.interfaces.base.get_schemas(path, validator)[source]#

Collect all of the interface schema.

geoips.interfaces.base.get_validators(schema_dict, validator_class)[source]#

Create validators for each schema in schema_dict.

Parameters:

schema_dict (dict) – A dictionary whose keys are schema $id and whose values are the full schema.

Returns:

A dictionary whose keys are schema $id and whose values are jsonschema validator instances.

Return type:

dict

geoips.interfaces.base.plugin_module_to_obj(name, module, obj_attrs={})[source]#

Convert a module plugin to an object.

Convert the passed module plugin into an object and return it. The returned object will be derrived from a class named <interface>Plugin where interface is the interface specified by the plugin. This class is derrived from BasePlugin.

This function is used instead of predefined classes to allow setting __doc__ and __call__ on a plugin-by-plugin basis. This allows collecting __doc__ and __call__ from the plugin modules and using them in the objects.

For a module to be converted into an object it must meet the following requirements:

  • The module must define a docstring. This will be used as the docstring for the plugin class as well as the docstring for the plugin when requested on the command line. The first line will be used as a “short” description, and the full docstring will be used as a more detailed discussion of the plugin.

  • The following global attributes must be defined in the module: - interface: The name of the interface that the plugin belongs to. - family: The family of plugins that the plugin belongs to within the interface. - name: The name of the plugin which must be unique within the interface.

  • A callable named call that will be called when the plugin is used.

Parameters:
  • module (module) – The imported plugin module.

  • obj_attrs (dict, optional) – Additional attributes to be assigned to the plugin object.

Returns:

  • An object of type <interface>InterfacePlugin where <interface> is the name

  • of the interface that the desired plugin belongs to.

geoips.interfaces.base.plugin_repr(obj)[source]#

Repr plugin string.

geoips.interfaces.base.plugin_yaml_to_obj(name, yaml_plugin, obj_attrs={'__doc__': 'The default products_source_name fusion plugin configuration.\n', 'abspath': '/satops/users/surratt/public_test_install/template_fusion_plugin/my_fusion_package/plugins/yaml/products/my_layered.yaml', 'docstring': 'The default products_source_name fusion plugin configuration.\n', 'family': 'list', 'id': 'my_layered_list', 'interface': 'products', 'name': 'my_layered_list', 'package': 'my_fusion_package', 'relpath': 'yaml/products/my_layered.yaml', 'yaml': {'abspath': '/satops/users/surratt/public_test_install/template_fusion_plugin/my_fusion_package/plugins/yaml/products/my_layered.yaml', 'docstring': 'The default products_source_name fusion plugin configuration.\n', 'family': 'list', 'interface': 'products', 'name': 'my_layered_list', 'package': 'my_fusion_package', 'relpath': 'yaml/products/my_layered.yaml', 'spec': {'products': [{'name': 'My-Layered-Winds', 'source_names': ['my_layered_source'], 'docstring': 'Layered winds product using default 2 colorbar placement.\n\nThis example layered image includes default colorbar placement\nfor both windspeed and ir products, and no colorbar for windbarbs.\n', 'spec': {'coverage_checker': {'plugin': {'name': 'masked_arrays', 'arguments': {'variable_name': 'windspeed:wind_speed_kts'}}}, 'mpl_colors_info': {'windbarbs': {'colorbar': False, 'colorbar_positioning': {'start_x_pos': 0.7666666666666667, 'end_x_pos': 1.0, 'start_y_pos': -0.07792207792207793, 'end_y_pos': -0.05194805194805195}}, 'windspeed': {'colorbar': True, 'colorbar_positioning': {'start_x_pos': 0.26666666666666666, 'end_x_pos': 0.7333333333333334, 'start_y_pos': -0.07792207792207793, 'end_y_pos': -0.05194805194805195}}, 'ir': {'colorbar': True, 'colorbar_positioning': {'start_x_pos': 0.0, 'end_x_pos': 0.23333333333333334, 'start_y_pos': -0.07792207792207793, 'end_y_pos': -0.05194805194805195}, 'cbar_label': 'BT (degrees C)'}}}, 'interface': 'products', 'family': 'xarray_dict_to_output_format', 'package': 'data_fusion', 'relpath': 'yaml/product_defaults/Layered-Winds-Horizontal-Adjust.yaml', 'abspath': '/satops/users/surratt/public_test_install/data_fusion/data_fusion/plugins/yaml/product_defaults/Layered-Winds-Horizontal-Adjust.yaml'}]}}})[source]#

Convert a yaml plugin to an object.

Convert the passed YAML plugin into an object and return it. The returned object will be derived from a class named <interface>Plugin where interface is the interface specified by the plugin. This class is derived from BasePlugin.

This function is used instead of predefined classes to allow setting __doc__ on a plugin-by-plugin basis. This allows collecting __doc__ and from the plugin and using them in the objects.

For a yaml plugin to be converted into an object it must meet the following requirements:

  • Must match the jsonschema spec provided for its interface.

  • The plugin must have the following top-level attributes and the must not be empty. - interface: The name of the interface that the plugin belongs to. - family: The family of plugins that the plugin belongs to within the interface. - name: The name of the plugin which must be unique within the interface. - docstring: A string to be used as the object’s docstring.

Module contents#

GeoIPS interface module.