-
-
Notifications
You must be signed in to change notification settings - Fork 225
Fix for calendar_tuple #103
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
Conversation
Thank you for noticing this problem and contributing a fix! I am getting an error when I try applying your fix to
This seems to result from the fact that
Could you add a Thanks for any extra information you can provide — I'd love to get this merged! |
When I insert that print statement I get isinstance(np.int64(32), int) # == True similarly isinstance(np.float64(17.0), float) # == True What version of numpy are you using? I can test with that specific version to see if I get the same results. On a related note, is there a way to get |
If the test fails then stdout is printed — so adding a line like |
Okay, I am back at my development machine so we can investigate further. I am using a slightly later version of NumPy with Python 3.5.1:
I wonder if this is a known or open issue, or whether it’s not always guaranteed that NumPy types are subclasses of things like |
Ah, perhaps some more information: |
Also added _to_array to protect routine against failure when called with Python scalar.
Okay, great. I think I can just change the tests to be for |
Alright. I've rebased and committed those changes. It works at my end, hopefully it works for you too! |
Thank you for the great work! Your fix is absolutely correct, and your test is complete and easy to read. |
This pull request is a fix for #102.
I've also added some unit tests to check the conversion of calendar_tuple/julian_date, and wrapped the input of calendar_tuple in a
_to_array
call to stop it failing if called with a Python scalar argument.