shnitsel.io.format_registry#

Attributes#

Functions#

register_format_reader(format_identifier, reader_instance)

Function to register a new input format implementation with the io registry.

get_available_io_handlers()

Function to access the list of available input reader classes.

Module Contents#

_newton_reader#
REGISTERED_READERS: dict[str, shnitsel.io.format_reader_base.FormatReader]#
type FormatIdentifierType = Literal['nx', 'newtonx', 'sharc', 'pyrai2md', 'shnitsel'] | str#
register_format_reader(format_identifier, reader_instance)#

Function to register a new input format implementation with the io registry.

Parameters:
  • format_identifier (str) – The string with which the format should be identified. E.g. ‘newtonx’ or ‘sharc’. Must not already be in use. Identifiers already in use: ‘nx’, ‘newtonx’, ‘sharc’, ‘pyrai2md’, ‘shnitsel’

  • reader_instance (FormatReader) – An instance of an object of a format-specific subclass of FormatReader to handle io requests.

Returns:

Returns True if registration was successful. False if there was a clash with an existing format declaration.

Return type:

bool

get_available_io_handlers()#

Function to access the list of available input reader classes.

Returns:

The mapping from format identifier to actual io handler for the various supported formats.

Return type:

Mapping[str, FormatReader]