Repository navigation
fix(parser): re-emit bar/fill file references instead of corrupting them - #25
Merged
Merged
Conversation
Adding test coverage for the recognizer-only FileSeries 'bar'/'fill' variants (produced when a bar/fill dataset's data file can't be resolved) surfaced that the writer had no dispatch for them: 'bar' silently degraded into a plain colored dataset, dropping the bar entirely, and 'fill' raised a KeyError (it has y1_col/y2_col, not y_col) on any re-save. Add add_bar_from_file/add_fill_from_file to re-emit the original data/bar/fill shape verbatim, matching how the line/errorbar variants already behave. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
FileSeriesvariants (series_type"bar"and"fill"), produced byparser/recognizer.pywhen a.glefile'sbar/filldataset references an external data file that can't be resolved. These had zero test coverage since the G1.1 typed-series refactor.Figure._write_axes_content, so on re-save:"fill"raisedKeyError: 'y_col'(it carriesy1_col/y2_col, noty_col) — any recovered figure with a broken fill reference crashed onsavefig."bar"silently fell through to the generic errorbar path, dropping thebarcommand and degrading a bar chart into a plain colored dataset.GLEWriter.add_bar_from_fileandGLEWriter.add_fill_from_file, which re-emit the originaldata/bar/fillGLE shape verbatim (consistent with how the existing"line"/"errorbar"variants already behave — GLE still fails to compile due to the missing file, but that's an honest, expected failure rather than gleplot corrupting the model).Test plan
test_broken_bar_becomes_file_series_with_errorandtest_broken_fill_becomes_file_series_with_errorintests/parser/test_recognizer.py: construct a fixture, delete the backing.dat, assert the exact recognizedFileSeriesfield set, and verify a two-cycle parse/save fixed-point round trip.pytest tests/→ 2085 passed, 2 skipped.black --checkclean on changed files.🤖 Generated with Claude Code