-
Notifications
You must be signed in to change notification settings - Fork 260
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
Removes np.nan in output of spatial_filter.py #1292
Conversation
Reviewer's Guide by SourceryThe PR modifies the spatial filtering functionality to handle NaN values by zeroing them out after filtering. This change is implemented by adding a single line of code that multiplies the filtered data with a boolean mask where NaN values are False. No diagrams generated as the changes look simple and do not need a visual representation. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
PR summaryThis Pull Request addresses the issue of SuggestionTo ensure robustness, consider adding a test case to verify that the removal of Disclaimer: This comment was entirely generated using AI. Be aware that the information provided may be incorrect. Current plan usage: 0.00% Have feedback or need help? |
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.
Hey @bjmarfito - I've reviewed your changes - here's some feedback:
Overall Comments:
- The NaN handling could be more explicit - consider using np.nan_to_num() or np.where() instead of boolean multiplication. This would make the intention clearer.
- Please document this behavior change in the function's docstring, explaining what happens to NaN values and why this change was needed.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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 don't get the intention here, this line of change won't do anything, from my simple testing. Could you clarify? and add some inline comment or a new option instead?
Hi @yunjunz, after looking at the code, I found out that adding this line of code does not solve the issue of generating velocity using timeseries2velocity.py after using spatial_filter.py. Need to look in-depth regarding this problem. Closing this PR. |
Description of proposed changes
Removes np.nan when using spatial_filter.py. This is useful to generate velocity using timeseries2velocity.py.
Reminders
Summary by Sourcery
Bug Fixes: