crt1d.utils#

Some utility functions, mostly for internal use.

Module Contents#

Functions#

add_snippets(func, snippets)

Decorator that dedents docstrings with inspect.getdoc and adds

cf_units_to_tex(s)

Convert CF-style units string to TeX-like.

crt1d.utils.add_snippets(func, snippets)#

Decorator that dedents docstrings with inspect.getdoc and adds un-indented snippets from the global snippets dictionary. This function uses %(name)s substitution rather than str.format substitution so that the snippets keys can be invalid variable names.

crt1d.utils.cf_units_to_tex(s: str)#

Convert CF-style units string to TeX-like. (In order to get exponents in plot labels, etc.)