audformat 1.1.3__tar.gz → 1.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {audformat-1.1.3 → audformat-1.2.0}/.github/workflows/publish.yml +1 -1
- {audformat-1.1.3 → audformat-1.2.0}/.github/workflows/test.yml +13 -2
- {audformat-1.1.3 → audformat-1.2.0}/CHANGELOG.rst +37 -0
- {audformat-1.1.3 → audformat-1.2.0}/PKG-INFO +5 -5
- {audformat-1.1.3 → audformat-1.2.0}/README.rst +1 -1
- {audformat-1.1.3 → audformat-1.2.0}/audformat/core/column.py +1 -1
- {audformat-1.1.3 → audformat-1.2.0}/audformat/core/common.py +15 -2
- {audformat-1.1.3 → audformat-1.2.0}/audformat/core/database.py +8 -6
- {audformat-1.1.3 → audformat-1.2.0}/audformat/core/define.py +3 -0
- {audformat-1.1.3 → audformat-1.2.0}/audformat/core/table.py +447 -91
- {audformat-1.1.3 → audformat-1.2.0}/audformat/core/utils.py +84 -24
- {audformat-1.1.3 → audformat-1.2.0}/audformat.egg-info/PKG-INFO +5 -5
- {audformat-1.1.3 → audformat-1.2.0}/audformat.egg-info/requires.txt +2 -1
- {audformat-1.1.3 → audformat-1.2.0}/docs/data-format.rst +16 -12
- {audformat-1.1.3 → audformat-1.2.0}/docs/data-introduction.rst +1 -1
- {audformat-1.1.3 → audformat-1.2.0}/pyproject.toml +4 -3
- {audformat-1.1.3 → audformat-1.2.0}/tests/test_column.py +186 -2
- {audformat-1.1.3 → audformat-1.2.0}/tests/test_database.py +24 -5
- {audformat-1.1.3 → audformat-1.2.0}/tests/test_database_get.py +80 -10
- {audformat-1.1.3 → audformat-1.2.0}/tests/test_misc_table.py +204 -13
- {audformat-1.1.3 → audformat-1.2.0}/tests/test_scheme.py +6 -6
- {audformat-1.1.3 → audformat-1.2.0}/tests/test_table.py +365 -15
- {audformat-1.1.3 → audformat-1.2.0}/tests/test_utils.py +78 -2
- {audformat-1.1.3 → audformat-1.2.0}/tests/test_utils_concat.py +5 -5
- {audformat-1.1.3 → audformat-1.2.0}/.github/workflows/doc.yml +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/.github/workflows/linter.yml +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/.gitignore +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/.pre-commit-config.yaml +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/CONTRIBUTING.rst +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/LICENSE +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/audformat/__init__.py +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/audformat/core/__init__.py +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/audformat/core/attachment.py +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/audformat/core/conftest.py +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/audformat/core/errors.py +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/audformat/core/index.py +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/audformat/core/media.py +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/audformat/core/rater.py +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/audformat/core/scheme.py +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/audformat/core/split.py +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/audformat/core/testing.py +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/audformat/core/typing.py +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/audformat/define/__init__.py +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/audformat/errors/__init__.py +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/audformat/testing/__init__.py +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/audformat/utils/__init__.py +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/audformat.egg-info/SOURCES.txt +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/audformat.egg-info/dependency_links.txt +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/audformat.egg-info/top_level.txt +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/benchmarks/benchmark_union.py +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/accessing-data.rst +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/api/audformat.define.rst +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/api/audformat.errors.rst +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/api/audformat.rst +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/api/audformat.testing.rst +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/api/audformat.utils.rst +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/api-src/audformat.define.rst +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/api-src/audformat.errors.rst +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/api-src/audformat.rst +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/api-src/audformat.testing.rst +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/api-src/audformat.utils.rst +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/changelog.rst +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/combine-tables.rst +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/conf.py +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/contributing.rst +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/create-database.rst +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/data-conventions.rst +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/data-example.rst +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/data-header.rst +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/data-misc-tables.rst +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/data-tables.rst +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/emodb-example.rst +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/genindex.rst +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/index.rst +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/install.rst +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/map-scheme.rst +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/pics/audformat-database.dot +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/pics/audformat-misc-table.dot +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/pics/audformat-table.dot +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/requirements.txt +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/docs/update-database.rst +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/requirements.txt +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/setup.cfg +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/tests/conftest.py +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/tests/requirements.txt +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/tests/test_attachment.py +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/tests/test_common.py +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/tests/test_eq.py +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/tests/test_errors.py +0 -0
- {audformat-1.1.3 → audformat-1.2.0}/tests/test_index.py +0 -0
|
@@ -59,7 +59,7 @@ jobs:
|
|
|
59
59
|
python -m sphinx docs/ docs/_build/ -b html
|
|
60
60
|
|
|
61
61
|
- name: Deploy documentation to Github pages
|
|
62
|
-
uses: peaceiris/actions-gh-pages@
|
|
62
|
+
uses: peaceiris/actions-gh-pages@v4
|
|
63
63
|
with:
|
|
64
64
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
65
65
|
publish_dir: ./docs/_build
|
|
@@ -15,12 +15,13 @@ jobs:
|
|
|
15
15
|
os: [ ubuntu-20.04, windows-latest, macOS-latest ]
|
|
16
16
|
python-version: [ '3.10' ]
|
|
17
17
|
include:
|
|
18
|
-
- os: ubuntu-latest
|
|
19
|
-
python-version: '3.8'
|
|
20
18
|
- os: ubuntu-latest
|
|
21
19
|
python-version: '3.9'
|
|
22
20
|
- os: ubuntu-latest
|
|
23
21
|
python-version: '3.11'
|
|
22
|
+
- os: ubuntu-latest
|
|
23
|
+
python-version: '3.9'
|
|
24
|
+
requirements: 'minimum'
|
|
24
25
|
|
|
25
26
|
steps:
|
|
26
27
|
- uses: actions/checkout@v4
|
|
@@ -50,6 +51,16 @@ jobs:
|
|
|
50
51
|
pip install -r requirements.txt
|
|
51
52
|
pip install -r tests/requirements.txt
|
|
52
53
|
|
|
54
|
+
- name: Downgrade to minimum dependencies
|
|
55
|
+
run: |
|
|
56
|
+
pip install "audeer==2.0.0"
|
|
57
|
+
pip install "audiofile==0.4.0"
|
|
58
|
+
pip install "numpy<2.0.0"
|
|
59
|
+
pip install "pandas==2.1.0"
|
|
60
|
+
pip install "pyarrow==10.0.1"
|
|
61
|
+
pip install "pyyaml==5.4.1"
|
|
62
|
+
if: matrix.requirements == 'minimum'
|
|
63
|
+
|
|
53
64
|
- name: Test with pytest
|
|
54
65
|
run: |
|
|
55
66
|
python -m pytest
|
|
@@ -7,6 +7,43 @@ The format is based on `Keep a Changelog`_,
|
|
|
7
7
|
and this project adheres to `Semantic Versioning`_.
|
|
8
8
|
|
|
9
9
|
|
|
10
|
+
Version 1.2.0 (2024-06-25)
|
|
11
|
+
--------------------------
|
|
12
|
+
|
|
13
|
+
* Added: expand format specifications
|
|
14
|
+
to allow parquet files
|
|
15
|
+
as table files
|
|
16
|
+
* Added: support for storing tables as parquet files
|
|
17
|
+
by adding ``"parquet"``
|
|
18
|
+
(``audformat.define.TableStorageFormat.PARQUET``)
|
|
19
|
+
as an option
|
|
20
|
+
for the ``storage_format`` argument
|
|
21
|
+
of ``audformat.Table.save()``
|
|
22
|
+
and ``audformat.Database.save()``
|
|
23
|
+
* Added: support for ``numpy>=2.0``
|
|
24
|
+
* Added: mention text files
|
|
25
|
+
as potential media files
|
|
26
|
+
in the documentation
|
|
27
|
+
* Added: mention in the documentation of ``audformat.utils.hash()``
|
|
28
|
+
that column/level names do not influence its hash value
|
|
29
|
+
* Added: warn in the documentation of ``audformat.utils.hash()``
|
|
30
|
+
that the hash of a dataframe or series,
|
|
31
|
+
containing ``"Int64"`` as data type,
|
|
32
|
+
changes with ``pandas>=2.2.0``
|
|
33
|
+
* Fixed: ensure ``"boolean"`` data type
|
|
34
|
+
is always used
|
|
35
|
+
in indices of misc tables
|
|
36
|
+
that store boolean values
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
Version 1.1.4 (2024-05-15)
|
|
40
|
+
--------------------------
|
|
41
|
+
|
|
42
|
+
* Fixed: ``audformat.Database.get()``,
|
|
43
|
+
if its argument ``additional_schemes``
|
|
44
|
+
contains a non-existent scheme
|
|
45
|
+
|
|
46
|
+
|
|
10
47
|
Version 1.1.3 (2024-04-26)
|
|
11
48
|
--------------------------
|
|
12
49
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: audformat
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: Python implementation of audformat
|
|
5
5
|
Author: BahaEddine Abrougui
|
|
6
6
|
Author-email: Hagen Wierstorf <hwierstorf@audeering.com>, Johannes Wagner <jwagner@audeering.com>
|
|
@@ -41,12 +41,11 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
41
41
|
Classifier: Operating System :: OS Independent
|
|
42
42
|
Classifier: Programming Language :: Python
|
|
43
43
|
Classifier: Programming Language :: Python :: 3
|
|
44
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
45
44
|
Classifier: Programming Language :: Python :: 3.9
|
|
46
45
|
Classifier: Programming Language :: Python :: 3.10
|
|
47
46
|
Classifier: Programming Language :: Python :: 3.11
|
|
48
47
|
Classifier: Topic :: Scientific/Engineering
|
|
49
|
-
Requires-Python: >=3.
|
|
48
|
+
Requires-Python: >=3.9
|
|
50
49
|
Description-Content-Type: text/x-rst
|
|
51
50
|
License-File: LICENSE
|
|
52
51
|
Requires-Dist: audeer>=2.0.0
|
|
@@ -54,8 +53,9 @@ Requires-Dist: audiofile>=0.4.0
|
|
|
54
53
|
Requires-Dist: iso-639
|
|
55
54
|
Requires-Dist: iso3166
|
|
56
55
|
Requires-Dist: oyaml
|
|
56
|
+
Requires-Dist: pandas>=2.1.0
|
|
57
|
+
Requires-Dist: pyarrow>=10.0.1
|
|
57
58
|
Requires-Dist: pyyaml>=5.4.1
|
|
58
|
-
Requires-Dist: pandas>=1.4.1
|
|
59
59
|
|
|
60
60
|
=========
|
|
61
61
|
audformat
|
|
@@ -66,7 +66,7 @@ audformat
|
|
|
66
66
|
Specification and reference implementation of **audformat**.
|
|
67
67
|
|
|
68
68
|
audformat stores media data,
|
|
69
|
-
such as audio or
|
|
69
|
+
such as audio, video, or text
|
|
70
70
|
together with corresponding annotations
|
|
71
71
|
in a pre-defined way.
|
|
72
72
|
This makes it easy to combine or replace databases
|
|
@@ -7,7 +7,7 @@ audformat
|
|
|
7
7
|
Specification and reference implementation of **audformat**.
|
|
8
8
|
|
|
9
9
|
audformat stores media data,
|
|
10
|
-
such as audio or
|
|
10
|
+
such as audio, video, or text
|
|
11
11
|
together with corresponding annotations
|
|
12
12
|
in a pre-defined way.
|
|
13
13
|
This makes it easy to combine or replace databases
|
|
@@ -359,8 +359,21 @@ def to_audformat_dtype(dtype: typing.Union[str, typing.Type]) -> str:
|
|
|
359
359
|
return define.DataType.OBJECT
|
|
360
360
|
|
|
361
361
|
|
|
362
|
-
def to_pandas_dtype(dtype: str) -> str:
|
|
363
|
-
r"""Convert audformat to pandas dtype.
|
|
362
|
+
def to_pandas_dtype(dtype: str) -> typing.Optional[str]:
|
|
363
|
+
r"""Convert audformat to pandas dtype.
|
|
364
|
+
|
|
365
|
+
We use ``"Int64"`` instead of ``"int64"``,
|
|
366
|
+
and ``"boolean"`` instead of ``"bool"``
|
|
367
|
+
to allow for nullable entries,
|
|
368
|
+
e.g. ``[0, 2, <NA>]``.
|
|
369
|
+
|
|
370
|
+
Args:
|
|
371
|
+
dtype: audformat dtype
|
|
372
|
+
|
|
373
|
+
Returns:
|
|
374
|
+
pandas dtype
|
|
375
|
+
|
|
376
|
+
"""
|
|
364
377
|
if dtype == define.DataType.BOOL:
|
|
365
378
|
return "boolean"
|
|
366
379
|
elif dtype == define.DataType.DATE:
|
|
@@ -856,16 +856,18 @@ class Database(HeaderBase):
|
|
|
856
856
|
objs = [obj]
|
|
857
857
|
for scheme in additional_schemes:
|
|
858
858
|
if len(obj) == 0:
|
|
859
|
-
|
|
859
|
+
# Skip searching for additional schemes,
|
|
860
|
+
# if main scheme does return empty frame
|
|
861
|
+
additional_obj = empty_frame(scheme)
|
|
860
862
|
else:
|
|
861
|
-
|
|
863
|
+
additional_obj = self.get(
|
|
862
864
|
scheme,
|
|
863
865
|
strict=strict,
|
|
864
866
|
map=map,
|
|
865
867
|
original_column_names=original_column_names,
|
|
866
868
|
aggregate_function=aggregate_function,
|
|
867
869
|
)
|
|
868
|
-
objs.append(
|
|
870
|
+
objs.append(additional_obj)
|
|
869
871
|
if len(objs) > 1:
|
|
870
872
|
obj = utils.concat(objs)
|
|
871
873
|
obj = obj.loc[index]
|
|
@@ -977,7 +979,7 @@ class Database(HeaderBase):
|
|
|
977
979
|
r"""Save database to disk.
|
|
978
980
|
|
|
979
981
|
Creates a header ``<root>/<name>.yaml``
|
|
980
|
-
and for every table a file ``<root>/<name>.<table-id>.[csv,pkl]``.
|
|
982
|
+
and for every table a file ``<root>/<name>.<table-id>.[csv,parquet,pkl]``.
|
|
981
983
|
|
|
982
984
|
Existing files will be overwritten.
|
|
983
985
|
If ``update_other_formats`` is provided,
|
|
@@ -1381,7 +1383,7 @@ class Database(HeaderBase):
|
|
|
1381
1383
|
r"""Load database from disk.
|
|
1382
1384
|
|
|
1383
1385
|
Expects a header ``<root>/<name>.yaml``
|
|
1384
|
-
and for every table a file ``<root>/<name>.<table-id>.[csv|pkl]``
|
|
1386
|
+
and for every table a file ``<root>/<name>.<table-id>.[csv|parquet|pkl]``
|
|
1385
1387
|
Media files should be located under ``root``.
|
|
1386
1388
|
|
|
1387
1389
|
Args:
|
|
@@ -1407,7 +1409,7 @@ class Database(HeaderBase):
|
|
|
1407
1409
|
Raises:
|
|
1408
1410
|
FileNotFoundError: if the database header file cannot be found
|
|
1409
1411
|
under ``root``
|
|
1410
|
-
RuntimeError: if a CSV table file is newer
|
|
1412
|
+
RuntimeError: if a CSV or PARQUET table file is newer
|
|
1411
1413
|
than the corresponding PKL file
|
|
1412
1414
|
|
|
1413
1415
|
"""
|
|
@@ -337,6 +337,9 @@ class TableStorageFormat(DefineBase):
|
|
|
337
337
|
CSV = "csv"
|
|
338
338
|
"""File extension for tables stored in CSV format."""
|
|
339
339
|
|
|
340
|
+
PARQUET = "parquet"
|
|
341
|
+
"""File extension for tables stored in PARQUET format."""
|
|
342
|
+
|
|
340
343
|
PICKLE = "pkl"
|
|
341
344
|
"""File extension for tables stored in PKL format."""
|
|
342
345
|
|