Repository navigation
Conversation
LtaStruct becomes the public LtaRaw record (`_raw.py`), and the new registered LtaMetadata holds it and reads, writes and sniffs through it. LtaTransformation and its three views hold a keyword-only, unrepresented `_metadata` behind a public `metadata` property, and no longer declare `struct` or `reverse=False`. The matrix lives in the record: `data` is a cached, read-only view of the record, and setting it stores the matrix in a new record and empties the private `_data`, so that `replace` and `from_instance` carry the record. `to_raw()` returns the held record when neither system was overridden and the record defines both, and builds a new record otherwise. The LTA coordinate systems keep their geometry block in a keyword-only `raw` and are built with `from_raw`. `from_struct`/`to_struct` become `from_raw`/`to_raw`, `from_any` accepts an LtaRaw, and the deprecated `from_` methods are removed. The conformance harness lists LtaTransformation as an exemplar and its views as variants. A per-exemplar `stored` function reads data that lives in the record, and the real `from_fileobj` check applies to binary formats only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M3KmPTJ2CihFMCFaJ4twx8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M3KmPTJ2CihFMCFaJ4twx8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M3KmPTJ2CihFMCFaJ4twx8
#415) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M3KmPTJ2CihFMCFaJ4twx8
Setting the data of an LTA transformation without a record made up a record, whose type and geometries the writer then trusted. A transformation without a record now holds its matrix in the data model, as any affine does, and the writer builds the record from the matrix and the systems. An untouched file is written as the record it was read from, even when the record does not define both systems, so voxel and physical files without geometry blocks round-trip byte for byte again. The error for a record with an empty matrix reports its shape as is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M3KmPTJ2CihFMCFaJ4twx8
This was referenced Oct 10, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M3KmPTJ2CihFMCFaJ4twx8
…rgument (#415) The setters of data no longer drop the cached matrix by hand, since a setter drops its own cache. The metadata invalidates the matrix by name instead of through a setter of its own, the constructor stores data= with store_data_argument, the redundant KwOnly wrapper of _metadata is dropped, and the public methods document their parameters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M3KmPTJ2CihFMCFaJ4twx8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M3KmPTJ2CihFMCFaJ4twx8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M3KmPTJ2CihFMCFaJ4twx8
…er; from_instance keeps only the within-format rule (#415) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M3KmPTJ2CihFMCFaJ4twx8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M3KmPTJ2CihFMCFaJ4twx8
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.
Pass 2a of #415. It is stacked on #419 (pass 1c), which is stacked on #418 and #417. Design: #416 (
docs/design/format-records.md).LTA was the hand-written template for this design, and it now uses the shared vocabulary. The record is
LtaRaw, held by a newLtaMetadata.LtaTransformationreads its matrix and its systems from that record unless they were set on the transformation.What changes
LtaStructbecomesLtaRaw. The modulelta._structbecomeslta._raw, andfrom_struct/to_structbecomefrom_raw/to_rawon the transformation and on the three LTA coordinate systems. The systems'structfield becomes a keyword-onlyraw.LtaMetadata(MetadataFormat)is new and registered, soMetadataFormat.load("x.lta")works. It delegates its reading, writing and sniffing toLtaRaw.LtaTransformation:structfield is removed. The record ismetadata.raw, andmetadatais a keyword-only argument backed by a private field.data/matrixare cached, read-only views of the record. Settingdataon a loaded transformation stores the matrix in a new record, keeping its type and geometry, and replacesmetadata.to_raw()returns the held record when neither the matrix nor the systems were set, so an untouched file of any type, with or without geometry blocks, is written back byte for byte. That also holds throughreplace,from_instanceandio.save. Otherwiseto_raw()builds a new record.reverse=Falseis dropped.LtaStruct.from_andLtaTransformation.from_. Added:from_any(LtaRaw).Visible behaviour changes
LtaStruct→LtaRaw;from_struct/to_struct→from_raw/to_raw;LtaTransformation.struct→metadata.raw;LtaCoordinateSystem.struct→raw; the deprecatedfrom_methods are gone.LtaTransformation().dataisNonerather than an empty array. Writing a transformation that has neither data nor systems raisesUnrepresentableTransformationErrorinstead of writing an invalid record.from_instancefrom another LTA view reads the shared record in the target's own systems.Tests
LtaTransformationand its three views are conformance exemplars: 4 cases × 12 checks.Exemplar.stored, for data that lives in the record. Check 12's stream test now runs for binary formats only, because text formats decode their bytes as text, and text formats are also checked for read mode"rt".Review
Fable reviewed this pass and found one regression: a record was made up for a fresh transformation, which broke untouched VOX/PHYS files without geometry blocks. It is fixed in 3a2078e, which goes back to the original rule. The tensions found are logged in #416.
An existing bug found during this pass is filed separately as #420: the LTA writer keeps only 16 significant digits.
Checks
/tmp, Python 3.8): 5749 passed, 95 skipped, 1 xpassed.ruff check,ruff format --checkand codespell are clean.Part of #415.
🤖 Generated with Claude Code
https://claude.ai/code/session_01M3KmPTJ2CihFMCFaJ4twx8
Generated by Claude Code