Skip to content

Commit

Permalink
Remove deprecated kwargs for process_func_args
Browse files Browse the repository at this point in the history
  • Loading branch information
hagenw committed Jun 24, 2022
1 parent 52551b1 commit 301b647
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 70 deletions.
10 changes: 0 additions & 10 deletions audinterface/core/feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,16 +177,6 @@ def add_unit(dur, unit):
hop_dur = add_unit(hop_dur, unit)
# ------

process_func_args = process_func_args or {}
if kwargs:
warnings.warn(
utils.kwargs_deprecation_warning,
category=UserWarning,
stacklevel=2,
)
for key, value in kwargs.items():
process_func_args[key] = value

if win_dur is None and hop_dur is not None:
raise ValueError(
"You have to specify 'win_dur' if 'hop_dur' is given."
Expand Down
24 changes: 2 additions & 22 deletions audinterface/core/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ def __init__(
num_workers: typing.Optional[int] = 1,
multiprocessing: bool = False,
verbose: bool = False,
**kwargs,
):
if resample and sampling_rate is None:
raise ValueError(
Expand Down Expand Up @@ -125,16 +124,7 @@ def process_func(signal, _):
r"""Processing function."""
self.process_func_is_mono = process_func_is_mono
r"""Process channels individually."""
process_func_args = process_func_args or {}
if kwargs:
warnings.warn(
utils.kwargs_deprecation_warning,
category=UserWarning,
stacklevel=2,
)
for key, value in kwargs.items():
process_func_args[key] = value
self.process_func_args = process_func_args
self.process_func_args = process_func_args or {}
r"""Additional keyword arguments to processing function."""

def _process_file(
Expand Down Expand Up @@ -721,7 +711,6 @@ def __init__(
channels: typing.Union[int, typing.Sequence[int]] = None,
mixdown: bool = False,
verbose: bool = False,
**kwargs,
):
if resample and sampling_rate is None:
raise ValueError(
Expand All @@ -744,16 +733,7 @@ def process_func(signal, _, starts, ends):
]
self.process_func = process_func
r"""Process function."""
process_func_args = process_func_args or {}
if kwargs:
warnings.warn(
utils.kwargs_deprecation_warning,
category=UserWarning,
stacklevel=2,
)
for key, value in kwargs.items():
process_func_args[key] = value
self.process_func_args = process_func_args
self.process_func_args = process_func_args or {}
r"""Additional keyword arguments to processing function."""

def process_index(
Expand Down
11 changes: 0 additions & 11 deletions audinterface/core/segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,18 +185,7 @@ def __init__(
num_workers: typing.Optional[int] = 1,
multiprocessing: bool = False,
verbose: bool = False,
**kwargs,
):
process_func_args = process_func_args or {}
if kwargs:
warnings.warn(
utils.kwargs_deprecation_warning,
category=UserWarning,
stacklevel=2,
)
for key, value in kwargs.items():
process_func_args[key] = value

self.invert = invert
r"""Invert segmentation."""

Expand Down
7 changes: 0 additions & 7 deletions tests/test_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,13 +387,6 @@ def process_func(s, sr, arg1, arg2):
'arg2': 'bar',
}
)
with pytest.warns(UserWarning):
audinterface.Feature(
feature_names=('o1', 'o2', 'o3'),
process_func=process_func,
arg1='foo',
arg2='bar',
)


@pytest.mark.parametrize(
Expand Down
7 changes: 0 additions & 7 deletions tests/test_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,13 +530,6 @@ def process_func(s, sr, arg1, arg2):
'arg2': 'bar',
}
)
with pytest.warns(UserWarning):
audinterface.Process(
feature_names=('o1', 'o2', 'o3'),
process_func=process_func,
arg1='foo',
arg2='bar',
)


@pytest.mark.parametrize(
Expand Down
7 changes: 0 additions & 7 deletions tests/test_process_with_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@ def process_func(s, sr, starts, ends, arg1, arg2):
'arg2': 'bar',
}
)
with pytest.warns(UserWarning):
audinterface.ProcessWithContext(
feature_names=('o1', 'o2', 'o3'),
process_func=process_func,
arg1='foo',
arg2='bar',
)


def test_process_index(tmpdir):
Expand Down
6 changes: 0 additions & 6 deletions tests/test_segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,6 @@ def segment_func(s, sr, arg1, arg2):
'arg2': 'bar',
}
)
with pytest.warns(UserWarning):
audinterface.Segment(
process_func=segment_func,
arg1='foo',
arg2='bar',
)


@pytest.mark.parametrize(
Expand Down

0 comments on commit 301b647

Please sign in to comment.