Repository navigation
Find a block's rows by name, and load an authoring document built in code or unplaced - #68
Conversation
Each table block of a SystemDefinition is Rows, an AbstractVector that also takes a row's name: system.points[:kite]. load_authoring takes a parsed authoring document as well as a path, and returns its transforms as Rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Similar to NamedCollection in SymAWE right? And the name is a symbol for efficiency? |
|
Also merge in latest main |
# Conflicts: # CHANGELOG.md # test/test-structure.jl
|
Same role as NamedCollection, yes: index by position or by name. But it keeps no name index. A row's name stays the String awesIO gives it, and a Symbol or String is matched against it by a linear scan. Rows are mutable and can be pushed, deleted or renamed, so a cached Dict would go stale, and lookup by name is a setup-time call (SAM's hot paths use indices). If you want NamedCollection's Dict{Symbol,Int}, it needs rebuilding on every push!/insert!/deleteat! and on a rename; say so and I'll add it. |
|
Merged latest main in a4de2a8. The two conflicts, CHANGELOG and test-structure, were independent additions, so I kept both. KiteGeometry suite 841/841. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A row's name, a transform's name and a reference by name (NameRef) are Symbols. Documents and keyword constructors still take strings; writing a document writes strings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Make sure duplicate names error correctly |
A tool reading a definition mostly knows its components by name: the kite point, the main tether, the wing. Until now a block was a plain vector, so finding one meant a search over its rows each time. Each block now also takes a row's name, and
load_authoringreturns its transforms the same way. Lookup by position works as before.load_authoringalso takes an authoring document already parsed into a dictionary, beside a path to one. SymbolicAWEModels builds systems in code from rows, and it can now hand them to this loader. Tether expansion, wing mass, the design pose and placement then have one implementation, this one, rather than a second in SymbolicAWEModels.load_authoring(...; place=false)returns the definition in its design pose: authored positions, tethers at their design length, no transform applied. SymbolicAWEModels builds its wings' aerodynamic meshes in the authored frame and places the structure itself, as it did before reading YAML through this loader. Built from the placed definition, the mesh and the structure only line up to rounding, and a mirror-symmetric kite then splits its panels between stations unevenly.All three are additions: a block is still an
AbstractVectorof its rows and compares equal to a vector of the same rows, and the path method is unchanged. A lookup by a name no row has throws aKeyError.OpenSourceAWE/SymbolicAWEModels.jl#421 builds on this: its tests read
sys.points[:name]on almost 400 lines, and its in-code builder needs the dictionary method. It needs a release of this after v0.3.1.Verification
Rowsand the dictionary method do not existdocs/make.jl)_structure.jlregenerated bysrc/build.jl, no hand editsreuseis not installed on this machineVector, e.g. by dispatching onVector{Point}, no longer matches;AbstractVectormethods are unaffected.Opened by
1-Bort-1, an AI agent working for @1-Bart-1.From OpenSourceAWE/SymbolicAWEModels.jl#421 · task
SymbolicAWEModels.jl-421