Skip to content

Properly unpack 0D data when reading an IDS from a netCDF file - #90

Merged
olivhoenen merged 1 commit into
iterorganization:developfrom
maarten-ic:bugfix/gh89-netcdf-unpack-0d
Jan 5, 2026
Merged

Properly unpack 0D data when reading an IDS from a netCDF file#90
olivhoenen merged 1 commit into
iterorganization:developfrom
maarten-ic:bugfix/gh89-netcdf-unpack-0d

Conversation

@maarten-ic

Copy link
Copy Markdown
Collaborator

0D IDS Data is expected in the native python data types (int, float, complex, string). Before this fix, 0D numerical data would be stored as numpy.int32, numpy.float64 or numpy.complex128 when reading from a netCDF file.

Fixes #89

0D IDS Data is expected in the native python data types (int, float, complex, string). Before this fix, 0D numerical data would be stored as numpy.int32, numpy.float64 or numpy.complex128 when reading from a netCDF file.

Fixes iterorganization#89
@maarten-ic

Copy link
Copy Markdown
Collaborator Author

@timothy-nunn would you be able to test this fix as well?

@olivhoenen

Copy link
Copy Markdown
Collaborator

Is this a follow-up from #57?
I'm a bit confused because I can't reproduce the error with the code snippet from the issue #89 (and I see no difference of behavior between 2.1.0 tag and this bugfix branch)

@maarten-ic

Copy link
Copy Markdown
Collaborator Author

Is this a follow-up from #57?

Yes, it is

I'm a bit confused because I can't reproduce the error with the code snippet from the issue #89 (and I see no difference of behavior between 2.1.0 tag and this bugfix branch)

That's interesting.. I can reproduce the issue on SDCC with IMAS-Python 2.1.0 (module load IMAS-Python). Could you try that as well?

@timothy-nunn

timothy-nunn commented Dec 17, 2025

Copy link
Copy Markdown

Hi @maarten-ic,

I was able to reproduce the error on the latest main (72d7ea3).

This PR fixes the problem and my code snippet now runs with no errors.

Thank you very much for your prompt response and solution to this issue, it is much appreciated!

@olivhoenen

Copy link
Copy Markdown
Collaborator

Is this a follow-up from #57?

Yes, it is

I'm a bit confused because I can't reproduce the error with the code snippet from the issue #89 (and I see no difference of behavior between 2.1.0 tag and this bugfix branch)

That's interesting.. I can reproduce the issue on SDCC with IMAS-Python 2.1.0 (module load IMAS-Python). Could you try that as well?

I thought I did back then, but apparently not carefully enough, sorry for the delay.

@olivhoenen
olivhoenen merged commit 9c56a3e into iterorganization:develop Jan 5, 2026
10 checks passed
@maarten-ic
maarten-ic deleted the bugfix/gh89-netcdf-unpack-0d branch January 5, 2026 14:15
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.

Error when reading wall IDS from DD version 3.42.0 into 4.1.0

3 participants