Skip to content

Commit

Permalink
Define identity processing function
Browse files Browse the repository at this point in the history
  • Loading branch information
hagenw committed Mar 26, 2024
1 parent 95b9145 commit 6f92932
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 1 addition & 3 deletions audinterface/core/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,7 @@ def __init__(
channels = audeer.to_list(channels)

if process_func is None:

def process_func(signal, _):
return signal
process_func = utils.identity

if resample and sampling_rate is None:
raise ValueError("sampling_rate has to be provided for resample = True.")
Expand Down
5 changes: 5 additions & 0 deletions audinterface/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ def assert_index(obj: pd.Index):
audformat.assert_index(obj)


def identity(signal, sampling_rate):
"""Identity processing function."""
return signal


def is_scalar(value: typing.Any) -> bool:
r"""Check if value is scalar."""
return (value is not None) and (
Expand Down

0 comments on commit 6f92932

Please sign in to comment.