iodata.docstrings module

Docstring decorators for file format implementations.

document_dump_many(fmt, required, optional=None, kwdocs=None, notes=None)[source]

Decorate a dump_many function to generate a docstring.

Parameters:
  • fmt (str) – The name of the file format.

  • required (list[str]) – A list of mandatory IOData attributes needed to write the file.

  • optional (Optional[list[str]]) – A list of optional IOData attributes which can be include when writing the file.

  • kwdocs (Optional[dict[str, str]]) – A dictionary with documentation for keyword arguments. Each key is a keyword argument name and the corresponding value is text explaining the argument.

  • notes (Optional[str]) – Additional information to be added to the docstring.

Return type:

Callable

Returns:

A decorator function.

document_dump_one(fmt, required, optional=None, kwdocs=None, notes=None)[source]

Decorate a dump_one function to generate a docstring.

Parameters:
  • fmt (str) – The name of the file format.

  • required (list[str]) – A list of mandatory IOData attributes needed to write the file.

  • optional (Optional[list[str]]) – A list of optional IOData attributes which can be include when writing the file.

  • kwdocs (Optional[dict[str, str]]) – A dictionary with documentation for keyword arguments. Each key is a keyword argument name and the corresponding value is text explaining the argument.

  • notes (Optional[str]) – Additional information to be added to the docstring.

Return type:

Callable

Returns:

A decorator function.

document_load_many(fmt, guaranteed, ifpresent=None, kwdocs=None, notes=None)[source]

Decorate a load_many function to generate a docstring.

Parameters:
  • fmt (str) – The name of the file format.

  • guaranteed (list[str]) – A list of IOData attributes this format can certainly read.

  • ifpresent (Optional[list[str]]) – A list of IOData attributes this format reads of present in the file.

  • kwdocs (Optional[dict[str, str]]) – A dictionary with documentation for keyword arguments. Each key is a keyword argument name and the corresponding value is text explaining the argument.

  • notes (Optional[str]) – Additional information to be added to the docstring.

Return type:

Callable

Returns:

A decorator function.

document_load_one(fmt, guaranteed, ifpresent=None, kwdocs=None, notes=None)[source]

Decorate a load_one function to generate a docstring.

Parameters:
  • fmt (str) – The name of the file format.

  • guaranteed (list[str]) – A list of IOData attributes this format can certainly read.

  • ifpresent (Optional[list[str]]) – A list of IOData attributes this format reads of present in the file.

  • kwdocs (Optional[dict[str, str]]) – A dictionary with documentation for keyword arguments. Each key is a keyword argument name and the corresponding value is text explaining the argument.

  • notes (Optional[str]) – Additional information to be added to the docstring.

Return type:

Callable

Returns:

A decorator function.

document_write_input(fmt, required, optional=None, notes=None)[source]

Decorate a write_input function to generate a docstring.

Parameters:
  • fmt (str) – The name of the file format.

  • required (list[str]) – A list of mandatory IOData attributes needed to write the file.

  • optional (Optional[list[str]]) – A list of optional IOData attributes which can be include when writing the file.

  • notes (Optional[str]) – Additional information to be added to the docstring.

Return type:

Callable

Returns:

A decorator function.