Skip to content

Build Metadata by keyword, with defaults for the fields a writer does not choose - #58

Merged
1-Bart-1 merged 3 commits into
mainfrom
agent/KiteModels.jl-322
Oct 19, 2026
Merged

1-Bart-1 merged 3 commits into
mainfrom
agent/KiteModels.jl-322

Conversation

@1-Bort-1

Copy link
Copy Markdown
Member

A package that builds a system definition from its own model has to fill the definition's metadata. Until now that meant passing all seven fields in order, including two empty strings, the schema file name and the awesIO version. The version was read from a constant this package does not export. A reviewer of such a call cannot tell which string is which. Now the metadata can be built from a name and a point count, and every other field can be given by name. The description and note default to empty, the version to the one this package reads, the schema to the structure schema, and the connectivity checksum to empty, which stands for one not yet computed.

Metadata(name, "", "", KiteGeometry.AWESIO_VERSION, "structure_schema.yml", n, "")  # before
Metadata(; name, n_points=n)                                                        # after

The package's own authoring path and its tests now use it. Nothing that already calls the positional form changes.

It does not compute the connectivity checksum for the caller. A writer that wants one still builds the definition, takes its checksum, and passes it in by name. That second half of #49 is left open.

OpenSourceAWE/KiteModels.jl#327 uses this to build the metadata of the KPS3 and KPS4 definitions. It needs a release carrying this change, so this merges and is released first, as v0.2.1.

Verification

  • Reproduced first against v0.2.0: MethodError: no method matching Metadata(; name::String, n_points::Int64), from Build a KiteGeometry SystemDefinition from KPS3 and KPS4 and carry it in the log KiteModels.jl#327's definition test.
  • test/test-structure.jl asserts the keyword form equals the positional one with the defaults. Suite on this branch, on top of v0.2.0: Authoring 431, Log 2, Structure 149, all pass (Julia 1.13.0, test project).
  • Docs build clean (docs/make.jl; the only warnings are the existing size warning on the structure page and the skipped deploy).
  • Risk: none beyond a new method on an exported type; the positional constructor is unchanged.

Refs #49

🤖 Generated with Claude Code

1-Bort-1 and others added 2 commits October 15, 2026 14:41
A writer building a SystemDefinition from a model had to pass all seven
Metadata fields positionally and read the non-public AWESIO_VERSION.
The keyword constructor names each field and defaults the four a writer
does not choose. The authoring path and the tests use it.

Refs #49

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

1-Bort-1 added a commit to OpenSourceAWE/KiteModels.jl that referenced this pull request Oct 19, 2026
OpenSourceAWE/KiteGeometry.jl#58 conflicted with KiteGeometry main after
v0.3.0; its branch now merges main (ea27241). Point [sources] at that
commit and raise compat to 0.3. The manifests move only the KiteGeometry
entry and project_hash.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@1-Bart-1
1-Bart-1 merged commit ff79d7a into main Oct 19, 2026
4 checks passed
@1-Bart-1
1-Bart-1 deleted the agent/KiteModels.jl-322 branch October 19, 2026 10:56
1-Bort-1 added a commit to OpenSourceAWE/KiteModels.jl that referenced this pull request Oct 22, 2026
OpenSourceAWE/KiteGeometry.jl#58 (the keyword Metadata constructor) is
released in 0.3.1, so the [sources] pin to ea27241 goes. The bound is
0.3.2: that release makes row names Symbols, which the test now asserts.
Both default manifests move only the KiteGeometry entry and project_hash;
the 1.13 one keeps main's Julia 1.13.2 standard-library entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants