2026-05-09 16:30:27 +03:00
|
|
|
# scripts/
|
2025-11-09 04:45:12 +02:00
|
|
|
|
2026-05-09 16:30:27 +03:00
|
|
|
Standalone helper scripts that are not part of the package code and not
|
|
|
|
|
exercised by the test suite. They are run manually during development.
|
2025-11-09 04:07:28 +02:00
|
|
|
|
2026-05-09 16:30:27 +03:00
|
|
|
## Current scripts
|
2025-11-09 04:07:28 +02:00
|
|
|
|
2026-05-09 16:30:27 +03:00
|
|
|
### `coverage.jl`
|
2025-11-09 04:07:28 +02:00
|
|
|
|
2026-05-09 16:30:27 +03:00
|
|
|
Runs the test suite under `--code-coverage=user`, summarises the
|
|
|
|
|
resulting `.cov` files, and writes `coverage/lcov.info` for editor
|
|
|
|
|
gutters and Codecov-style tooling.
|
2025-11-09 04:07:28 +02:00
|
|
|
|
2026-05-09 16:30:27 +03:00
|
|
|
```bash
|
|
|
|
|
# Full pass (re-runs the test suite, ~50 - 60 s).
|
|
|
|
|
julia scripts/coverage.jl
|
2025-11-09 04:07:28 +02:00
|
|
|
|
2026-05-09 16:30:27 +03:00
|
|
|
# Re-summarise the .cov files left behind by a previous run, no tests.
|
|
|
|
|
julia scripts/coverage.jl --summary-only
|
2025-11-09 04:07:28 +02:00
|
|
|
|
2026-05-09 16:30:27 +03:00
|
|
|
# Run the legacy mode in addition (JULIAFEM_ENABLE_LEGACY=1).
|
|
|
|
|
julia scripts/coverage.jl --legacy
|
2025-11-09 04:07:28 +02:00
|
|
|
|
2026-05-09 16:30:27 +03:00
|
|
|
# CI-style threshold gate (exit non-zero when below 95 %).
|
|
|
|
|
julia scripts/coverage.jl --threshold 95
|
2025-11-09 04:07:28 +02:00
|
|
|
|
2026-05-09 16:30:27 +03:00
|
|
|
# Show more files in the per-file breakdown.
|
|
|
|
|
julia scripts/coverage.jl --top 60
|
|
|
|
|
```
|
2025-11-09 04:07:28 +02:00
|
|
|
|
2026-05-09 16:30:27 +03:00
|
|
|
The reporter prints two headline numbers:
|
2025-11-09 04:07:28 +02:00
|
|
|
|
2026-05-09 16:30:27 +03:00
|
|
|
- `Total coverage (all src/)` — covers everything under `src/`,
|
|
|
|
|
including the `src/legacy/` tree that is gated behind
|
|
|
|
|
`JULIAFEM_ENABLE_LEGACY=1`. Default test runs never load the legacy
|
|
|
|
|
module, so its lines always weigh in as 0/N.
|
|
|
|
|
- `Live coverage (excl legacy)` — drops `src/legacy/` from the
|
|
|
|
|
denominator. This is the more meaningful number for the active
|
|
|
|
|
codebase.
|
2025-11-09 04:07:28 +02:00
|
|
|
|
2026-05-09 16:30:27 +03:00
|
|
|
Coverage tooling lives in its own environment at
|
|
|
|
|
`scripts/coverage/Project.toml` (only `Coverage.jl`) so the package's
|
|
|
|
|
runtime and test deps stay clean. The first run instantiates that env
|
|
|
|
|
on demand.
|
2025-11-09 04:07:28 +02:00
|
|
|
|
2026-05-09 16:30:27 +03:00
|
|
|
### `check_layer_contract.jl`
|
2025-11-09 04:07:28 +02:00
|
|
|
|
2026-05-09 16:30:27 +03:00
|
|
|
Static audit for the dependency directions described in
|
|
|
|
|
`docs/src/developer/architecture_layers.md`. Fails if forbidden patterns
|
|
|
|
|
appear under `src/domains/` (layer C) or under layer A directories
|
|
|
|
|
(`topology`, `quadrature`, `geometry`, `basis`, `sparse`). Uses only Base;
|
|
|
|
|
CI runs this on every job.
|
2025-11-09 04:07:28 +02:00
|
|
|
|
|
|
|
|
```bash
|
2026-05-09 16:30:27 +03:00
|
|
|
julia scripts/check_layer_contract.jl
|
2025-11-09 04:07:28 +02:00
|
|
|
```
|
|
|
|
|
|
2026-05-09 16:30:27 +03:00
|
|
|
### `check_namespace_collisions.jl`
|
2025-11-09 04:07:28 +02:00
|
|
|
|
2026-05-09 16:30:27 +03:00
|
|
|
Walks the loaded `JuliaFEM` module and reports symbol-name collisions
|
|
|
|
|
with the standard library and other commonly-used packages. Useful when
|
|
|
|
|
adding new exports or before merging large refactors.
|
2025-11-09 04:07:28 +02:00
|
|
|
|
2026-05-09 16:30:27 +03:00
|
|
|
```bash
|
|
|
|
|
julia --project=. scripts/check_namespace_collisions.jl
|
|
|
|
|
```
|
2025-11-09 04:07:28 +02:00
|
|
|
|
2026-05-09 16:30:27 +03:00
|
|
|
### `fix_vendor_element_types.py`
|
2025-11-09 04:07:28 +02:00
|
|
|
|
2026-05-09 16:30:27 +03:00
|
|
|
One-off cleanup script (Python) for normalising element-type names
|
|
|
|
|
inherited from older vendor packages. Kept for reference; not expected
|
|
|
|
|
to be re-run.
|
2025-11-09 04:07:28 +02:00
|
|
|
|
2026-05-09 16:30:27 +03:00
|
|
|
## Related machinery elsewhere
|
2025-11-09 04:07:28 +02:00
|
|
|
|
2026-05-09 16:30:27 +03:00
|
|
|
The Lagrange basis generator that some older notes refer to as
|
|
|
|
|
`scripts/generate_lagrange_basis.jl` is now an in-tree file under
|
|
|
|
|
`src/basis/`:
|
2025-11-09 04:07:28 +02:00
|
|
|
|
2026-05-09 16:30:27 +03:00
|
|
|
- `src/basis/basis_generator.jl` performs the symbolic generation and
|
|
|
|
|
emits `src/basis/basis_generated.jl`.
|
|
|
|
|
- Run it directly with `julia --project=. src/basis/basis_generator.jl`
|
|
|
|
|
whenever a basis description in `src/basis/basis_descriptions.jl`
|
|
|
|
|
changes.
|
2025-11-09 04:07:28 +02:00
|
|
|
|
2026-05-09 16:30:27 +03:00
|
|
|
MPI regression drivers live under `test/mpi/` (`partitioned_matvec_smoke.jl`,
|
|
|
|
|
`partitioned_matvec_cg.jl`). They expect a throwaway project with `MPI.jl`
|
|
|
|
|
installed; the exact `julia -e '…'` incantation matches
|
|
|
|
|
`.github/workflows/CI.yml` (job `mpi-partitioned-matvec-smoke`).
|
2025-11-09 04:07:28 +02:00
|
|
|
|
2026-05-09 16:30:27 +03:00
|
|
|
See `src/basis/README.md` for the complete design and extension guide.
|