-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add per execution process_func_args argument #157
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this feature and the extensive new tests.
Looks good to me.
# figure out if special arguments | ||
# to pass to the processing function | ||
signature = inspect.signature(process_func) | ||
process_func_args = process_func_args or {} | ||
self._process_func_special_args = { | ||
'idx': False, | ||
'root': False, | ||
'file': False, | ||
} | ||
for key in self._process_func_special_args: | ||
if ( | ||
key in signature.parameters | ||
and key not in process_func_args | ||
): | ||
self._process_func_special_args[key] = True | ||
self._process_func_signature = signature.parameters | ||
r"""Arguments present in processing function.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are curious, I think this might be the only change in audinterface
1.2.0, that touches attributes of the objects.
Closes #156
This adds a
process_func_args
argument to all the processing methods, e.g.audinterface.Process.process_index()
.It can be used to overwrite the
process_func_args
argument used during instantiation of the interface.Example:
returns
It will not overwrite the content of the class attribute
interface.process_func_args
, which will always only store the global setting.Example docstring: