LegacyElementsReader

class LegacyElementsReader(settings: Optional[dict] = None)

Bases: TCossaLabABFReader

Subclass of MetaReader for reading ABF2 files

Public Methods

(none)

Private Methods

LegacyElementsReader._get_configs(datafiles)

Load configuration files as dictionaries, corresponding to datamaps as needed. Default behavior assumes there are no config files needed.

Parameters:

datafiles (List[os.PathLike]) – List of data file paths.

Returns:

List of configuration dictionaries.

Return type:

List[dict]

Raises:
  • NotImplementedError – If the file type is not ABF2 specifically

  • TypeError – If one of the channels does not have an “I” in its header label

  • ValueError – If any number of channels other than 2 is found in the data file

LegacyElementsReader._get_file_channel_stamps(file_names, configs)

Get a list of serialization keys used to sort the list of files associated to the experiment.

Parameters:
  • file_names (List[os.PathLike]) – List of file paths.

  • configs (List[dict]) – List of configuration dictionaries.

Returns:

List of channel numbers parsed from configuration.

Return type:

List[int]

Raises:

ValueError – If the filename does not match the expected pattern

LegacyElementsReader._get_file_pattern(file_name)

Get the base name for matching other files to the same dataset as the initial one provided to the constructor.

Parameters:

file_name (os.PathLike) – File path.

Returns:

Base name for matching other files.

Return type:

str

Raises:

ValueError – If the base naming pattern cannot be ascertained.

LegacyElementsReader._get_file_time_stamps(file_names, configs)

Get a list of serialization keys used to sort the list of files associated to the experiment.

Parameters:
  • file_names (List[os.PathLike]) – List of file paths.

  • configs (List[dict]) – List of configuration dictionaries.

Returns:

List of timestamps parsed from configuration.

Return type:

List[datetime]

Raises:

ValueError – If the filename does not match the expected pattern