crt1d.utils =========== .. py:module:: crt1d.utils .. autoapi-nested-parse:: Some utility functions, mostly for internal use. Functions --------- .. autoapisummary:: crt1d.utils.add_snippets crt1d.utils.cf_units_to_tex Module Contents --------------- .. py:function:: 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. .. py:function:: cf_units_to_tex(s: str) Convert CF-style units string to TeX-like. (In order to get exponents in plot labels, etc.)