Skip to content

Use h5netcdf as default - #10

Merged
kjnam merged 1 commit into
mainfrom
use-h5netcdf
Aug 6, 2026
Merged

Use h5netcdf as default#10
kjnam merged 1 commit into
mainfrom
use-h5netcdf

Conversation

@kjnam

@kjnam kjnam commented Aug 4, 2026

Copy link
Copy Markdown
Member

NetCDF4 may crash depending on environments due to unsafe threading. This commit makes the code use h5netcdf when it is available for the xarray backend. h5netcdf is known to be safer than netcdf4.

BDS-1212

NetCDF4 may crash depending on environments due to unsafe threading. This
commit makes the code use h5netcdf when it is available for the xarray
backend. h5netcdf is known to be safer than netcdf4.

BDS-1212
@kjnam
kjnam requested a review from aesgeorges August 4, 2026 18:56

@aesgeorges aesgeorges left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

With h5netcdf becoming the new default backend (and netcdf4 being the fallback) we should add h5netcdf in our dependencies in pyproj.toml.

We did not need to specify netcdf4 before as it came packaged with uxarray. With this update however, a user would unknowingly always be using netcdf4 unless they manually installed h5netcdf in their environment, as netcdf4 would always be available and no error would be raised.

@kjnam

kjnam commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

Actually, I did not add the package dependency on purpose because it is optional, only used when it is already installed by the user as you noted. So, it is intended. I do not think netcdf4 is not a required package for xarray, either. I have thought about adding h5netcdf to optional dependencies.
So, it is an intended behavior.

@aesgeorges

Copy link
Copy Markdown
Contributor

That makes sense since this is the expected behavior. Will merge!

@kjnam
kjnam merged commit aca1929 into main Aug 6, 2026
2 checks passed
@kjnam
kjnam deleted the use-h5netcdf branch August 6, 2026 16:12
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.

2 participants