emodpy.emod_campaign module#
- class emodpy.emod_campaign.EMODCampaign(name='Campaign', events=None, use_defaults=True, **kwargs)[source]#
Bases:
object
Class representing an EMOD Campaign. It contains: - events: a list of events for the given campaign - name: campaign name - use_defaults: EMOD flag to use defaults for unspecified parameters - extra_parameters: parameters set by the user that will be added to the campaign JSON
- property json#
Property to transform the object in JSON
- static load_from_file(filename: str) object [source]#
Load a campaign from a JSON file.
- Parameters:
filename – Path to the campaign file
Returns: an initialized EMODCampaign instance
- static load_from_dict(data: Dict) object [source]#
Create a campaign object from a dict. :param data: The dictionary containing the data
Returns: an initialized EMODCampaign instance
- get_events_at(timestep: int) List[Dict] [source]#
Get a list of events happening at the specified timestep. Does not take into account recurrence and only consider start timestep. :param timestep: selected timestep
Returns: list of events
- get_events_with_name(name: str) List[Dict] [source]#
Get a list of events with the given name. This search is based on the Event_Name key of events. :param name: Name of the events
Returns: list of events