Skip to content

One name per thing: model for the spec, approximation for the tree - #5

Merged
cekees merged 3 commits into
mainfrom
archive-names
Nov 2, 2026
Merged

cekees merged 3 commits into
mainfrom
archive-names

Conversation

@cekees

@cekees cekees commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Stacked on #4 (which carries #1 and #2). Its own commit is 40d0bcc; merge #1, #2 and #4 first.

PR 4 of the ymf cleanup plan (§ 4.3, names). Decision 3 left approximation or record open. This uses approximation, the name the archive of a spec already gives the tree (outputs[key].approximation). Say so if you want record instead: it is one scripted rename.

What changes

  • Problem: → model: in the text. The archive of a spec already writes model:: it stores the spec under the key the spec uses, which has been model since a66ea1c. The README, archive-format.md and docstrings in closure, archive, cli, xdmf, compose, schema and units still said Problem, and so did three test inputs. Problem: and problem: still fold to model: on read, and a new test pins that.

  • Seven archive-tree functions renamed, so domain means only the region (model.strong_form.domain, ymf.domain):

    before after
    new_domain new_approximation
    validate_domain validate_approximation
    canonicalize_domain canonicalize_approximation
    select_domain select_approximation
    rebase_domain rebase_approximation
    inline_domain inline_approximation
    domain_arrays approximation_arrays

    The old names are the same function objects. They stay in ymf.archive.__all__, and the three that ymf exported are still exported there. They issue no warning, for one release.

  • Not changed. The solver file's domain: key belongs to ymf_archive_version: 2, and parameter names stay as they are. The notebooks still say Problem and move out in the examples PR.

Proteus

Proteus calls all seven functions positionally from Archiver.py, MeshTools.py, cli/ymfrun.py and several tests, so it needs no change in lockstep. A follow-up proteus PR can switch it to the new names after this merges.

Tests

install before (#4, 7f68da3) after
every extra 612 passed, 2 skipped, 1 xfailed 615 passed, 2 skipped, 1 xfailed
ymf[spec] alone 438 passed, 19 skipped, 1 xfailed 441 passed, 19 skipped, 1 xfailed
ymf[units] alone 333 passed, 48 skipped 334 passed, 48 skipped
ymf[symbolic] alone 539 passed, 14 skipped, 1 xfailed 542 passed, 14 skipped, 1 xfailed

The new tests check that the old key reads as model (two cases) and that the old function names are the new functions. In the units-only install the composition tests skip, so it gains one test. The xfail is the composed-domain test that #3 fixes.

🤖 Generated with Claude Code

cekees and others added 3 commits November 1, 2026 23:03
The spec's top-level key has been `model` since a66ea1c, and the archive
of a spec stores the realized spec under the key the spec uses. The README,
the archive guide and several docstrings still showed `Problem:`; they now
say `model:`. `Problem:` and `problem:` still fold to `model:` on read.

The functions that build and check the tree a solver writes were named for
a domain, which is also the region a problem is posed on. They are now
named for an approximation, which is what the archive of a spec already
calls the tree (outputs[key].approximation):

  new_domain           -> new_approximation
  validate_domain      -> validate_approximation
  canonicalize_domain  -> canonicalize_approximation
  select_domain        -> select_approximation
  rebase_domain        -> rebase_approximation
  inline_domain        -> inline_approximation
  domain_arrays        -> approximation_arrays

The old names are the same function objects, exported as before, so
Proteus (which calls all seven positionally) needs no change in lockstep.
The solver file's `domain:` key and the parameter names are unchanged: the
key is part of ymf_archive_version 2.

Tests, before (dead-keys, 7f68da3) -> after:
  every extra        612 passed, 2 skipped, 1 xfailed -> 615, 2, 1
  ymf[spec] alone    438 passed, 19 skipped, 1 xfailed -> 441, 19, 1
  ymf[units] alone   333 passed, 48 skipped            -> 334, 48
  ymf[symbolic] alone 539 passed, 14 skipped, 1 xfailed -> 542, 14, 1
New: the old key still reads as model (two cases), and the old function
names are the new functions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cekees
cekees merged commit 16e4f2d into main Nov 2, 2026
10 checks passed
@cekees
cekees deleted the archive-names branch November 2, 2026 10:08
cekees added a commit that referenced this pull request Nov 2, 2026
ymf cleanup: docs re-shelved, dead schema keys refused, model/approximation naming (#1–#5)
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.

1 participant