Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Several features/fixes for version 5.1 (#280)
* CLN: Fix line break in formats/seq/simple.py * Import format classes at package level, fix #273 * Have SimpleSeq only map column names in `column_map`, fix #272 Inside `SimpleSeq.from_file`, when someone specifies a `column_map` argument, we only do the mapping if a column name in the loaded csv file is a key in `column_map`. Otherwise we leave the column as-is, and if it's not one of the columns we need for the annotations ("onset_s", "offset_s", "label"), it gets thrown away. * Make SimpleSeq work with csv that doesn't have labels, fix #271 Adds `default_label` argument to `from_file` method, a string that defaults to `'-'` and if the `pandas.DataFrame` loaded from the csv file does not already have a 'label' column, adds that column with the `default_label` value as the label in every row. This makes it possible to load segmentations saved in csv files that do not have labels, just start and stop times of the segments. * Add validation logic for `columns_map` to SimpleSeq * Fix SimpleSeq to handle empty csv file, fixes #264 * Fixup add validation of columns_map to SimpleSeq.from_file * Add fixture `jourjine_et_al_2023_csv_path` to fixtures/simple.py * Write unit tests for new features added to SimpleSeq * Fixup import format classes at package level * Rewrite crowsetta.data as crowsetta.examples, fix #278 As described in issue, and also: Add example data files to dir Remove crowsetta.data Rewrite tests/test_data.py as tests/test_example.py * Add csv from Jourjine et al 2023 dataset in tests + examples, fix #274 * Add helpful error message in SimpleSeq.from_file for when columns don't have expected names. * Fix examples in docstrings of format classes after changing data -> example * Apply linting * Squelch flake8 line-length warnings for examples * Add how-to on how to work with unlabeled segmentations * Use crowsetta.example not crowsetta.data in doc/index.md * Use crowsetta.example not crowsetta.data in doc/api/core.md * Fixup empty SimpleSeq unit test * Add __len__ to Sequence, fix #276 * Fix unit test for empty SimpleSeq to just use pytest tempdir, not tempfile * Add unit tests for Sequence.__len__ * Add assert in unit test for empty SimpleSeq that we can call to_seq and get a Sequence of length 0 * Fixup usage of in index.md -- fix example names * Put all of API onto one page in docs, fix how we show crowsetta.examples.show and crowsetta.example
- Loading branch information