Skip to content

Conversation

@maarten-ic
Copy link
Collaborator

This Pull Request implements the following improvements for the netCDF backend:

  1. Automatic DD version conversion on get(). This has the same limitations as the automatic conversion using imas_core, as outlined in the documentation.
    N.B. automatic conversion during put() is still not supported, since this is rarely needed and easily worked around.
  2. Lazy loading: only load data from the netCDF file when it is accessed by users.
  3. Minor performance improvement: skip the IDSPrimitive.value.setter logic when loading data from a netCDF file (the same optimization was already in place for reading from an imas_core backend).

…y instead of a python scalar (`int` or `float`)
Copy link
Collaborator

@DaanVanVugt DaanVanVugt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice, this will be useful

Copy link
Collaborator

@olivhoenen olivhoenen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @maarten-ic , both the lazy loading and conversion (test on _tor-->_phi) are working like a charm!

Could you maybe mention these briefly in the example for netcdf in the doc?

# This one is valid:
NC2IDS(memfile, factory.core_profiles()).run()
ids = factory.core_profiles()
NC2IDS(memfile, ids, ids.metadata, None).run()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the run method need a Boolean (lazy) parameter?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, fixed that now. Also created #18, could you have a look at that?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will update the GitHub actions : #18

@maarten-ic
Copy link
Collaborator Author

Could you maybe mention these briefly in the example for netcdf in the doc?

Good suggestion! I've added a table with supported (and unsupported) features with links to the sections with further details. Please check if this works for you :)

Copy link
Collaborator

@olivhoenen olivhoenen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@prasad-sawantdesai prasad-sawantdesai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@maarten-ic maarten-ic merged commit ee230cc into iterorganization:develop Feb 10, 2025
@maarten-ic maarten-ic deleted the feature/lazy-load-from-netcdf branch February 10, 2025 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants