DataHandler

Defines a general data loader class that we can use for AtomData and any other data classes we might find useful.

 

__init__(self, data_name, data_key=None, source_key=None, data_dir=None, data_pkg=None, alternate_keys=None, getter=None, record_type=None): 
  • data_name: str

    the name of the dataset

  • data_key: str | None

    the key in the loaded dictionary to use for the actual data ("data" by default)

  • source_key: str | None

    the key in the loaded dictionary for the original data source ("source" by default)

  • data_dir: str | None

    the main directory data will be loaded from (. by default)

  • data_pkg: str | None

    the python package to load (TheRealMcCoy by default)

  • alternate_keys: Iterable[str] | None

    alternate keys that can be used to index into the dataset which can will be populated at runtime

  • getter: callable | None

    a function to use to resolve a key

  • record_type: type | None

    the class to use for holding data (DataRecord by default)

 

@property
data_file(self): 

 

load(self, env=None): 

Actually loads the data from data_file. Currently set up to just use an import statement but should be reimplemented to use a Deserializer from Scaffolding.Serializers

  • :returns: _

 

@property
data(self): 

 

@property
source(self): 

 

__getitem__(self, key): 

 

__len__(self): 

 

__iter__(self): 

 

__getstate__(self): 

 

__setstate__(self, state): 

 

__repr__(self): 

Feedback

Examples

Templates

Documentation