pyrolite.util.meta
- pyrolite.util.meta.get_module_datafolder(module='pyrolite', subfolder=None)[source]
Returns the path of a module data folder.
- Parameters
subfolder (
str
) – Subfolder within the module data folder.- Return type
- pyrolite.util.meta.pyrolite_datafolder(subfolder=None)[source]
Returns the path of the pyrolite data folder.
- Parameters
subfolder (
str
) – Subfolder within the pyrolite data folder.- Return type
- pyrolite.util.meta.sphinx_doi_link(doi)[source]
Generate a string with a restructured text link to a given DOI.
- pyrolite.util.meta.subkwargs(kwargs, *f)[source]
Get a subset of keyword arguments which are accepted by a function.
- pyrolite.util.meta.inargs(name, *funcs)[source]
Check if an argument is a possible input for a specific function.
- pyrolite.util.meta.numpydoc_str_param_list(iterable, indent=4)[source]
Format a list of numpydoc parameters.
- pyrolite.util.meta.get_additional_params(*fs, t='Parameters', header='', indent=4, subsections=False, subsection_delim='Note')[source]
Checks the base Parameters section of docstrings to get ‘Other Parameters’ for a specific function. Designed to incorporate information on inherited or forwarded parameters.
- Parameters
fs (
list
) – List of functions.t (
str
) – Target block of docstrings.header (
str
) – Optional seciton header.indent (
int
|str
) – Indent as number of spaces, or a string of a given length.subsections (
bool
, False) – Whether to include headers specific for each function, creating subsections.subsection_delim (
str
) – Subsection delimiter.- Return type
Todo
Add delimiters between functions to show where arguments should be passed.
- pyrolite.util.meta.update_docstring_references(obj, ref='ref')[source]
Updates docstring reference names to strings including the function name. Decorator will return the same function with a modified docstring. Sphinx likes unique names - specifically for citations, not so much for footnotes.
- Parameters
obj (
func
|class
) – Class or function for which to update documentation references.ref (
str
) – String to replace with the object name.- Returns
Object with modified docstring.
- Return type
func
|class