emodpy.analyzers.timeseries_analyzer module

class emodpy.analyzers.timeseries_analyzer.TimeseriesAnalyzer(filenames=['output/InsetChart.json'], channels=('Statistical Population', 'Infectious Population', 'Infected', 'Waning Population'), save_output=True)

Bases: idmtools.entities.ianalyzer.IAnalyzer

data_group_names = ['group', 'sim_id', 'channel']
ordered_levels = ['channel', 'group', 'sim_id']
output_file = 'timeseries.csv'
initialize()

Call once after the analyzer has been added to the AnalyzeManager.

Add everything depending on the working directory or unique ID here instead of in __init__.

default_select_fn(ts)
default_group_fn(k, v)
default_plot_fn(df, ax)
default_filter_fn(md)
filter(simulation)

Decide whether the analyzer should process a simulation/work item.

Parameters

item – An IItem to be considered for processing with this analyzer.

Returns

A Boolean indicating whether simulation/work item should be analyzed by this analyzer.

get_channel_data(data_by_channel, selected_channels)
map(data, simulation)

In parallel for each simulation/work item, consume raw data from filenames and emit selected data.

Parameters
  • data – A dictionary associating filename with content for simulation data.

  • itemIItem object that the passed data is associated with.

Returns

Selected data for the given simulation/work item.

plot_by_channel(channels, plot_fn)
reduce(all_data)

Combine the map() data for a set of items into an aggregate result.

Parameters

all_data – A dictionary with entries for the item ID and selected data.