reno.utils#

Utility functions that are potentially needed in multiple modules.

Functions

check_for_easy_static_time_eq(eq)

Determine whether an equation is t - STATIC_EQ.

dependency_compute_order(refs[, init_eqs, debug])

Find a dependency-safe ordering for reference equations by iterating through and each time adding the first reference that doesn't depend on any references not yet added.

ensure_scalar(operand)

Convert int/float types into a Scalar type if relevant, otherwise directly return what was passed.

find_ref_root_model(ref)

Find the top most parent model in the submodel tree.

get_dependency_relevant_equation_part(...)

Determine what equation part should be used to run seek_refs on in order to determine compute dependencies.

is_free_var(eq)

A reference is a "free reference/free variable" if its equation has no references to _other_ references.

is_ref_in_parent_scope(ref, source)

Check if a reference is in the scope _above_ some source reference.

is_static(eq[, checked])

An equation is "static" if it only contains values that won't change, e.g. scalars, distributions, or other static variables.

latex_eqline_wrap(eq_text[, highlight])

Wrap an equation in an appropriate latex block for an equation set display.

latex_eqline_wrap_doc(doc_text[, highlight])

Wrap a docstring in an appropriate latex block for an equation set display.

latex_name(name[, cmd])

Wrap a reference name in a latex string, correctly escaping anything as necessary.

range_eq_latex(min_eq, max_eq, **kwargs)

Get the latex string for displaying the combined min/max range of a reference.

ref_universe(refs[, depth])

Fancier recursive seek_refs, useful for collecting the full set of references to and from any in the given set of passed refs.

resource_path(filename)

Get the path to the package "data resource" with matching filename.