Skip to content

A file in an extends chain may tag its parent's region without restating its kind - #3

Merged
cekees merged 3 commits into
mainfrom
partial-domain
Nov 2, 2026
Merged

cekees merged 3 commits into
mainfrom
partial-domain

Conversation

@cekees

@cekees cekees commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Stacked on #2. This PR's own commit is the last one, A file in an extends chain may tag…. The two commits before it belong to #2, so merge #2 first.

A child file that only adds boundary_tags to the region its model states was refused with "required key(s) 'kind' not found". _partial relaxes the schema for the files of an extends chain. It descended into mappings and lists of mappings, but not into an alternative. The domain is Str() | Map(...), so its mapping kept kind required in every file. Both sides of an alternative are now relaxed. The composed domain is still checked against its kind by ymf.domain.validate_domain_block.

What else this touches. Walking YMF_SCHEMA finds three alternatives that hold a mapping: unknowns[], strong_form.domain and coefficients.*. _partial reaches only the domain, because it does not descend into a list of alternatives or a pattern map. So only one place in the schema changes.

suite before after
every extra (petsc-dev env) 604 passed, 2 skipped, 1 xfailed 605 passed, 2 skipped
ymf[spec] alone 430 passed, 19 skipped, 1 xfailed 431 passed, 19 skipped
ymf[symbolic] alone 531 passed, 14 skipped, 1 xfailed 532 passed, 14 skipped

The strict xfail that #2 put on test_a_child_may_tag_the_region_its_parent_states comes off. All runs were local on macOS arm64. CI has not run on the fork yet.

🤖 Generated with Claude Code

cekees and others added 3 commits November 1, 2026 20:53
The extras were tested only all-or-nothing: the core smoke test, then every
extra at once. Installing one extra alone shows what that hid:

| install          | before                              | after                  |
|------------------|-------------------------------------|------------------------|
| ymf[spec]        | 427 passed, 20 skipped              | 428 passed, 19 skipped |
| ymf[units]       | 7 collection errors (run aborted)   | 331 passed, 48 skipped |
|                  | then 18 failed under them           |                        |
| ymf[symbolic]    | 1 failed (run from tests/)          | 525 passed, 14 skipped |
| every extra      | 596 passed, 2 skipped               | 596 passed, 2 skipped  |

- Seven files imported ymf.schema (strictyaml) above their importorskip,
  or had none: test_compose, test_domain, test_examples, test_references,
  test_removal, test_schema, test_values. The guard now comes first.
- Fifteen tests needed strictyaml or sympy and did not say so: the closure
  tests (one guard in their spec helper), the old-private-name alias test,
  the notebook round trip, three units tests. The Fourier number is in the
  spec notation, so without ymf[symbolic] it is asserted absent, not
  skipped.
- Two tests opened examples/ relative to the working directory, so they
  passed only from the repo root; they use their own path like the rest.
- A one-extra job, linux-64 / py3.12, for spec, units and symbolic: install
  the sdist with that extra alone, import its modules, run the suite.

No module changed. Measured on macOS arm64 with python 3.13 venvs holding
one extra each, and the petsc-dev env for every extra.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sify

The cleanup inventory listed four gaps to guard before any code moves; the
previous commit is the first (one-extra CI legs). These are the other three.

- units without ymf[symbolic] (test_units, 2 tests). problem-specification
  promises that a bare ymf[units] install still sees the coefficients that
  are already numbers. Nothing tested it. The tests hide sympy and
  ymf.symbolic, so the fallback is checked in every environment, and the
  units-only leg runs them for real: numbers and quoted numbers resolve,
  expression and notation formulas are left out, and a neumann condition
  is reported "not checked ... ymf[symbolic]" under missing_units="error"
  rather than failed.
- a domain composed across files (test_domain, 3 tests). Changing the kind
  in a child is refused, naming the parent's keys; replacing the region
  through remove: works and is logged. Adding boundary_tags in a child to
  the parent's region is refused today ("required key(s) 'kind' not
  found"): _partial does not relax a Str() | Map() validator. That test is
  xfail(strict=True) until the fix, a separate PR.
- classify on a coupled system (test_symbolic, 4 tests): cross-diffusion is
  keyed by the other unknown, a flux that depends on another unknown is
  advection, |grad phi|^2 is Hamiltonian, hamiltonian_gradients moves grad p
  out of the flux, and an undeclared name is refused. The two-phase model
  family builds on this step.

| install       | before (previous commit) | after                              |
|---------------|--------------------------|------------------------------------|
| every extra   | 596 passed, 2 skipped    | 604 passed, 2 skipped, 1 xfailed   |
| ymf[spec]     | 428 passed, 19 skipped   | 430 passed, 19 skipped, 1 xfailed  |
| ymf[units]    | 331 passed, 48 skipped   | 333 passed, 48 skipped             |
| ymf[symbolic] | 525 passed, 14 skipped   | 531 passed, 14 skipped, 1 xfailed  |

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A child that only adds boundary_tags to the region its model states was
refused: "required key(s) 'kind' not found". _partial, which relaxes the
schema for the files of a chain, descended into mappings and lists of
mappings but not into an alternative, and the domain is Str() | Map(...),
so its mapping kept `kind` required in every file. Both sides of an
alternative are now relaxed; the composed domain is still checked against
its kind by ymf.domain.validate_domain_block, as before.

Blast radius, walked over YMF_SCHEMA: three alternatives hold a mapping
(unknowns[], strong_form.domain, coefficients.*), and _partial reaches only
the domain (it does not descend a Seq of alternatives or a MapPattern). So
this changes one site.

| suite                         | before                            | after                  |
|-------------------------------|-----------------------------------|------------------------|
| every extra (petsc-dev)       | 604 passed, 2 skipped, 1 xfailed  | 605 passed, 2 skipped  |
| ymf[spec] alone               | 430 passed, 19 skipped, 1 xfailed | 431 passed, 19 skipped |
| ymf[symbolic] alone           | 531 passed, 14 skipped, 1 xfailed | 532 passed, 14 skipped |

The xfail(strict=True) on test_a_child_may_tag_the_region_its_parent_states
comes off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cekees
cekees merged commit 9c0b7ea into main Nov 2, 2026
10 checks passed
@cekees
cekees deleted the partial-domain branch November 2, 2026 09:54
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