shnitsel.data.xr_io_registry ============================ .. py:module:: shnitsel.data.xr_io_registry Attributes ---------- .. autoapisummary:: shnitsel.data.xr_io_registry.Readable shnitsel.data.xr_io_registry.INPUT_TYPE_REGISTRY Functions --------- .. autoapisummary:: shnitsel.data.xr_io_registry.register_custom_xr_input_type shnitsel.data.xr_io_registry.get_registered_input_handler shnitsel.data.xr_io_registry.setup_defaults Module Contents --------------- .. py:data:: Readable .. py:data:: INPUT_TYPE_REGISTRY :type: dict[str, type[shnitsel.data.xr_io_compatibility.SupportsFromXrConversion]] .. py:function:: register_custom_xr_input_type(cls, io_type_tag = None) Function to register a custom type that can be parsed from an xarray Dataset using the `SupportsFromXrConversion` protocol definition to support input from xarray style netcdf files. :param cls: A class supporting the `SupportsFromXrConversion` protocol to be invoked to deserialize an object from a `xr.Dataset` instance when reading a netcdf file. :type cls: type[Readable] :param io_type_tag: The string type tag to be used to mark this class as the executing instance for deserialization. If not set, will use `get_type_marker()` on the registered class. :type io_type_tag: str, optional :returns: True if registration succeeded. False if there was a clash with the `io_type_tag` of an existing type. :rtype: bool .. py:function:: get_registered_input_handler(io_type_tag) Function to look up a potentially registered input handler for a previously serialized data type. If no input handler is registered, will return `None` :param io_type_tag: The type tag under which the type was registered in the system with `register_custom_xr_input_type()`. :type io_type_tag: str :returns: Either a class object that supports the protocol of an input handler or `None` if no handler was found. :rtype: type[SupportsFromXrConversion] .. py:function:: setup_defaults() Helper function to register all default shnitsel data types with the xr io compatibility registry.