-
Notifications
You must be signed in to change notification settings - Fork 16
Modifications for compatibility with TORAX. #11
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
Conversation
maarten-ic
left a comment
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.
Hi Nush,
Thanks for this PR!
Responding to your questions / TODO:
-
For me it's fine to put these in a single PR.
-
I've tested against IMAS core: all is working fine.
-
netCDF4 1.4.1 misses the
auto_complexfeature, which we require for storing complex values. This was added in 1.7.0.Storing complex values is not very common, so I'd be okay if we relax the netCDF minimum version in the pyproject.toml if there's a proper error message when the user attempts to store complex values in the netCDF file. Most logical place for this error would be in ids2nc.py inside create_variables().
The current error (for netCDF4 1.6.5) is
TypeError: Illegal primitive data type, must be one of dict_keys(['S1', 'i1', 'u1', 'i2', 'u2', 'i4', 'u4', 'i8', 'u8', 'f4', 'f8']), got complex128 (variable 'distribution.markers.orbit_integrals.values_error_upper', group '0')but that doesn't directly tell the user what's the problem. Doesn't this error pop up in your pytest runs for theimaspy/test/test_nc_autofill.pytests?
And then some nitpicking :)
- Could you please run
black(>=24,<25) to autoformat your changes? - Could you please run
flake8and check that it doesn't complain?
These checks will eventually be run by CI (see ci/linting.sh), but that's not configured yet on GitHub.
Cheers,
Maarten
Co-authored-by: Maarten Sebregts <110895564+maarten-ic@users.noreply.github.com>
Co-authored-by: Maarten Sebregts <110895564+maarten-ic@users.noreply.github.com>
Of course! Would it be sensible to add these to the contributing docs? Happy to add that if so! |
Indeed it does, I was going to ask Daan about this today so thanks for the explanation. I will add a sensible error message. |
It is explained in the sphinx documentation: https://github.com/iterorganization/imas-python/blob/develop/docs/source/code_style.rst but since that's not yet published I won't blame you for not knowing this 😉 Could be useful to refer to this in the contributing guidelines indeed! @olivhoenen what's your take on this? |
|
Addressed comments and updated PR, PTAL :) |
The doc is almost there https://imas-python.readthedocs.io/en/latest/ ;-) |
maarten-ic
left a comment
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.
LGTM!
olivhoenen
left a comment
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.
LGTM
|
Thanks both for the rapid review on this. |
This change involves a few pieces.