Repository navigation
fix(import): refuse native 3-D files on different vertical axes (SP5 item 3) - #159
Merged
Merged
Conversation
The project has one water column, entered on the file's own vertical axis, but vertical_axis was only recorded in provenance, so two files read with different axes shared a surface and floor that meant different things for each. The native import rule that already refuses mixed units now also refuses a file whose vertical_axis differs from the project's (NATIVE_3D_AXIS_MISMATCH, naming both axes and the fix); a missing option counts as z, and flip may still differ. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012btUjvTQTf6i51Rpr3t8Hc
4 tasks done
mbel-tech
marked this pull request as ready for review
October 11, 2026 13:12
mbel-tech
enabled auto-merge
October 11, 2026 13:12
Keeps both CHANGELOG bullets (water column bounds every 3-D metric; refuse mixed vertical axes). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012btUjvTQTf6i51Rpr3t8Hc
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.
What and why
Item 3 of SP5 (finding 7), per the design note (merged in #156, section 4). Independent of #157 and #158.
A native project has one water column (
surface_z,floor_z), entered "on the file's own vertical axis", with a per-sessionflipcompensation.vertical_axiswas only recorded in provenance, so two files read with differentvertical_axisshared a surface and floor that meant different things for each._native_rule), which already refuses mixed units, now also refuses a file whosevertical_axisdiffers from the project's:NATIVE_3D_AXIS_MISMATCH, naming both sessions and both axes, with a remedy ("Add it again with vertical_axis = ..., or add the files to projects of their own"). It applies to a batch with two axes, a file added to a project on another axis, and a session that was just read._ImportFactcarries the axis (from the saved reader options for an entry, from the session'snative_3dattributes for a read session);readers.native3d.ref_vertical_axisandDEFAULT_VERTICAL_AXIS = "z"give the default for a missing option.flipmay still differ.Behaviour to be aware of: the rule runs whenever a session is read, as the unit rule does. An existing project whose files already disagree on the axis is therefore refused with the same message when it is next run, until the files are re-added on one axis. I think that is the right outcome (the alternative is a water column silently meaning two things), but it is a change for any such project; the CHANGELOG says so.
Not detectable: different origins on the same axis (two files calibrated in separate sessions). The Calibration page text for that is part of item 6.
Test plan
New
tests/test_native3d/test_vertical_axis_rule.py(9 tests; 5 failed first, the accept cases already passed): batch with two axes, file vs the project, the defaultz, same axis with different flip accepted, read session on another axis refused and on the same axis accepted, no attributes counts asz, the remedy text, and an existing mixed project.ruff checkpasses.Checklist
ruff checkpassesCHANGELOG.mdentry under[Unreleased]🤖 Generated with Claude Code
https://claude.ai/code/session_012btUjvTQTf6i51Rpr3t8Hc
Generated by Claude Code