-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Refactor: Use NumpySample Type Alias in Function Return Type #181
base: main
Are you sure you want to change the base?
Conversation
@siddharth7113 thanks for picking this up, we have made a few changes now, could you please try to import the NumpySample class again and see if the circular import errors are there? If so it would be good if we addressed those, also there are other files in the same folder of the folder you made this change to where it would be good to add the NumpySample return type |
Sure, I will look into updated branch and check if things are working, also I think there were some issues with |
Hi @Sukh-P , Sorry this took so long, I got sick in between, and hence couldn't update things, but the issue of circular import is still there. |
Hi @Sukh-P , Requesting a review whenever you have time, this has no more conflitcs now, and tests are passing. |
@@ -2,8 +2,10 @@ | |||
|
|||
import numpy as np | |||
|
|||
from ocf_data_sampler.numpy_sample.base import NumpySample |
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.
This should be NumpyBatch
not NumpySample
as the function stacks samples into a batch
@siddharth7113 thanks for the work on this and getting around the circular import error! However I think that moving the base file which was in the sample folder into the numpy sample folder might confuse things a bit, I think that these lines can stay in the numpy_sample directory, but in a file called |
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.
Left a bit of feedback on the folder structure, thanks!
Description
This PR replaces the return type annotation
dict
withNumpySample
in theconvert_gsp_to_numpy_sample
function. This aligns the function signature with the existing type aliasNumpySample
, improving readability and maintainability.= Changes Made
convert_gsp_to_numpy_sample
to returnNumpySample
instead ofdict
Fixes #177
How Has This Been Tested?
This change does not alter functionality but only refines type annotations.
The test suite was executed using
pytest
, and all tests passed successfully.pytest
to ensure no regressionsChecklist: