Add gnarly NetCDF fixtures and tests for CF violation detection#5
Open
lukegre wants to merge 1 commit into
Open
Add gnarly NetCDF fixtures and tests for CF violation detection#5lukegre wants to merge 1 commit into
lukegre wants to merge 1 commit into
Conversation
Eight deliberately broken NetCDF files cover the most realistic failure
modes encountered in the wild:
lat_upside_down.nc — latitude descending 90→-90, no coord attrs
lon_offset_wrong_labels — lon labelled -180→180 with units='degrees_west',
invalid cell_method 'accumulation'
bad_var_names.nc — dims named d0/d1/d2, vars named var1/field_2/X,
no units/standard_name/long_name anywhere
wrong_dim_order.nc — (lon, depth, lat, time) instead of (T,Z,Y,X)
missing_units.nc — numeric vars and all coords missing units,
numeric time with no reference epoch
missing_lon_slices.nc — three persistent NaN longitude bands (0-30°,
150-180°, 330-355°) across all times
bad_time_units.nc — 'parsecs since the Big Bang', bare 'days',
negative-year epoch, calendar='martian'
kitchen_sink.nc — all violations combined in one pathological file
The accompanying test_gnarly_fixtures.py has 50 tests across 8 classes,
exercising HeuristicCheck, OceanCoverCheck, and TimeCoverCheck against
each fixture with precise per-violation assertions.
Also adds !tests/data/*.nc to .gitignore so the binary fixtures are tracked,
and a make_gnarly_fixtures.py script to regenerate them.
https://claude.ai/code/session_01EA1f5cC3TivpMT6xaCt7hk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Eight deliberately broken NetCDF files cover the most realistic failure
modes encountered in the wild:
lat_upside_down.nc — latitude descending 90→-90, no coord attrs
lon_offset_wrong_labels — lon labelled -180→180 with units='degrees_west',
invalid cell_method 'accumulation'
bad_var_names.nc — dims named d0/d1/d2, vars named var1/field_2/X,
no units/standard_name/long_name anywhere
wrong_dim_order.nc — (lon, depth, lat, time) instead of (T,Z,Y,X)
missing_units.nc — numeric vars and all coords missing units,
numeric time with no reference epoch
missing_lon_slices.nc — three persistent NaN longitude bands (0-30°,
150-180°, 330-355°) across all times
bad_time_units.nc — 'parsecs since the Big Bang', bare 'days',
negative-year epoch, calendar='martian'
kitchen_sink.nc — all violations combined in one pathological file
The accompanying test_gnarly_fixtures.py has 50 tests across 8 classes,
exercising HeuristicCheck, OceanCoverCheck, and TimeCoverCheck against
each fixture with precise per-violation assertions.
Also adds !tests/data/*.nc to .gitignore so the binary fixtures are tracked,
and a make_gnarly_fixtures.py script to regenerate them.
https://claude.ai/code/session_01EA1f5cC3TivpMT6xaCt7hk