Skip to content

Tests skip without an extra; one-extra CI legs; tests for three gaps - #2

Merged
cekees merged 2 commits into
mainfrom
extras-guards
Nov 2, 2026
Merged

cekees merged 2 commits into
mainfrom
extras-guards

Conversation

@cekees

@cekees cekees commented Nov 1, 2026

Copy link
Copy Markdown
Owner

PR 2 of the ymf cleanup (C42 step 0). It adds the guards the inventory asked for before any code moves. No module changed. This PR is independent of #1.

Commit 1 (1030bb6): tests skip, not error, without an extra, plus a CI job with one extra per leg. Until now the extras were tested only all or nothing. 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), then 18 failed under them 331 passed, 48 skipped
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 above their importorskip("strictyaml"), or had no such guard.
  • Fifteen tests needed strictyaml or sympy without saying so. The new Fourier assertion branches on sympy: without ymf[symbolic] the notation formula is asserted absent.
  • Two tests opened examples/ relative to the working directory, so they passed only from the repo root.
  • New job one-extra: linux-64 / py3.12, installs the sdist with spec, units or symbolic alone, imports that extra's modules, and runs the suite.

Commit 2 (3ac4e63): tests for the other three gaps.

  • units without symbolic (2 tests). Numbers resolve. Expression and notation formulas are left out. A Neumann condition is reported as "not checked … ymf[symbolic]" rather than failed. The tests hide sympy themselves, so they run in every environment.
  • a domain composed across files (3 tests). Changing the kind in a child is refused, naming the parent's keys. Replacing the region through remove: works and is logged. Found: a child that adds only boundary_tags to its parent's region is refused with "required key(s) 'kind' not found". _partial does not relax a Str() | Map() validator. That test is xfail(strict=True). The four-line fix is ready and keeps 596/596 passing, and it comes as its own PR after this one.
  • classify on a coupled system (4 tests). Cross-diffusion is keyed by the other unknown. A flux that depends on another unknown counts as advection. A squared gradient goes in the Hamiltonian. hamiltonian_gradients moves the pressure gradient out of the flux. An undeclared name is refused.
install after commit 1 after commit 2
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

All runs were local on macOS arm64. The single-extra runs used Python 3.13 venvs with one extra each, and the full run used the petsc-dev env. The new CI job has not run yet, because Actions on this fork has not started a workflow.

🤖 Generated with Claude Code

cekees and others added 2 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>
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