Repository navigation
Conversation
_read_observed_netcdf built ds.to_dataframe() over every lat x lon cell and every variable before dropping missing cells. _valid_cells_frame builds the same frame, with the same rows, order, index, columns, and dtypes, by masking valid cells one variable at a time. It falls back to the original expression for layouts it does not handle. On a 3,000 x 4,000 grid with 20 variables and 30% valid cells it allocates 1.4 GB instead of 4.2 GB and runs in 0.18 s instead of 0.51 s. It returns an exactly equal frame for the bundled global basemap and for a grid with reversed dimension order, float32 values, and NaNs that differ by variable (new test). The NetCDF and CSV parity test passes. The CSV path is unchanged. Co-Authored-By: Claude <noreply@anthropic.com>
This branch has not been deployed
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.
Stacked PR — part of the Demeter v3.0.0 upgrade. Base:
v3/perf-serial-passes. Review and merge in order, bottom of the stack first.Plan items: 2.2
Benchmark: Exact frame equality. Memory 4.2 → 1.4 GB on a 12M-cell grid.
Commits
Read NetCDF basemaps without materializing every grid cell
_read_observed_netcdf built ds.to_dataframe() over every lat x lon
cell and every variable before dropping missing cells.
_valid_cells_frame builds the same frame, with the same rows, order,
index, columns, and dtypes, by masking valid cells one variable at a
time. It falls back to the original expression for layouts it does not
handle.
On a 3,000 x 4,000 grid with 20 variables and 30% valid cells it
allocates 1.4 GB instead of 4.2 GB and runs in 0.18 s instead of 0.51 s.
It returns an exactly equal frame for the bundled global basemap and
for a grid with reversed dimension order, float32 values, and NaNs that
differ by variable (new test).
The NetCDF and CSV parity test passes. The CSV path is unchanged.
🤖 Generated with Claude Code