Skip to content

epymorph.tools.data

Tools for processing epymorph data.

RumeT module-attribute

RumeT = TypeVar('RumeT', bound=RUME)

Output

Bases: Protocol

A generic output interface.

rume instance-attribute

rume: RUME

The RUME used in the simulation that generated this output.

dataframe abstractmethod property

dataframe: DataFrame

The simulation results as a DataFrame.

munge

Applies all select/group/aggregate operations to an output dataframe. Returns a dataframe with columns "time", "geo", and a column per selected quantity. The values in "time" and "geo" come from the chosen aggregation for those axes. Without any group or aggregation specified, "time" is the simulation ticks and "geo" is node IDs.

memoize_rume

memoize_rume(
    path: str | Path, rume: RumeT, *, refresh: bool = False
) -> RumeT

Stores/loads a RUME's ADRIO data using a local file.

This is intended as a utility for working with RUMEs that use data from ADRIOs. For example, working interactively in a Notebook you may have to reload the Notebook many times, which could take seconds or minutes each time just to fetch data. It's convenient to avoid that delay so that's where this function comes in. This is not a full serialization of the RUME, so if you change the RUME config you should not re-use the cache file; passing refresh=True is an easy way to make this function ignore any previously stored file.