pykanto.utils.types
pykanto.utils.types#
Pykanto typing module: provides a) custom type hints not already covered in other modules and b) classes whose main purpose is data storage and/or type checking.
Functions
|
File exists validator for attr.s decorator. |
|
Validator for attr.s decorator. |
|
Validator for attr.s decorator. |
Classes
|
Combines segment annotations and audio metadata. |
|
Inherit to silence attr related errors in Pyrigh |
|
Type-checks and stores audio metadata. |
|
Stores information about a chunked iterable. |
alias of |
|
|
Type-checks and stores metadata for ONE audio segment (e.g. |
|
Type-checks and stores annotations necessary to segment regions of interest present in an audio file (e.g. |
|
Type check user input before instantiating main ProjDirs class. |
- pykanto.utils.types.f_exists(instance, attribute, f: pathlib.Path)[source]#
File exists validator for attr.s decorator.
- class pykanto.utils.types.AttrProto(*args, **kwargs)[source]#
Inherit to silence attr related errors in Pyrigh
- __init__(*args, **kwargs)#
- class pykanto.utils.types.ValidDirs(PROJECT: Path, RAW_DATA: Path, DATASET_ID: str)[source]#
Type check user input before instantiating main ProjDirs class.
- PROJECT: pathlib.Path#
- RAW_DATA: pathlib.Path#
- DATASET_ID: str#
- __init__(PROJECT: Path, RAW_DATA: Path, DATASET_ID: str) None #
- class pykanto.utils.types.SegmentAnnotation(ID: str, start_times: List[int], durations: List[int], end_times: List[int], lower_freq: List[int], upper_freq: List[int], label: List[str], annotation_file: Path)[source]#
Type-checks and stores annotations necessary to segment regions of interest present in an audio file (e.g. songs or song bouts).
- ID: str#
- start_times: List[int]#
- durations: List[int]#
- end_times: List[int]#
- lower_freq: List[int]#
- upper_freq: List[int]#
- label: List[str]#
- annotation_file: pathlib.Path#
- __init__(ID: str, start_times: List[int], durations: List[int], end_times: List[int], lower_freq: List[int], upper_freq: List[int], label: List[str], annotation_file: Path) None #
- class pykanto.utils.types.AudioAnnotation(sample_rate: int, bit_rate: int, length_s: float, source_wav: Path)[source]#
Type-checks and stores audio metadata.
- sample_rate: int#
- bit_rate: int#
- length_s: float#
- source_wav: pathlib.Path#
- __init__(sample_rate: int, bit_rate: int, length_s: float, source_wav: Path) None #
- class pykanto.utils.types.Annotation(ID: str, start_times: List[int], durations: List[int], end_times: List[int], lower_freq: List[int], upper_freq: List[int], label: List[str], annotation_file: Path, sample_rate: int, bit_rate: int, length_s: float, source_wav: Path)[source]#
Combines segment annotations and audio metadata.
- __init__(ID: str, start_times: List[int], durations: List[int], end_times: List[int], lower_freq: List[int], upper_freq: List[int], label: List[str], annotation_file: Path, sample_rate: int, bit_rate: int, length_s: float, source_wav: Path) None #
- ID: str#
- start_times: List[int]#
- durations: List[int]#
- end_times: List[int]#
- lower_freq: List[int]#
- upper_freq: List[int]#
- label: List[str]#
- annotation_file: pathlib.Path#
- class pykanto.utils.types.Metadata(sample_rate: int, bit_rate: int, length_s: float, ID: str, label: str, start: int, end: int, lower_freq: int, upper_freq: int, max_amplitude: float, min_amplitude: float, source_wav: str, annotation_file: str, wav_file: str)[source]#
Type-checks and stores metadata for ONE audio segment (e.g. a song or song bout). Type checks ensure that instances of this class are JSON-serializable as a dictionary.
- ID: str#
- label: str#
- start: int#
- end: int#
- lower_freq: int#
- upper_freq: int#
- max_amplitude: float#
- min_amplitude: float#
- source_wav: str#
- annotation_file: str#
- wav_file: str#
- __init__(sample_rate: int, bit_rate: int, length_s: float, ID: str, label: str, start: int, end: int, lower_freq: int, upper_freq: int, max_amplitude: float, min_amplitude: float, source_wav: str, annotation_file: str, wav_file: str) None #
- pykanto.utils.types.Chunkinfo_#
alias of
pykanto.utils.types.Chunkinfo