smartgrid.agents.data_conversion.DataConversion

class smartgrid.agents.data_conversion.DataConversion[source]

Bases: ABC

Convert raw data into usable AgentProfiles.

To improve re-usability and because they may contain important amounts of data (e.g., quantity of energy needed for each step), profiles are usually stored as data files, using some specific format. DataConversion classes are responsible for translating such data files and loading them into tangible (instantiated) profiles.

New DataConversion classes can be created to handle different file formats and structures, so that the simulator itself is agnostic to the data source.

__init__()[source]

Methods

__init__()

load(name, data_path, **kwargs)

Load a profile from a data file for further use.

Attributes

profiles

Profiles already loaded by the DataConversion, to speed up next calls.

abstract load(name: str, data_path: str, **kwargs) AgentProfile[source]

Load a profile from a data file for further use.

Parameters:
  • name – The desired profile name. This can be seen as the profile’s ID, as the name must be used to later retrieve the profile from the profiles dict.

  • data_path – The path to the data file from which the profile should be loaded. This path must exist and be readable.

  • kwargs – Additional arguments. These arguments can serve any purpose, depending on the implementation details of the DataConversion itself.

Returns:

The loaded AgentProfile for direct use.

profiles: Dict[str, AgentProfile]

Profiles already loaded by the DataConversion, to speed up next calls.