add_data_from_dir

MPPData.add_data_from_dir(data_dir, keys=(), optional_keys=(), subset=False, **kwargs)[source]

Add data to MPPData from data_dir.

Expects x, y, and obj_ids to be present in data_dir. Assumes that the data in data_dir uses the same data_config as the present object.

Parameters
  • data_dir (str) – Full path to the dir containing the numpy files to be loaded.

  • keys (Iterable[str]) – Filenames of data that should be loaded

  • optional_keys (Iterable[str]) – Filenames of data that could optionally be loaded if present

  • subset (bool) – If True, subset MPPData to data present in data_dir.

  • kwargs (Any) – Passed to MPPData.from_data_dir(), i.e., seed.

Return type

Nothing, modifies MPPData in place. Adds keys to MPPData.data().

Raises

ValueError – If subset is False, and data in data_dir differs from data in self.