class_lookup

Helpers used to find what type of format needs to be used to write to/read from the file.

CSVFormats

Bases: CustomFormatEnum

flowchart LR tm_data_types.helpers.class_lookup.CSVFormats[CSVFormats] tm_data_types.helpers.class_lookup.CustomFormatEnum[CustomFormatEnum] tm_data_types.helpers.class_lookup.CustomFormatEnum --> tm_data_types.helpers.class_lookup.CSVFormats click tm_data_types.helpers.class_lookup.CSVFormats href "" "tm_data_types.helpers.class_lookup.CSVFormats" click tm_data_types.helpers.class_lookup.CustomFormatEnum href "" "tm_data_types.helpers.class_lookup.CustomFormatEnum"

The different formats that a csv file can exist in.

list_values classmethod

list_values() -> List[AbstractedFile]

Return a list of all the values of the enum.

CustomFormatEnum

Bases: Enum

flowchart LR tm_data_types.helpers.class_lookup.CustomFormatEnum[CustomFormatEnum] click tm_data_types.helpers.class_lookup.CustomFormatEnum href "" "tm_data_types.helpers.class_lookup.CustomFormatEnum"

A custom base class for string Enums.

This class provides better type hinting for the value property.

list_values classmethod

list_values() -> List[AbstractedFile]

Return a list of all the values of the enum.

FileExtensions

Bases: CustomStrEnum

flowchart LR tm_data_types.helpers.class_lookup.FileExtensions[FileExtensions] tm_data_types.helpers.enums.CustomStrEnum[CustomStrEnum] tm_data_types.helpers.enums.CustomStrEnum --> tm_data_types.helpers.class_lookup.FileExtensions click tm_data_types.helpers.class_lookup.FileExtensions href "" "tm_data_types.helpers.class_lookup.FileExtensions" click tm_data_types.helpers.enums.CustomStrEnum href "" "tm_data_types.helpers.enums.CustomStrEnum"

The different file extensions that can be read from/written to.

name property

name: str

Return the name of the Enum member.

value property

value: str

Return the value of the Enum member.

list_values classmethod

list_values() -> List[str]

Return a list of all the values of the enum.

MATFormats

Bases: CustomFormatEnum

flowchart LR tm_data_types.helpers.class_lookup.MATFormats[MATFormats] tm_data_types.helpers.class_lookup.CustomFormatEnum[CustomFormatEnum] tm_data_types.helpers.class_lookup.CustomFormatEnum --> tm_data_types.helpers.class_lookup.MATFormats click tm_data_types.helpers.class_lookup.MATFormats href "" "tm_data_types.helpers.class_lookup.MATFormats" click tm_data_types.helpers.class_lookup.CustomFormatEnum href "" "tm_data_types.helpers.class_lookup.CustomFormatEnum"

The different formats that a mat file can exist in.

list_values classmethod

list_values() -> List[AbstractedFile]

Return a list of all the values of the enum.

WFMFormats

Bases: CustomFormatEnum

flowchart LR tm_data_types.helpers.class_lookup.WFMFormats[WFMFormats] tm_data_types.helpers.class_lookup.CustomFormatEnum[CustomFormatEnum] tm_data_types.helpers.class_lookup.CustomFormatEnum --> tm_data_types.helpers.class_lookup.WFMFormats click tm_data_types.helpers.class_lookup.WFMFormats href "" "tm_data_types.helpers.class_lookup.WFMFormats" click tm_data_types.helpers.class_lookup.CustomFormatEnum href "" "tm_data_types.helpers.class_lookup.CustomFormatEnum"

The different formats that a wfm file can exist in.

list_values classmethod

list_values() -> List[AbstractedFile]

Return a list of all the values of the enum.

access_type

access_type(extension: FileExtensions, write: bool) -> str

How the file should be accessed.

Parameters:
  • extension (FileExtensions) –

    The extensions of the file that is being written to/read from.

  • write (bool) –

    Whether the file is being written to or not.

find_class_format

find_class_format(extension: FileExtensions, waveform_type: Type[Datum]) -> AbstractedFile

Find the file and class format based on what waveform was provided.

Parameters:
  • extension (FileExtensions) –

    The extensions of the file that is being written to.

  • waveform_type (Type[Datum]) –

    The waveform type that is being written.

find_class_format_list

find_class_format_list(extension: FileExtensions) -> List[AbstractedFile]

Find what possible file formats can be used based on the extension or waveform.

Parameters:
  • extension (FileExtensions) –

    The extensions of the file that is being read from.

handle_extensions

handle_extensions(extension: FileExtensions) -> CustomFormatEnum

Handle the extensions based on what the file path is.

Parameters:
  • extension (FileExtensions) –

    The extensions of the file that is being written to.