Skip to content

Conversation

xylar
Copy link
Collaborator

@xylar xylar commented Aug 15, 2025

When xarray 2025.08.0 (released recently) opens a file with an empty unlimited Time dimension but no variables with Time, it drops Time as a dimension but keeps it in unlimited_dims. This is probably not an expected behavior but it's easy enough to address by setting unlimited_dims = None if Time is not present.

This merge also switches sort_mesh to use write_netcdf() to avoid this issue. A --format argument has been added that defaults to NETCDF4, which was previously the hard-coded format.

xylar added 3 commits August 15, 2025 12:04
This should hopefully fix an issue with the `Time` dimension.
When xarray 2025.08.0 opens a file with an empty unlimited
Time dimension but no variables with Time, it drops `Time` as a
dimension but keeps it in `unlimited_dims`.  This is probably
not an expected behavior but it's easy enough to address by
setting `unlimited_dims = None` if `Time` is not present.
@xylar
Copy link
Collaborator Author

xylar commented Aug 15, 2025

This issue was caught by CI, so having CI passing will be the the test to make sure this is fixed. But I will also run Polaris workflows with a test build of mpas_tools 1.3.0 before making the release.

@xylar xylar merged commit c5cb444 into MPAS-Dev:master Aug 15, 2025
6 checks passed
@xylar xylar deleted the fix-write-netcdf-without-time branch August 15, 2025 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant