Skip to content
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

Use a temporary file for Zarr group JSON #135

Merged
merged 1 commit into from
Sep 14, 2023
Merged

Use a temporary file for Zarr group JSON #135

merged 1 commit into from
Sep 14, 2023

Conversation

markgoddard
Copy link

When using multiple netCDF files with the same names, the Zarr group
JSON file would previously not be overwritten after it was first
written. This would lead to subsequent uses potentially using an invalid
Zarr group metadata file.

This change switches to use a temporary file to store the Zarr group
metadata. This should not be a problem because the Zarr datasource is
cached in the Active object as the _zds member between operations.

Closes #134

When using multiple netCDF files with the same names, the Zarr group
JSON file would previously not be overwritten after it was first
written. This would lead to subsequent uses potentially using an invalid
Zarr group metadata file.

This change switches to use a temporary file to store the Zarr group
metadata.  This should not be a problem because the Zarr datasource is
cached in the Active object as the _zds member between operations.

Closes #134
@markgoddard markgoddard self-assigned this Aug 15, 2023
@codecov
Copy link

codecov bot commented Aug 15, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.10% 🎉

Comparison is base (8adf0f0) 86.53% compared to head (4ed6003) 86.63%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #135      +/-   ##
==========================================
+ Coverage   86.53%   86.63%   +0.10%     
==========================================
  Files           8        8              
  Lines         594      591       -3     
==========================================
- Hits          514      512       -2     
+ Misses         80       79       -1     
Files Changed Coverage Δ
activestorage/netcdf_to_zarr.py 86.95% <100.00%> (+1.24%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@valeriupredoi valeriupredoi 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 cleanup, thanks a lot @markgoddard 🍺

@valeriupredoi valeriupredoi merged commit 883383f into main Sep 14, 2023
@valeriupredoi valeriupredoi deleted the issues/134 branch September 14, 2023 13:31
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.

Zarr group JSON file issues
2 participants