audformat 1.1.4__tar.gz → 1.3.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.
Files changed (90) hide show
  1. {audformat-1.1.4 → audformat-1.3.0}/.github/workflows/test.yml +16 -2
  2. {audformat-1.1.4 → audformat-1.3.0}/CHANGELOG.rst +48 -0
  3. {audformat-1.1.4 → audformat-1.3.0}/LICENSE +2 -1
  4. {audformat-1.1.4 → audformat-1.3.0}/PKG-INFO +9 -8
  5. {audformat-1.1.4 → audformat-1.3.0}/README.rst +1 -1
  6. {audformat-1.1.4 → audformat-1.3.0}/audformat/core/column.py +1 -1
  7. {audformat-1.1.4 → audformat-1.3.0}/audformat/core/common.py +15 -2
  8. {audformat-1.1.4 → audformat-1.3.0}/audformat/core/database.py +4 -4
  9. {audformat-1.1.4 → audformat-1.3.0}/audformat/core/define.py +3 -0
  10. {audformat-1.1.4 → audformat-1.3.0}/audformat/core/table.py +453 -93
  11. {audformat-1.1.4 → audformat-1.3.0}/audformat/core/utils.py +142 -32
  12. {audformat-1.1.4 → audformat-1.3.0}/audformat.egg-info/PKG-INFO +9 -8
  13. {audformat-1.1.4 → audformat-1.3.0}/audformat.egg-info/requires.txt +2 -1
  14. {audformat-1.1.4 → audformat-1.3.0}/docs/data-format.rst +16 -12
  15. {audformat-1.1.4 → audformat-1.3.0}/docs/data-introduction.rst +1 -1
  16. {audformat-1.1.4 → audformat-1.3.0}/pyproject.toml +6 -4
  17. {audformat-1.1.4 → audformat-1.3.0}/tests/test_column.py +186 -2
  18. {audformat-1.1.4 → audformat-1.3.0}/tests/test_database.py +24 -5
  19. {audformat-1.1.4 → audformat-1.3.0}/tests/test_database_get.py +12 -12
  20. {audformat-1.1.4 → audformat-1.3.0}/tests/test_misc_table.py +204 -13
  21. {audformat-1.1.4 → audformat-1.3.0}/tests/test_scheme.py +6 -6
  22. {audformat-1.1.4 → audformat-1.3.0}/tests/test_table.py +438 -15
  23. {audformat-1.1.4 → audformat-1.3.0}/tests/test_utils.py +232 -6
  24. {audformat-1.1.4 → audformat-1.3.0}/tests/test_utils_concat.py +5 -5
  25. {audformat-1.1.4 → audformat-1.3.0}/.github/workflows/doc.yml +0 -0
  26. {audformat-1.1.4 → audformat-1.3.0}/.github/workflows/linter.yml +0 -0
  27. {audformat-1.1.4 → audformat-1.3.0}/.github/workflows/publish.yml +0 -0
  28. {audformat-1.1.4 → audformat-1.3.0}/.gitignore +0 -0
  29. {audformat-1.1.4 → audformat-1.3.0}/.pre-commit-config.yaml +0 -0
  30. {audformat-1.1.4 → audformat-1.3.0}/CONTRIBUTING.rst +0 -0
  31. {audformat-1.1.4 → audformat-1.3.0}/audformat/__init__.py +0 -0
  32. {audformat-1.1.4 → audformat-1.3.0}/audformat/core/__init__.py +0 -0
  33. {audformat-1.1.4 → audformat-1.3.0}/audformat/core/attachment.py +0 -0
  34. {audformat-1.1.4 → audformat-1.3.0}/audformat/core/conftest.py +0 -0
  35. {audformat-1.1.4 → audformat-1.3.0}/audformat/core/errors.py +0 -0
  36. {audformat-1.1.4 → audformat-1.3.0}/audformat/core/index.py +0 -0
  37. {audformat-1.1.4 → audformat-1.3.0}/audformat/core/media.py +0 -0
  38. {audformat-1.1.4 → audformat-1.3.0}/audformat/core/rater.py +0 -0
  39. {audformat-1.1.4 → audformat-1.3.0}/audformat/core/scheme.py +0 -0
  40. {audformat-1.1.4 → audformat-1.3.0}/audformat/core/split.py +0 -0
  41. {audformat-1.1.4 → audformat-1.3.0}/audformat/core/testing.py +0 -0
  42. {audformat-1.1.4 → audformat-1.3.0}/audformat/core/typing.py +0 -0
  43. {audformat-1.1.4 → audformat-1.3.0}/audformat/define/__init__.py +0 -0
  44. {audformat-1.1.4 → audformat-1.3.0}/audformat/errors/__init__.py +0 -0
  45. {audformat-1.1.4 → audformat-1.3.0}/audformat/testing/__init__.py +0 -0
  46. {audformat-1.1.4 → audformat-1.3.0}/audformat/utils/__init__.py +0 -0
  47. {audformat-1.1.4 → audformat-1.3.0}/audformat.egg-info/SOURCES.txt +0 -0
  48. {audformat-1.1.4 → audformat-1.3.0}/audformat.egg-info/dependency_links.txt +0 -0
  49. {audformat-1.1.4 → audformat-1.3.0}/audformat.egg-info/top_level.txt +0 -0
  50. {audformat-1.1.4 → audformat-1.3.0}/benchmarks/benchmark_union.py +0 -0
  51. {audformat-1.1.4 → audformat-1.3.0}/docs/accessing-data.rst +0 -0
  52. {audformat-1.1.4 → audformat-1.3.0}/docs/api/audformat.define.rst +0 -0
  53. {audformat-1.1.4 → audformat-1.3.0}/docs/api/audformat.errors.rst +0 -0
  54. {audformat-1.1.4 → audformat-1.3.0}/docs/api/audformat.rst +0 -0
  55. {audformat-1.1.4 → audformat-1.3.0}/docs/api/audformat.testing.rst +0 -0
  56. {audformat-1.1.4 → audformat-1.3.0}/docs/api/audformat.utils.rst +0 -0
  57. {audformat-1.1.4 → audformat-1.3.0}/docs/api-src/audformat.define.rst +0 -0
  58. {audformat-1.1.4 → audformat-1.3.0}/docs/api-src/audformat.errors.rst +0 -0
  59. {audformat-1.1.4 → audformat-1.3.0}/docs/api-src/audformat.rst +0 -0
  60. {audformat-1.1.4 → audformat-1.3.0}/docs/api-src/audformat.testing.rst +0 -0
  61. {audformat-1.1.4 → audformat-1.3.0}/docs/api-src/audformat.utils.rst +0 -0
  62. {audformat-1.1.4 → audformat-1.3.0}/docs/changelog.rst +0 -0
  63. {audformat-1.1.4 → audformat-1.3.0}/docs/combine-tables.rst +0 -0
  64. {audformat-1.1.4 → audformat-1.3.0}/docs/conf.py +0 -0
  65. {audformat-1.1.4 → audformat-1.3.0}/docs/contributing.rst +0 -0
  66. {audformat-1.1.4 → audformat-1.3.0}/docs/create-database.rst +0 -0
  67. {audformat-1.1.4 → audformat-1.3.0}/docs/data-conventions.rst +0 -0
  68. {audformat-1.1.4 → audformat-1.3.0}/docs/data-example.rst +0 -0
  69. {audformat-1.1.4 → audformat-1.3.0}/docs/data-header.rst +0 -0
  70. {audformat-1.1.4 → audformat-1.3.0}/docs/data-misc-tables.rst +0 -0
  71. {audformat-1.1.4 → audformat-1.3.0}/docs/data-tables.rst +0 -0
  72. {audformat-1.1.4 → audformat-1.3.0}/docs/emodb-example.rst +0 -0
  73. {audformat-1.1.4 → audformat-1.3.0}/docs/genindex.rst +0 -0
  74. {audformat-1.1.4 → audformat-1.3.0}/docs/index.rst +0 -0
  75. {audformat-1.1.4 → audformat-1.3.0}/docs/install.rst +0 -0
  76. {audformat-1.1.4 → audformat-1.3.0}/docs/map-scheme.rst +0 -0
  77. {audformat-1.1.4 → audformat-1.3.0}/docs/pics/audformat-database.dot +0 -0
  78. {audformat-1.1.4 → audformat-1.3.0}/docs/pics/audformat-misc-table.dot +0 -0
  79. {audformat-1.1.4 → audformat-1.3.0}/docs/pics/audformat-table.dot +0 -0
  80. {audformat-1.1.4 → audformat-1.3.0}/docs/requirements.txt +0 -0
  81. {audformat-1.1.4 → audformat-1.3.0}/docs/update-database.rst +0 -0
  82. {audformat-1.1.4 → audformat-1.3.0}/requirements.txt +0 -0
  83. {audformat-1.1.4 → audformat-1.3.0}/setup.cfg +0 -0
  84. {audformat-1.1.4 → audformat-1.3.0}/tests/conftest.py +0 -0
  85. {audformat-1.1.4 → audformat-1.3.0}/tests/requirements.txt +0 -0
  86. {audformat-1.1.4 → audformat-1.3.0}/tests/test_attachment.py +0 -0
  87. {audformat-1.1.4 → audformat-1.3.0}/tests/test_common.py +0 -0
  88. {audformat-1.1.4 → audformat-1.3.0}/tests/test_eq.py +0 -0
  89. {audformat-1.1.4 → audformat-1.3.0}/tests/test_errors.py +0 -0
  90. {audformat-1.1.4 → audformat-1.3.0}/tests/test_index.py +0 -0
@@ -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,19 @@ 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
+ # need to use an audb version in the test,
63
+ # that supports audeer==2.0.0
64
+ pip install "audb==1.7.4"
65
+ if: matrix.requirements == 'minimum'
66
+
53
67
  - name: Test with pytest
54
68
  run: |
55
69
  python -m pytest
@@ -7,6 +7,54 @@ The format is based on `Keep a Changelog`_,
7
7
  and this project adheres to `Semantic Versioning`_.
8
8
 
9
9
 
10
+ Version 1.3.0 (2024-07-18)
11
+ --------------------------
12
+
13
+ * Added: ``strict`` argument
14
+ to ``audformat.utils.hash()``.
15
+ If set to ``True``,
16
+ the order of the data,
17
+ and its level/column names
18
+ are taken into account
19
+ when calculating the hash
20
+ * Changed: store tables per default as parquet files,
21
+ by changing the default value of ``storage_format``
22
+ to ``"parquet"``
23
+ in ``audformat.Table.save()``
24
+ and ``audformat.Database.save()``
25
+ * Fixed: load csv tables with ``pandas.read_csv()``,
26
+ if ``pyarrow.csv.read_csv()`` fails
27
+
28
+
29
+ Version 1.2.0 (2024-06-25)
30
+ --------------------------
31
+
32
+ * Added: expand format specifications
33
+ to allow parquet files
34
+ as table files
35
+ * Added: support for storing tables as parquet files
36
+ by adding ``"parquet"``
37
+ (``audformat.define.TableStorageFormat.PARQUET``)
38
+ as an option
39
+ for the ``storage_format`` argument
40
+ of ``audformat.Table.save()``
41
+ and ``audformat.Database.save()``
42
+ * Added: support for ``numpy>=2.0``
43
+ * Added: mention text files
44
+ as potential media files
45
+ in the documentation
46
+ * Added: mention in the documentation of ``audformat.utils.hash()``
47
+ that column/level names do not influence its hash value
48
+ * Added: warn in the documentation of ``audformat.utils.hash()``
49
+ that the hash of a dataframe or series,
50
+ containing ``"Int64"`` as data type,
51
+ changes with ``pandas>=2.2.0``
52
+ * Fixed: ensure ``"boolean"`` data type
53
+ is always used
54
+ in indices of misc tables
55
+ that store boolean values
56
+
57
+
10
58
  Version 1.1.4 (2024-05-15)
11
59
  --------------------------
12
60
 
@@ -3,8 +3,9 @@ MIT License
3
3
  Copyright (c) 2018-present audEERING GmbH and Contributors
4
4
 
5
5
  Authors:
6
- Johannes Wagner
7
6
  Hagen Wierstorf
7
+ Johannes Wagner
8
+ Christian Geng
8
9
  Baha Eddine Abrougui
9
10
 
10
11
  Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,16 +1,17 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: audformat
3
- Version: 1.1.4
3
+ Version: 1.3.0
4
4
  Summary: Python implementation of audformat
5
- Author: BahaEddine Abrougui
6
- Author-email: Hagen Wierstorf <hwierstorf@audeering.com>, Johannes Wagner <jwagner@audeering.com>
5
+ Author: Johannes Wagner, BahaEddine Abrougui
6
+ Author-email: Hagen Wierstorf <hwierstorf@audeering.com>, Christian Geng <cgeng@audeering.com>
7
7
  License: MIT License
8
8
 
9
9
  Copyright (c) 2018-present audEERING GmbH and Contributors
10
10
 
11
11
  Authors:
12
- Johannes Wagner
13
12
  Hagen Wierstorf
13
+ Johannes Wagner
14
+ Christian Geng
14
15
  Baha Eddine Abrougui
15
16
 
16
17
  Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -41,12 +42,11 @@ Classifier: License :: OSI Approved :: MIT License
41
42
  Classifier: Operating System :: OS Independent
42
43
  Classifier: Programming Language :: Python
43
44
  Classifier: Programming Language :: Python :: 3
44
- Classifier: Programming Language :: Python :: 3.8
45
45
  Classifier: Programming Language :: Python :: 3.9
46
46
  Classifier: Programming Language :: Python :: 3.10
47
47
  Classifier: Programming Language :: Python :: 3.11
48
48
  Classifier: Topic :: Scientific/Engineering
49
- Requires-Python: >=3.8
49
+ Requires-Python: >=3.9
50
50
  Description-Content-Type: text/x-rst
51
51
  License-File: LICENSE
52
52
  Requires-Dist: audeer>=2.0.0
@@ -54,8 +54,9 @@ Requires-Dist: audiofile>=0.4.0
54
54
  Requires-Dist: iso-639
55
55
  Requires-Dist: iso3166
56
56
  Requires-Dist: oyaml
57
+ Requires-Dist: pandas>=2.1.0
58
+ Requires-Dist: pyarrow>=10.0.1
57
59
  Requires-Dist: pyyaml>=5.4.1
58
- Requires-Dist: pandas>=1.4.1
59
60
 
60
61
  =========
61
62
  audformat
@@ -66,7 +67,7 @@ audformat
66
67
  Specification and reference implementation of **audformat**.
67
68
 
68
69
  audformat stores media data,
69
- such as audio or video,
70
+ such as audio, video, or text
70
71
  together with corresponding annotations
71
72
  in a pre-defined way.
72
73
  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 video,
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
@@ -265,7 +265,7 @@ class Column(HeaderBase):
265
265
  if map in value:
266
266
  value = value[map]
267
267
  else:
268
- value = np.NaN
268
+ value = np.nan
269
269
  mapping[key] = value
270
270
 
271
271
  result = result.map(mapping)
@@ -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:
@@ -970,7 +970,7 @@ class Database(HeaderBase):
970
970
  *,
971
971
  name: str = "db",
972
972
  indent: int = 2,
973
- storage_format: str = define.TableStorageFormat.CSV,
973
+ storage_format: str = define.TableStorageFormat.PARQUET,
974
974
  update_other_formats: bool = True,
975
975
  header_only: bool = False,
976
976
  num_workers: typing.Optional[int] = 1,
@@ -979,7 +979,7 @@ class Database(HeaderBase):
979
979
  r"""Save database to disk.
980
980
 
981
981
  Creates a header ``<root>/<name>.yaml``
982
- 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]``.
983
983
 
984
984
  Existing files will be overwritten.
985
985
  If ``update_other_formats`` is provided,
@@ -1383,7 +1383,7 @@ class Database(HeaderBase):
1383
1383
  r"""Load database from disk.
1384
1384
 
1385
1385
  Expects a header ``<root>/<name>.yaml``
1386
- 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]``
1387
1387
  Media files should be located under ``root``.
1388
1388
 
1389
1389
  Args:
@@ -1409,7 +1409,7 @@ class Database(HeaderBase):
1409
1409
  Raises:
1410
1410
  FileNotFoundError: if the database header file cannot be found
1411
1411
  under ``root``
1412
- RuntimeError: if a CSV table file is newer
1412
+ RuntimeError: if a CSV or PARQUET table file is newer
1413
1413
  than the corresponding PKL file
1414
1414
 
1415
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