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
Harmonize frequency range parameter #589
Merged
Merged
Changes from 3 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9fe757f
Harmonize frequency range parameter
hoyer-a 017b374
Fix deprecation warning
hoyer-a 707d397
fix failed tests
hoyer-a 7ad65e7
freq-parameter check in erb_frequencies
hoyer-a f44689a
Restructure deprecation warning and freq-range parameter check; add f…
hoyer-a 4c2944e
New approach using decorator function
hoyer-a 94c362f
restructure _rename_arg() for more general use
hoyer-a 8600f30
changes according to f-brinkmann
hoyer-a 73d54b2
remove decorator function from utils.py
hoyer-a 7e61868
changes according to f-brinkmann
hoyer-a File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
IHm, its a bit annoying that we have to change the default behaviour to make the change. It would be better if we could keep
without the default
None
, but that would cause other problems. Any ideas anyone?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.
What about using a decorator to intercept "freq_range" and rename the argument to "frequency_range" and throw a Deprecation warning? If that isn't too error-prone. And we wouldn't really have a "freq_range"-argument anymore.
In that case we wouldn't have to touch the functions at all (apart from changing all freq_range to frequency_range).
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.
I think with fabians and my suggestions, it would already work as expected. No additional funtionallity and the old version would still work.
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.
Wouldn't that throw an error if "frequency_range" is a positional argument and only "freq_range" is passed?
e.g.
with
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.
Yes, the TypeError is the problem I thought about. Should we maybe discuss this in the weekly. The decorator sounds interesting to me, but I'm not sure if Anne has a better soloution in mind.
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.
ahh i see, thank you. this might help: https://stackoverflow.com/questions/74564140/best-practice-to-rename-a-method-parameter-in-a-deployed-python-module
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.
Yeah, that's where i got the idea with the decorator from. Should have mentioned it...
I already have a code snippet based on the stackoverflow question, that i want to try.
Maybe i can show you on friday.
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.
In that case I think you could go straight ahead and implement it :)
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.
Ok, perfect!