audformat 1.3.2__tar.gz → 1.3.3__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 (92) hide show
  1. {audformat-1.3.2 → audformat-1.3.3}/.github/workflows/doc.yml +12 -11
  2. {audformat-1.3.2 → audformat-1.3.3}/.github/workflows/linter.yml +6 -6
  3. {audformat-1.3.2 → audformat-1.3.3}/.github/workflows/publish.yml +6 -12
  4. {audformat-1.3.2 → audformat-1.3.3}/.github/workflows/test.yml +19 -15
  5. {audformat-1.3.2 → audformat-1.3.3}/.gitignore +1 -0
  6. {audformat-1.3.2 → audformat-1.3.3}/.pre-commit-config.yaml +3 -3
  7. {audformat-1.3.2 → audformat-1.3.3}/CHANGELOG.rst +10 -0
  8. {audformat-1.3.2 → audformat-1.3.3}/CONTRIBUTING.rst +14 -30
  9. {audformat-1.3.2 → audformat-1.3.3}/PKG-INFO +4 -32
  10. {audformat-1.3.2 → audformat-1.3.3}/audformat/core/attachment.py +1 -1
  11. {audformat-1.3.2 → audformat-1.3.3}/audformat/core/column.py +3 -8
  12. {audformat-1.3.2 → audformat-1.3.3}/audformat/core/database.py +3 -1
  13. {audformat-1.3.2 → audformat-1.3.3}/audformat/core/errors.py +6 -10
  14. {audformat-1.3.2 → audformat-1.3.3}/audformat/core/index.py +0 -2
  15. {audformat-1.3.2 → audformat-1.3.3}/audformat/core/scheme.py +7 -8
  16. {audformat-1.3.2 → audformat-1.3.3}/audformat/core/table.py +6 -12
  17. {audformat-1.3.2 → audformat-1.3.3}/audformat/core/testing.py +0 -2
  18. {audformat-1.3.2 → audformat-1.3.3}/audformat/core/typing.py +0 -2
  19. {audformat-1.3.2 → audformat-1.3.3}/audformat/core/utils.py +4 -15
  20. {audformat-1.3.2 → audformat-1.3.3}/audformat.egg-info/PKG-INFO +4 -32
  21. {audformat-1.3.2 → audformat-1.3.3}/audformat.egg-info/SOURCES.txt +0 -3
  22. {audformat-1.3.2 → audformat-1.3.3}/benchmarks/benchmark_union.py +1 -1
  23. {audformat-1.3.2 → audformat-1.3.3}/docs/data-format.rst +4 -3
  24. {audformat-1.3.2 → audformat-1.3.3}/docs/data-misc-tables.rst +3 -2
  25. {audformat-1.3.2 → audformat-1.3.3}/docs/data-tables.rst +1 -1
  26. audformat-1.3.3/docs/install.rst +14 -0
  27. {audformat-1.3.2 → audformat-1.3.3}/pyproject.toml +26 -4
  28. {audformat-1.3.2 → audformat-1.3.3}/tests/test_attachment.py +1 -2
  29. {audformat-1.3.2 → audformat-1.3.3}/tests/test_database.py +1 -2
  30. {audformat-1.3.2 → audformat-1.3.3}/tests/test_misc_table.py +52 -4
  31. {audformat-1.3.2 → audformat-1.3.3}/tests/test_scheme.py +6 -6
  32. {audformat-1.3.2 → audformat-1.3.3}/tests/test_table.py +46 -2
  33. {audformat-1.3.2 → audformat-1.3.3}/tests/test_utils.py +4 -5
  34. {audformat-1.3.2 → audformat-1.3.3}/tests/test_utils_concat.py +1 -2
  35. audformat-1.3.2/docs/install.rst +0 -11
  36. audformat-1.3.2/docs/requirements.txt +0 -9
  37. audformat-1.3.2/requirements.txt +0 -1
  38. audformat-1.3.2/tests/requirements.txt +0 -7
  39. {audformat-1.3.2 → audformat-1.3.3}/LICENSE +0 -0
  40. {audformat-1.3.2 → audformat-1.3.3}/README.rst +0 -0
  41. {audformat-1.3.2 → audformat-1.3.3}/audformat/__init__.py +0 -0
  42. {audformat-1.3.2 → audformat-1.3.3}/audformat/core/__init__.py +0 -0
  43. {audformat-1.3.2 → audformat-1.3.3}/audformat/core/common.py +0 -0
  44. {audformat-1.3.2 → audformat-1.3.3}/audformat/core/conftest.py +0 -0
  45. {audformat-1.3.2 → audformat-1.3.3}/audformat/core/define.py +0 -0
  46. {audformat-1.3.2 → audformat-1.3.3}/audformat/core/media.py +0 -0
  47. {audformat-1.3.2 → audformat-1.3.3}/audformat/core/rater.py +0 -0
  48. {audformat-1.3.2 → audformat-1.3.3}/audformat/core/split.py +0 -0
  49. {audformat-1.3.2 → audformat-1.3.3}/audformat/define/__init__.py +0 -0
  50. {audformat-1.3.2 → audformat-1.3.3}/audformat/errors/__init__.py +0 -0
  51. {audformat-1.3.2 → audformat-1.3.3}/audformat/testing/__init__.py +0 -0
  52. {audformat-1.3.2 → audformat-1.3.3}/audformat/utils/__init__.py +0 -0
  53. {audformat-1.3.2 → audformat-1.3.3}/audformat.egg-info/dependency_links.txt +0 -0
  54. {audformat-1.3.2 → audformat-1.3.3}/audformat.egg-info/requires.txt +0 -0
  55. {audformat-1.3.2 → audformat-1.3.3}/audformat.egg-info/top_level.txt +0 -0
  56. {audformat-1.3.2 → audformat-1.3.3}/docs/accessing-data.rst +0 -0
  57. {audformat-1.3.2 → audformat-1.3.3}/docs/api/audformat.define.rst +0 -0
  58. {audformat-1.3.2 → audformat-1.3.3}/docs/api/audformat.errors.rst +0 -0
  59. {audformat-1.3.2 → audformat-1.3.3}/docs/api/audformat.rst +0 -0
  60. {audformat-1.3.2 → audformat-1.3.3}/docs/api/audformat.testing.rst +0 -0
  61. {audformat-1.3.2 → audformat-1.3.3}/docs/api/audformat.utils.rst +0 -0
  62. {audformat-1.3.2 → audformat-1.3.3}/docs/api-src/audformat.define.rst +0 -0
  63. {audformat-1.3.2 → audformat-1.3.3}/docs/api-src/audformat.errors.rst +0 -0
  64. {audformat-1.3.2 → audformat-1.3.3}/docs/api-src/audformat.rst +0 -0
  65. {audformat-1.3.2 → audformat-1.3.3}/docs/api-src/audformat.testing.rst +0 -0
  66. {audformat-1.3.2 → audformat-1.3.3}/docs/api-src/audformat.utils.rst +0 -0
  67. {audformat-1.3.2 → audformat-1.3.3}/docs/changelog.rst +0 -0
  68. {audformat-1.3.2 → audformat-1.3.3}/docs/combine-tables.rst +0 -0
  69. {audformat-1.3.2 → audformat-1.3.3}/docs/conf.py +0 -0
  70. {audformat-1.3.2 → audformat-1.3.3}/docs/conftest.py +0 -0
  71. {audformat-1.3.2 → audformat-1.3.3}/docs/contributing.rst +0 -0
  72. {audformat-1.3.2 → audformat-1.3.3}/docs/create-database.rst +0 -0
  73. {audformat-1.3.2 → audformat-1.3.3}/docs/data-conventions.rst +0 -0
  74. {audformat-1.3.2 → audformat-1.3.3}/docs/data-example.rst +0 -0
  75. {audformat-1.3.2 → audformat-1.3.3}/docs/data-header.rst +0 -0
  76. {audformat-1.3.2 → audformat-1.3.3}/docs/data-introduction.rst +0 -0
  77. {audformat-1.3.2 → audformat-1.3.3}/docs/emodb-example.rst +0 -0
  78. {audformat-1.3.2 → audformat-1.3.3}/docs/genindex.rst +0 -0
  79. {audformat-1.3.2 → audformat-1.3.3}/docs/index.rst +0 -0
  80. {audformat-1.3.2 → audformat-1.3.3}/docs/map-scheme.rst +0 -0
  81. {audformat-1.3.2 → audformat-1.3.3}/docs/pics/audformat-database.dot +0 -0
  82. {audformat-1.3.2 → audformat-1.3.3}/docs/pics/audformat-misc-table.dot +0 -0
  83. {audformat-1.3.2 → audformat-1.3.3}/docs/pics/audformat-table.dot +0 -0
  84. {audformat-1.3.2 → audformat-1.3.3}/docs/update-database.rst +0 -0
  85. {audformat-1.3.2 → audformat-1.3.3}/setup.cfg +0 -0
  86. {audformat-1.3.2 → audformat-1.3.3}/tests/conftest.py +0 -0
  87. {audformat-1.3.2 → audformat-1.3.3}/tests/test_column.py +0 -0
  88. {audformat-1.3.2 → audformat-1.3.3}/tests/test_common.py +0 -0
  89. {audformat-1.3.2 → audformat-1.3.3}/tests/test_database_get.py +0 -0
  90. {audformat-1.3.2 → audformat-1.3.3}/tests/test_eq.py +0 -0
  91. {audformat-1.3.2 → audformat-1.3.3}/tests/test_errors.py +0 -0
  92. {audformat-1.3.2 → audformat-1.3.3}/tests/test_index.py +0 -0
@@ -13,10 +13,16 @@ jobs:
13
13
  strategy:
14
14
  matrix:
15
15
  os: [ ubuntu-latest ]
16
- python-version: [ '3.10' ]
16
+ python-version: [ '3.12' ]
17
17
 
18
18
  steps:
19
19
  - uses: actions/checkout@v4
20
+ with:
21
+ # Ensure audformat is assigned a version,
22
+ # so we can install audb as a dependency
23
+ # https://github.com/astral-sh/uv/issues/8148#issuecomment-2408639333
24
+ fetch-depth: 0
25
+ fetch-tags: true
20
26
 
21
27
  - name: Cache emodb
22
28
  uses: actions/cache@v4
@@ -29,21 +35,16 @@ jobs:
29
35
  with:
30
36
  python-version: ${{ matrix.python-version }}
31
37
 
38
+ - name: Install uv
39
+ uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d
40
+
32
41
  - name: Ubuntu - install graphviz
33
42
  run: |
34
43
  sudo apt-get update
35
44
  sudo apt-get install --yes graphviz
36
45
 
37
- - name: Install package
38
- run: |
39
- python -m pip install --upgrade pip
40
- pip install -r requirements.txt
41
-
42
- - name: Install docs requirements
43
- run: pip install -r docs/requirements.txt
44
-
45
46
  - name: Test building documentation
46
- run: python -m sphinx docs/ docs/_build/ -b html -W
47
+ run: uv run python -m sphinx docs/ docs/_build/ -b html -W
47
48
 
48
49
  - name: Check links in documentation
49
- run: python -m sphinx docs/ docs/_build/ -b linkcheck -W
50
+ run: uv run python -m sphinx docs/ docs/_build/ -b linkcheck -W
@@ -17,13 +17,13 @@ jobs:
17
17
  - name: Set up Python
18
18
  uses: actions/setup-python@v5
19
19
  with:
20
- python-version: '3.10'
20
+ python-version: '3.12'
21
+
22
+ - name: Install uv
23
+ uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d
21
24
 
22
25
  - name: Install pre-commit hooks
23
- run: |
24
- pip install pre-commit
25
- pre-commit install --install-hooks
26
+ run: uvx pre-commit install --install-hooks
26
27
 
27
28
  - name: Code style check via pre-commit
28
- run: |
29
- pre-commit run --all-files
29
+ run: uvx pre-commit run --all-files
@@ -29,16 +29,15 @@ jobs:
29
29
  - name: Set up Python
30
30
  uses: actions/setup-python@v5
31
31
  with:
32
- python-version: '3.10'
32
+ python-version: '3.12'
33
+
34
+ - name: Install uv
35
+ uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d
33
36
 
34
- - name: Install dependencies
35
- run: |
36
- python -m pip install --upgrade pip
37
- pip install build virtualenv
38
37
 
39
38
  # PyPI package
40
39
  - name: Build Python package
41
- run: python -m build
40
+ run: uv build
42
41
 
43
42
  - name: Publish Python package to PyPI
44
43
  uses: pypa/gh-action-pypi-publish@release/v1
@@ -49,14 +48,9 @@ jobs:
49
48
  sudo apt-get update
50
49
  sudo apt-get install --no-install-recommends --yes graphviz libsndfile1 sox
51
50
 
52
- - name: Install doc dependencies
53
- run: |
54
- pip install -r requirements.txt
55
- pip install -r docs/requirements.txt
56
51
 
57
52
  - name: Build documentation
58
- run: |
59
- python -m sphinx docs/ docs/_build/ -b html
53
+ run: uv run python -m sphinx docs/ docs/_build/ -b html
60
54
 
61
55
  - name: Deploy documentation to Github pages
62
56
  uses: peaceiris/actions-gh-pages@v4
@@ -13,25 +13,28 @@ jobs:
13
13
  strategy:
14
14
  matrix:
15
15
  os: [ ubuntu-latest, windows-latest, macOS-latest ]
16
- python-version: [ '3.10' ]
16
+ python-version: [ '3.12' ]
17
17
  include:
18
18
  - os: ubuntu-latest
19
- python-version: '3.9'
19
+ python-version: '3.10'
20
20
  - os: ubuntu-latest
21
21
  python-version: '3.11'
22
- - os: ubuntu-latest
23
- python-version: '3.12'
24
22
  - os: ubuntu-latest
25
23
  python-version: '3.13'
26
24
  - os: ubuntu-latest
27
- python-version: '3.9'
25
+ python-version: '3.14'
26
+ - os: ubuntu-latest
27
+ python-version: '3.10'
28
28
  requirements: 'minimum'
29
29
 
30
30
  steps:
31
31
  - uses: actions/checkout@v4
32
32
  with:
33
+ # Ensure audformat is assigned a version,
34
+ # so we can install audb as a dependency
35
+ # https://github.com/astral-sh/uv/issues/8148#issuecomment-2408639333
36
+ fetch-depth: 0
33
37
  fetch-tags: true
34
- fetch-depth: 50
35
38
 
36
39
  - name: Cache emodb
37
40
  uses: actions/cache@v4
@@ -45,18 +48,20 @@ jobs:
45
48
  with:
46
49
  python-version: ${{ matrix.python-version }}
47
50
 
51
+ - name: Install uv
52
+ uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d
53
+
48
54
  - name: Prepare Ubuntu
49
55
  run: |
50
56
  sudo apt-get update
51
57
  sudo apt-get install --no-install-recommends --yes libsndfile1
52
58
  if: matrix.os == 'ubuntu-latest'
53
59
 
54
- - name: Install dependencies
55
- run: |
56
- python -V
57
- python -m pip install --upgrade pip
58
- pip install -r requirements.txt
59
- pip install -r tests/requirements.txt
60
+ - name: Sync Python environment
61
+ run: uv sync
62
+
63
+ - name: List installed Python packages
64
+ run: uv pip list
60
65
 
61
66
  - name: Downgrade to minimum dependencies
62
67
  run: |
@@ -65,15 +70,14 @@ jobs:
65
70
  pip install "numpy<2.0.0"
66
71
  pip install "pandas==2.1.0"
67
72
  pip install "pyarrow==10.0.1"
68
- pip install "pyyaml==5.4.1"
73
+ pip install "pyyaml==6.0.1"
69
74
  # need to use an audb version in the test,
70
75
  # that supports audeer==2.0.0
71
76
  pip install "audb==1.7.4"
72
77
  if: matrix.requirements == 'minimum'
73
78
 
74
79
  - name: Test with pytest
75
- run: |
76
- python -m pytest
80
+ run: uv run pytest
77
81
 
78
82
  - name: Upload coverage to Codecov
79
83
  uses: codecov/codecov-action@v4
@@ -11,3 +11,4 @@ emodb-src/
11
11
  emodb.zip
12
12
  coverage.xml
13
13
  docs/api/
14
+ uv.lock
@@ -9,17 +9,17 @@
9
9
  #
10
10
  #
11
11
  default_language_version:
12
- python: python3.10
12
+ python: python3.12
13
13
 
14
14
  repos:
15
15
  - repo: https://github.com/astral-sh/ruff-pre-commit
16
- rev: v0.7.0
16
+ rev: v0.13.3
17
17
  hooks:
18
18
  - id: ruff
19
19
  args: [ --fix ]
20
20
  - id: ruff-format
21
21
  - repo: https://github.com/codespell-project/codespell
22
- rev: v2.3.0
22
+ rev: v2.4.1
23
23
  hooks:
24
24
  - id: codespell
25
25
  additional_dependencies:
@@ -7,6 +7,16 @@ 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.3 (2026-01-12)
11
+ --------------------------
12
+
13
+ * Added: support for Python 3.14
14
+ * Added: document support for (misc) tables with zero columns
15
+ in the specification
16
+ * Fixed: ensure cache compatibility between different ``pandas`` versions
17
+ * Removed: support for Python 3.9
18
+
19
+
10
20
  Version 1.3.2 (2025-05-27)
11
21
  --------------------------
12
22
 
@@ -22,11 +22,7 @@ you should get the newest development version from Github_::
22
22
 
23
23
  git clone https://github.com/audeering/audformat/
24
24
  cd audformat
25
- # Create virtual environment for this project
26
- # e.g.
27
- # virtualenv --python="python3" $HOME/.envs/audformat
28
- # source $HOME/.envs/audformat/bin/activate
29
- pip install -r requirements.txt
25
+ uv sync
30
26
 
31
27
 
32
28
  This way,
@@ -50,9 +46,8 @@ are defined in :file:`pyproject.toml`.
50
46
  The checks are executed in the CI using `pre-commit`_.
51
47
  You can enable those checks locally by executing::
52
48
 
53
- pip install pre-commit # consider system wide installation
54
- pre-commit install
55
- pre-commit run --all-files
49
+ uvx pre-commit install
50
+ uvx pre-commit run --all-files
56
51
 
57
52
  Afterwards ruff_ and codespell_ are executed
58
53
  every time you create a commit.
@@ -60,15 +55,14 @@ every time you create a commit.
60
55
  You can also install ruff_ and codespell_
61
56
  and call it directly::
62
57
 
63
- pip install ruff codespell # consider system wide installation
64
- ruff check --fix . # lint all Python files, and fix any fixable errors
65
- ruff format . # format code of all Python files
66
- codespell
58
+ uvx ruff check --fix . # lint all Python files, and fix any fixable errors
59
+ uvx ruff format . # format code of all Python files
60
+ uvx codespell
67
61
 
68
62
  It can be restricted to specific folders::
69
63
 
70
- ruff check audfoo/ tests/
71
- codespell audfoo/ tests/
64
+ uvx ruff check audformat/ tests/
65
+ uvx codespell audformat/ tests/
72
66
 
73
67
 
74
68
  .. _codespell: https://github.com/codespell-project/codespell/
@@ -81,21 +75,16 @@ Building the Documentation
81
75
  --------------------------
82
76
 
83
77
  If you make changes to the documentation,
84
- you can re-create the HTML pages using Sphinx_.
85
- You can install it and a few other necessary packages with::
78
+ you can re-create the HTML pages using Sphinx_::
86
79
 
87
- pip install -r docs/requirements.txt
88
-
89
- To create the HTML pages, use::
90
-
91
- python -m sphinx docs/ build/sphinx/html -b html
80
+ uv run python -m sphinx docs/ build/html -b html
92
81
 
93
82
  The generated files will be available
94
- in the directory :file:`build/sphinx/html/`.
83
+ in the directory :file:`build/html/`.
95
84
 
96
85
  It is also possible to automatically check if all links are still valid::
97
86
 
98
- python -m sphinx docs/ build/sphinx/html -b linkcheck
87
+ uv run python -m sphinx docs/ build/html -b linkcheck
99
88
 
100
89
  .. _Sphinx: https://www.sphinx-doc.org
101
90
 
@@ -103,14 +92,9 @@ It is also possible to automatically check if all links are still valid::
103
92
  Running the Tests
104
93
  -----------------
105
94
 
106
- You'll need pytest_ for that.
107
- It can be installed with::
108
-
109
- pip install -r tests/requirements.txt
110
-
111
- To execute the tests, simply run::
95
+ You can run tests with pytest_::
112
96
 
113
- python -m pytest
97
+ uv run pytest
114
98
 
115
99
  .. _pytest: https://pytest.org
116
100
 
@@ -1,54 +1,26 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: audformat
3
- Version: 1.3.2
3
+ Version: 1.3.3
4
4
  Summary: Python implementation of audformat
5
5
  Author: Johannes Wagner, BahaEddine Abrougui
6
6
  Author-email: Hagen Wierstorf <hwierstorf@audeering.com>, Christian Geng <cgeng@audeering.com>
7
- License: MIT License
8
-
9
- Copyright (c) 2018-present audEERING GmbH and Contributors
10
-
11
- Authors:
12
- Hagen Wierstorf
13
- Johannes Wagner
14
- Christian Geng
15
- Baha Eddine Abrougui
16
-
17
- Permission is hereby granted, free of charge, to any person obtaining a copy
18
- of this software and associated documentation files (the "Software"), to deal
19
- in the Software without restriction, including without limitation the rights
20
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
21
- copies of the Software, and to permit persons to whom the Software is
22
- furnished to do so, subject to the following conditions:
23
-
24
- The above copyright notice and this permission notice shall be included in all
25
- copies or substantial portions of the Software.
26
-
27
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
30
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
32
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33
- SOFTWARE.
34
-
7
+ License-Expression: MIT
35
8
  Project-URL: repository, https://github.com/audeering/audformat/
36
9
  Project-URL: documentation, https://audeering.github.io/audformat/
37
10
  Keywords: audio,database,annotation
38
11
  Classifier: Development Status :: 5 - Production/Stable
39
12
  Classifier: Intended Audience :: Science/Research
40
13
  Classifier: Intended Audience :: Developers
41
- Classifier: License :: OSI Approved :: MIT License
42
14
  Classifier: Operating System :: OS Independent
43
15
  Classifier: Programming Language :: Python
44
16
  Classifier: Programming Language :: Python :: 3
45
- Classifier: Programming Language :: Python :: 3.9
46
17
  Classifier: Programming Language :: Python :: 3.10
47
18
  Classifier: Programming Language :: Python :: 3.11
48
19
  Classifier: Programming Language :: Python :: 3.12
49
20
  Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
50
22
  Classifier: Topic :: Scientific/Engineering
51
- Requires-Python: >=3.9
23
+ Requires-Python: >=3.10
52
24
  Description-Content-Type: text/x-rst
53
25
  License-File: LICENSE
54
26
  Requires-Dist: audeer>=2.0.0
@@ -135,7 +135,7 @@ class Attachment(HeaderBase):
135
135
  or other.path.startswith(self.path)
136
136
  ):
137
137
  raise RuntimeError(
138
- f"Attachments '{self.path}' and '{other.path}' " "are nested."
138
+ f"Attachments '{self.path}' and '{other.path}' are nested."
139
139
  )
140
140
 
141
141
  def _check_path(
@@ -249,7 +249,7 @@ class Column(HeaderBase):
249
249
 
250
250
  if not any(labels.values()):
251
251
  raise ValueError(
252
- f"Scheme '{self.scheme_id}' provides no mapping " "for its labels."
252
+ f"Scheme '{self.scheme_id}' provides no mapping for its labels."
253
253
  )
254
254
 
255
255
  # Check that at least one key is available for map
@@ -261,12 +261,7 @@ class Column(HeaderBase):
261
261
  keys = sorted(list(set(keys)))
262
262
  if len(keys) > 0 and map not in keys:
263
263
  raise ValueError(
264
- f"Cannot map "
265
- f"'{self._id}' "
266
- f"to "
267
- f"'{map}'. "
268
- f"Expected one of "
269
- f"{list(keys)}."
264
+ f"Cannot map '{self._id}' to '{map}'. Expected one of {list(keys)}."
270
265
  )
271
266
 
272
267
  mapping = {}
@@ -355,7 +350,7 @@ class Column(HeaderBase):
355
350
  return self.set(values, index=index)
356
351
  else:
357
352
  raise ValueError(
358
- "Cannot set values of a filewise column " "using a segmented index."
353
+ "Cannot set values of a filewise column using a segmented index."
359
354
  )
360
355
  else:
361
356
  if is_scalar(values):
@@ -586,7 +586,9 @@ class Database(HeaderBase):
586
586
 
587
587
  Limit to a particular table or split.
588
588
 
589
- >>> db.get("emotion", tables=["emotion.categories.train.gold_standard"]).head()
589
+ >>> db.get(
590
+ ... "emotion", tables=["emotion.categories.train.gold_standard"]
591
+ ... ).head()
590
592
  emotion
591
593
  file
592
594
  wav/03a01Fa.wav happiness
@@ -13,10 +13,10 @@ class BadIdError(ValueError):
13
13
 
14
14
  def __init__(self, name: str, invalid_id: str, dictionary: dict):
15
15
  if not dictionary:
16
- message = f"Bad {name} ID '{invalid_id}', " f"no {name} objects defined yet"
16
+ message = f"Bad {name} ID '{invalid_id}', no {name} objects defined yet"
17
17
  else:
18
18
  message = (
19
- f"Bad {name} ID '{invalid_id}', " f"expected one of {list(dictionary)}"
19
+ f"Bad {name} ID '{invalid_id}', expected one of {list(dictionary)}"
20
20
  )
21
21
  super().__init__(message)
22
22
 
@@ -31,7 +31,7 @@ class BadKeyError(KeyError):
31
31
  """
32
32
 
33
33
  def __init__(self, invalid_key: str, valid_keys: Sequence[str]):
34
- message = f"Bad key '{invalid_key}', " f"expected one of {list(valid_keys)}"
34
+ message = f"Bad key '{invalid_key}', expected one of {list(valid_keys)}"
35
35
  super().__init__(message)
36
36
 
37
37
 
@@ -45,7 +45,7 @@ class BadTypeError(TypeError):
45
45
  """
46
46
 
47
47
  def __init__(self, invalid_value: object, expected_type: type):
48
- message = f"Bad type '{type(invalid_value)}', " f"expected '{expected_type}'"
48
+ message = f"Bad type '{type(invalid_value)}', expected '{expected_type}'"
49
49
  super().__init__(message)
50
50
 
51
51
 
@@ -59,9 +59,7 @@ class BadValueError(ValueError):
59
59
  """
60
60
 
61
61
  def __init__(self, invalid_value: str, valid_values: Sequence[str]):
62
- message = (
63
- f"Bad value '{invalid_value}', " f"expected one of {list(valid_values)}"
64
- )
62
+ message = f"Bad value '{invalid_value}', expected one of {list(valid_values)}"
65
63
  super().__init__(message)
66
64
 
67
65
 
@@ -75,6 +73,4 @@ class TableExistsError(KeyError):
75
73
  """
76
74
 
77
75
  def __init__(self, table_type: str, table_id: str):
78
- KeyError(
79
- f"There is already a " f"{table_type} " f"table with ID " f"'{table_id}'."
80
- )
76
+ KeyError(f"There is already a {table_type} table with ID '{table_id}'.")
@@ -1,5 +1,3 @@
1
- from __future__ import annotations
2
-
3
1
  import numpy as np
4
2
  import pandas as pd
5
3
 
@@ -1,5 +1,3 @@
1
- from __future__ import annotations
2
-
3
1
  import datetime
4
2
  import random
5
3
  import string
@@ -78,7 +76,9 @@ class Scheme(common.HeaderBase):
78
76
  >>> # Use index of misc table as labels
79
77
  >>> import audformat
80
78
  >>> db = audformat.Database("mydb")
81
- >>> db["speaker"] = audformat.MiscTable(pd.Index(["spk1", "spk2"], name="speaker"))
79
+ >>> db["speaker"] = audformat.MiscTable(
80
+ ... pd.Index(["spk1", "spk2"], name="speaker")
81
+ ... )
82
82
  >>> Scheme("str", labels="speaker")
83
83
  {dtype: str, labels: speaker}
84
84
 
@@ -134,12 +134,11 @@ class Scheme(common.HeaderBase):
134
134
  # Labels from misc table
135
135
  if dtype is None:
136
136
  raise ValueError(
137
- "'dtype' has to be provided "
138
- "when using a misc table as labels."
137
+ "'dtype' has to be provided when using a misc table as labels."
139
138
  )
140
139
  if dtype == define.DataType.BOOL:
141
140
  raise ValueError(
142
- "'dtype' cannot be 'bool' " "when using a misc table as labels."
141
+ "'dtype' cannot be 'bool' when using a misc table as labels."
143
142
  )
144
143
  else:
145
144
  # Labels from list or dictionary
@@ -354,7 +353,7 @@ class Scheme(common.HeaderBase):
354
353
  """
355
354
  if self.labels is None:
356
355
  raise ValueError(
357
- "Cannot replace labels when " "scheme does not define labels."
356
+ "Cannot replace labels when scheme does not define labels."
358
357
  )
359
358
  self._check_labels(labels)
360
359
 
@@ -393,7 +392,7 @@ class Scheme(common.HeaderBase):
393
392
  r"""Raise label related errors."""
394
393
  if not isinstance(labels, (dict, list, str)):
395
394
  raise ValueError(
396
- "Labels must be passed " "as a dictionary, list or ID of a misc table."
395
+ "Labels must be passed as a dictionary, list or ID of a misc table."
397
396
  )
398
397
 
399
398
  if self._db is not None and isinstance(labels, str):
@@ -414,7 +414,7 @@ class Base(HeaderBase):
414
414
  if map is not None:
415
415
  if self.db is None:
416
416
  raise RuntimeError(
417
- "Cannot map schemes, " "table is not assigned to a database."
417
+ "Cannot map schemes, table is not assigned to a database."
418
418
  )
419
419
 
420
420
  if not result_is_copy:
@@ -500,7 +500,7 @@ class Base(HeaderBase):
500
500
  if pickled:
501
501
  try:
502
502
  self._load_pickled(pkl_file)
503
- except (AttributeError, ValueError, EOFError) as ex:
503
+ except Exception as ex:
504
504
  # If exception is raised
505
505
  # (e.g. unsupported pickle protocol)
506
506
  # try to load from PARQUET or CSV
@@ -742,7 +742,7 @@ class Base(HeaderBase):
742
742
  left: HeaderDict | None,
743
743
  right: HeaderDict | None,
744
744
  ):
745
- raise ValueError(f"{msg}:\n" f"{left}\n" "!=\n" f"{right}")
745
+ raise ValueError(f"{msg}:\n{left}\n!=\n{right}")
746
746
 
747
747
  def assert_equal(
748
748
  msg: str,
@@ -762,13 +762,13 @@ class Base(HeaderBase):
762
762
 
763
763
  for other in others:
764
764
  assert_equal(
765
- "Media of table " f"'{other._id}' " "does not match",
765
+ f"Media of table '{other._id}' does not match",
766
766
  self.media,
767
767
  other.media,
768
768
  )
769
769
 
770
770
  assert_equal(
771
- "Split of table " f"'{other._id}' " "does not match",
771
+ f"Split of table '{other._id}' does not match",
772
772
  self.split,
773
773
  other.split,
774
774
  )
@@ -1859,13 +1859,7 @@ def _assert_table_index(
1859
1859
  input_type = index_type(index)
1860
1860
  if table.type != input_type:
1861
1861
  raise ValueError(
1862
- f"Cannot "
1863
- f"{operation} "
1864
- f"a "
1865
- f"{table.type} "
1866
- f"table with a "
1867
- f"{input_type} "
1868
- f"index."
1862
+ f"Cannot {operation} a {table.type} table with a {input_type} index."
1869
1863
  )
1870
1864
  elif not utils.is_index_alike([table.index, index]):
1871
1865
  want = (
@@ -1,5 +1,3 @@
1
- from __future__ import annotations
2
-
3
1
  from collections.abc import Callable
4
2
  from collections.abc import Sequence
5
3
  import os
@@ -1,5 +1,3 @@
1
- from __future__ import annotations
2
-
3
1
  import typing
4
2
 
5
3
  import numpy as np
@@ -1,5 +1,3 @@
1
- from __future__ import annotations
2
-
3
1
  import collections
4
2
  from collections.abc import Callable
5
3
  from collections.abc import Iterator
@@ -241,7 +239,7 @@ def concat(
241
239
  allowed_values = ["overlap", "mismatch"]
242
240
  if aggregate_strategy not in allowed_values:
243
241
  raise ValueError(
244
- "aggregate_strategy needs to be one of: " f"{', '.join(allowed_values)}"
242
+ f"aggregate_strategy needs to be one of: {', '.join(allowed_values)}"
245
243
  )
246
244
 
247
245
  if not objs:
@@ -1109,10 +1107,7 @@ def join_labels(
1109
1107
  dtypes = sorted(list({str(type(x)) for x in items}))
1110
1108
  if len(dtypes) > 1:
1111
1109
  raise ValueError(
1112
- f"Elements or keys must "
1113
- f"have the same dtype, "
1114
- f"but yours have "
1115
- f"{dtypes}.",
1110
+ f"Elements or keys must have the same dtype, but yours have {dtypes}.",
1116
1111
  )
1117
1112
 
1118
1113
  if isinstance(labels[0], dict):
@@ -1513,9 +1508,7 @@ def set_index_dtypes(
1513
1508
  levels = index.names if isinstance(index, pd.MultiIndex) else [index.name]
1514
1509
 
1515
1510
  if len(set(levels)) != len(levels):
1516
- raise ValueError(
1517
- f"Got index with levels " f"{levels}, " f"but names must be unique."
1518
- )
1511
+ raise ValueError(f"Got index with levels {levels}, but names must be unique.")
1519
1512
 
1520
1513
  if not isinstance(dtypes, dict):
1521
1514
  dtypes = {level: dtypes for level in levels}
@@ -1523,11 +1516,7 @@ def set_index_dtypes(
1523
1516
  for name in dtypes:
1524
1517
  if name not in levels:
1525
1518
  raise ValueError(
1526
- f"A level with name "
1527
- f"'{name}' "
1528
- f"does not exist. "
1529
- f"Level names are: "
1530
- f"{levels}."
1519
+ f"A level with name '{name}' does not exist. Level names are: {levels}."
1531
1520
  )
1532
1521
 
1533
1522
  if len(dtypes) == 0: