Skip to content

Fix get_netcdf_encoding bug for small datasets#202

Merged
mirzaees merged 3 commits intoopera-adt:mainfrom
scottstanie:fix-netcdf-encoding-chunks
Feb 2, 2026
Merged

Fix get_netcdf_encoding bug for small datasets#202
mirzaees merged 3 commits intoopera-adt:mainfrom
scottstanie:fix-netcdf-encoding-chunks

Conversation

@scottstanie
Copy link
Contributor

  • One comp dict was shared across all variables via encoding = {var: comp for var ...}. When modifying encoding[var]["chunksizes"] for a 2D variable, it mutated the shared dict, affecting all other variables.
  • No chunk capping: chunksizes could exceed actual dimension sizes, causing NetCDF write failures for small datasets.

- One comp dict was shared across all variables via encoding = {var: comp for var ...}. When modifying encoding[var]["chunksizes"] for a 2D variable, it mutated the shared dict,
  affecting all other variables.
- No chunk capping: Chunksizes could exceed actual dimension sizes, causing NetCDF write failures for small datasets.
@alhandwerger
Copy link

I tested this PR and I confirm it fixed the small dataset bug for my test case

Test case
opera-utils disp-s1-download --wkt "POLYGON((-123.5182 40.0462,-123.4253 40.0462,-123.4253 40.0878,-123.5182 40.0878,-123.5182 40.0462))" --frame-id 30713 --output-dir subsets --end-datetime 2018-01-01 --num-workers 4

@scottstanie
Copy link
Contributor Author

i have a fix for tyro >= 1 here: 4b0fbab

@mirzaees
Copy link
Contributor

mirzaees commented Feb 2, 2026

Thank you @scottstanie and @alhandwerger

@mirzaees mirzaees self-requested a review February 2, 2026 22:46
@mirzaees mirzaees merged commit b10b781 into opera-adt:main Feb 2, 2026
1 of 3 checks passed
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.

3 participants