Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Depend on audeer>=1.18.0 #153

Merged
merged 4 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion audinterface/core/feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ def process_folder(
but ``win_dur`` is not set

"""
root = audeer.safe_path(root)
root = audeer.path(root)
if not os.path.exists(root):
raise FileNotFoundError(
errno.ENOENT,
Expand Down
2 changes: 1 addition & 1 deletion audinterface/core/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ def process_folder(
.. _audformat: https://audeering.github.io/audformat/data-format.html

"""
root = audeer.safe_path(root)
root = audeer.path(root)
if not os.path.exists(root):
raise FileNotFoundError(
errno.ENOENT,
Expand Down
2 changes: 1 addition & 1 deletion audinterface/core/segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def process_folder(
.. _audformat: https://audeering.github.io/audformat/data-format.html

"""
root = audeer.safe_path(root)
root = audeer.path(root)
if not os.path.exists(root):
raise FileNotFoundError(
errno.ENOENT,
Expand Down
7 changes: 3 additions & 4 deletions audinterface/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
import numpy as np
import pandas as pd

import audeer
import audformat
import audiofile as af
import audiofile
import audmath
import audresample

Expand Down Expand Up @@ -143,8 +142,8 @@ def read_audio(
else:
duration = end.total_seconds() - offset

signal, sampling_rate = af.read(
audeer.safe_path(file),
signal, sampling_rate = audiofile.read(
file,
always_2d=True,
offset=offset,
duration=duration,
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ classifiers = [
]
requires-python = '>=3.8'
dependencies = [
'audeer >=1.18.0',
'audformat >=1.0.1,<2.0.0',
'audiofile >=1.3.0',
'audmath >=1.3.0',
Expand Down
1 change: 1 addition & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
audeer >=1.21.0
audb
audobject >=0.7.5
pytest
Expand Down
2 changes: 1 addition & 1 deletion tests/test_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,7 @@ def test_feature_with_segment(audio, starts, ends):
files_abs = None
else:
files = [file] * len(audeer.to_list(starts))
files_abs = [audeer.path(root, file) for file in files]
files_abs = [os.path.join(root, file) for file in files]
expected = audformat.segmented_index(files, starts, ends)
expected_folder_index = audformat.segmented_index(files_abs, starts, ends)
expected_signal_index = audinterface.utils.signal_index(starts, ends)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ def test_process_index_filewise_end_times(tmpdir):
# if NaT is forbidden,
# see https://github.com/audeering/audinterface/issues/113

db_root = audeer.mkdir(audeer.path(tmpdir, 'tmp'))
db_root = audeer.mkdir(tmpdir, 'tmp')
sampling_rate = 8000
duration = 2.5225
signal = np.ones((1, int(duration * sampling_rate)))
Expand Down Expand Up @@ -1561,7 +1561,7 @@ def test_process_with_segment(audio, starts, ends):
files_abs = None
else:
files = [file] * len(audeer.to_list(starts))
files_abs = [audeer.path(root, file) for file in files]
files_abs = [os.path.join(root, file) for file in files]
expected = audformat.segmented_index(files, starts, ends)
expected_folder_index = audformat.segmented_index(files_abs, starts, ends)
expected_signal_index = audinterface.utils.signal_index(starts, ends)
Expand Down