-
Notifications
You must be signed in to change notification settings - Fork 61
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
Fix/solar zenith time cast #2098
Fix/solar zenith time cast #2098
Conversation
The cast() function in the cosine_of_solar_zenith_angle function had incorrect argument order, placing the np.ndarray type before the value to cast. This fixes the order to cast(time.values, np.ndarray) to correctly type-cast the CFTime values before converting to seconds.
Add name to AUTHORS.rst as per contribution guidelines.
Welcome, new contributor! It appears that this is your first Pull Request. To give credit where it's due, we ask that you add your information to the
Please make sure you've read our contributing guide. We look forward to reviewing your Pull Request shortly ✨ |
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.
Looks good to me!
Weird that we didn't stumble on this bug earlier, it simply doesn't work with cftime objects!
@jack-ktw I allowed myself to add a test that would have detected the issue. |
Pull Request Checklist:
2097
) and pull request (:pull:2098
) has been addedWhat kind of change does this PR introduce?
Bug fix: Correct parameter order in typing.cast() causing intermittent errors in solar_zenith_angle calculation
Does this PR introduce a breaking change?
No
Other information:
his fix corrects a parameter ordering issue in the typing.cast() function call which was causing intermittent errors when processing multiple climate datasets in parallel. The fix is minimal and simply swaps the parameters to match the correct typing.cast(type, value) signature.