-
Notifications
You must be signed in to change notification settings - Fork 139
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
Add FieldSet.from_a_grid_dataset() method #1642
Comments
Hi @erikvansebille , I'd like to work on this enhancement. Could you please assign this issue to me? Thank you! |
Thanks @KOMPALALOKESH, for wanting to pick this up! I've assigned this Issue to you. I think the key starting point is to make a new method in parcels/fieldset.py that returns a cls.from_netcdf(), a bit like how It would also be nice to add a unit test to tests/test_fieldset.py. Good luck, and let us know if you need any help! |
@KOMPALALOKESH if you're interested and want more than this issue, "Enable pyupgrade on ruff linting" from #1620 is well defined and might be interesting from a technical standpoint if you haven't worked with Ruff before. Its a nice Python tool, and modern Python is consolidating towards it for handling QAQC. |
@erikvansebille , This PR Link introduces the FieldSet.from_a_grid_dataset() method in "parcels/fieldset.py" to handle A-grid datasets. A corresponding unit test has been added in "tests/test_fieldset.py" to validate this functionality. Please review the changes and the test case. If everything is in order, kindly merge. |
Parcels has specific methods for loading B-grid and C-grid datasets, but not for A-grids. This is because A-grid (linear) interpolation is default, so
FieldSet.from_netcdf()
automatically assumes an A-grid.However, for consistency and to help new users, it might be nice to add an explicit
FieldSet.from_a_grid_dataset()
method to Parcels. This method would then simply callfrom_netcdf()
.Note that while this is done, it might also be good to update a few mentions of
from_bgrid()
andfrom_cgrid()
in the docstrings to the correctfrom_b_grid_dataset()
andfrom_c_grid_dataset()
The text was updated successfully, but these errors were encountered: