-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
xrft.fft
swallows unused kwargs and does not raise a TypeError
#200
Comments
Thanks for raising the issue and idea for a remedy @cgahr . I'll work on it soon :) |
If you are interested, I can also have a look and submit a PR. |
@cgahr Sorry for being slow on this. I'd appreciate a PR very much! :) |
Don't worry! I had a quick look how easy it is to fix. When I run pytest on the current master, however, I get 4 errors and 398 warnings. Should I ignore those or fix those first or what's the best way to proceed? |
Thanks @cgahr ! |
I used the conda env specified in the |
Ah, we should probably update the ci.yml for the Github workflow... Let me see what happens when I run the tests in python 3.12.4 |
I fixed the tests locally, if you want I can add a PR to update to python 3.12 |
I've been working on a PR here: #206 . The tests also passed locally for me but I'm having issues configuring the Github workflow for Python 3.12... |
fix #200: raise TypeError on unused kwargs
If I run
I expect an TypeError to be raised since I used an
kwarg
that does not exist.The bug is caused by lines 377ff:
There, you don't check whether
kwargs
is empty or not.This bug is especially frustrating if you have a typo in a kwarg that DOES exist, like
true_amplitudes
instead oftrue_amplitude
.As far as I can tell, this only happens for
xrft.fft
andxrft.ifft
.TL, DR:
raise a TypeError a la
TypeError: fft() got an unexpected keyword argument 'doesnt_exist'
The text was updated successfully, but these errors were encountered: