Repository navigation
Fix: table inputs read floats exactly, keep names as written, NA words stay text, readable errors (F2 F3 F4 F7) - #45
Merged
Merged
Conversation
…dable errors (F2, F3, F4, F7) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN
… float) No existing test edited in this commit. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN
…ns with missing cells are handled like pandas 3 No existing test edited. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN
Contributor
Author
|
Closed: included in #47 (merged with a merge commit, so these commits are in Generated by Claude Code |
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.
Fixes the tables theme of the round-trip findings; their skipped matrix cases and properties now run as normal tests and the findings are removed from
tests/roundtrip_known_failures.py. The table output writer is untouched. Code: new_read_tableinlabconstrictor_tools/convert.py(constantsPANDAS_NA_WORDS,NAN_SPELLINGS,EMPTY_CELL).Before -> after
float_precision="round_trip":0.30000000000000004arrives as itself (was 0.3). Cost: about 2x on very large tables (1M rows x 10 float columns: 5.7 s against 2.7 s); documented inPROTOCOL.md.a,a->["a","a"],,b->["","b"]; beforea.1andUnnamed: 0). The header row is read separately, the body by position and the names put back; a tool addresses such columns by position (documented).file_not_foundnaming the file; an empty or non-UTF-8 file isunreadable_tablewith an instruction to save a UTF-8 CSV with a header row (traceback logged). Before: rawFileNotFoundError,EmptyDataError,UnicodeDecodeError.NA,N/A,null,Nonestay text (a gene calledNA, a statusNone). In a column whose other cells are all numbers they become NaN (a second narrow read).NaN/nan/NANalways mean a missing number: a column of only those spellings (plus empty cells) is float64 NaN, as before. I found and had fixed a regression here before opening this PR: an all-NaNcolumn (what Fiji's ResultsTable, QuPath and numpy/pandas write for an unavailable measurement) had arrived as text.inf/-inf/Infinitycolumns still come out as floats.Tests: new
tests/test_table_input.py(floats, names, errors, NA words, numeric column with NA, header-only table, all-NaN columns in three spellings, all-NaN plus empty, NaN with numbers, a text column holdingnan, an inf column). One existing-test edit:test_roundtrip_known_failures.KnownFailuresDoNotRot.test_the_skip_is_exactly_the_listasserted that an F4 fixture id is a known failure; it now asserts it is not (other fix PRs touch the same line: expect a trivial conflict). Docs:PROTOCOL.mdtable bullet (states the NaN rule in one sentence),AUTHORING.md,REGRESSION_LEDGER.md(rows moved to Fixed; replace "this PR" with this number).Host follow-ups: none for reading (hosts only write CSV and send the path); a host writing a table must write UTF-8 with a header row, empty cells for missing, and a text cell such as "NA" is now kept as text; hosts showing
unreadable_tableorfile_not_foundshould treat them like the image codes.Verified by the author on Linux, Python 3.11: black, ruff, mypy; the full suite before the last change (only the two environmental sandbox failures; run in groups because a single discover run was killed twice in the sandbox) and, after it, 103 table/properties/known-failure/ledger/unused-code tests and the sabotage test. I re-ran lint and the table tests and checked an all-NaN column (float64), an all-NaN-plus-empty column (float64) and a text column with
NA/null(text). Not verified: the full suite and the coverage floor after the last change (CI runs both), Windows, macOS.🤖 Generated with Claude Code
https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN
Generated by Claude Code