-
-
Notifications
You must be signed in to change notification settings - Fork 8
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: renamed numpy_batch to numpy_sample throughout the codebase #105
base: main
Are you sure you want to change the base?
Conversation
Thanks so much @Tim1119 for doing this and jumping on this so quickly |
You're welcome |
Thank you for the suggestions @felix-e-h-p . I'll implement the changes, refactoring the function into modular helpers as recommended while ensuring the core behavior and tests remain the same. |
Hi @felix-e-h-p and @peterdudfield, happy new year. I've implemented the suggested changes and resolved the issues. Let me know if there's anything else needed or if this is ready to be merged. Thanks |
Thank you, @peterdudfield . That sounds good. I'll wait for @Sukh-P and @dfulu to review it and will address any additional feedback if needed. |
} | ||
|
||
def _key_is_constant(sample_key): | ||
is_constant = sample_key.endswith("t0_idx") or sample_key == NWPSampleKey.channel_names |
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 it is better style to just return this directly rather than to assign to a variable and then return
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 just realised this assignment and return was in the original function. So perhaps don't worry about this in this PR unless you want to leave things cleaner than you found them :)
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.
@Tim1119 thanks for making the the extra effort of addressing this one
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.
@Tim1119 thanks for all this work. There a just a couple of things which I think should be cleaned up, but besides that its all looking good!
} | ||
|
||
def _key_is_constant(sample_key): | ||
is_constant = sample_key.endswith("t0_idx") or sample_key == NWPSampleKey.channel_names |
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 just realised this assignment and return was in the original function. So perhaps don't worry about this in this PR unless you want to leave things cleaner than you found them :)
@peterdudfield when this is merged we must remember to put a issue into PVNet since the change from XBatchKey to XSampleKey will break compatibility |
…icity and consistency
…onvert_gsp_to_numpy_sample
Good day @peterdudfield , I have implemented the changes suggested by @dfulu . Summary of Changes
TestingI ensured that all tests ran successfully before and after making the changes. Review Status:Waiting for review from @Sukh-P |
@Tim1119 thanks for all the additional work. I think its looking really good now. Could you have a look at the merge conflicts and then we should be ready to go 🚀 |
Pull Request
Description
This pull request renames the
numpy_batch
folder tonumpy_sample
because we only deal with samples, not batches. All relevant references and imports have been updated to reflect this change. The modification aligns the naming convention with the actual functionality for better clarity and consistency.Fixes #103
How Has This Been Tested?
Ran unit tests to verify functionality after renaming the directory.
Checked all imports and ensured there were no unresolved references.
Verified that the application runs without errors after the changes.
Yes
The renaming does not change the logic of data processing, but it does ensure the terminology accurately reflects the operations being performed. I have verified that it runs successfully after the changes, ensuring there is no disruption in functionality.
Checklist: