methodcard
The math of each numerical method, declared once and shown in its docs and tests.
A class (with the NumericalMethod mixin) or a function (with the
@method decorator) declares its equations, order of accuracy,
assumptions and references, next to the code:
from methodcard import NumericalMethod
class Drift(Propagator, NumericalMethod):
"""Advance positions at fixed velocity."""
equations = {"update": r"x^{n+1} = x^n + v^n \Delta t"}
assumptions = ("velocity constant over the step",)
- Jupyter and terminal: a method renders its card in a notebook;
describe()prints it. - Docs: a griffe extension adds a “Numerics” section to each
method’s API page, and
methodcard exportgives the catalogue of the shared starlight-theme (defineDocs({ methodcard: true })), both without importing the code. - Tests:
TestMethodCards = method_suite("mypackage")checks every card: SymPy rules against the implementation, observed against declared orders, and the docs against the runtime.
Documentation: https://max-models.github.io/methodcard/
Install
pip install methodcard # or methodcard[symbolic] for the SymPy checks
For development, with uv:
make install # uv sync --extra dev, plus the pre-commit hooks
Development
Formatting and linting use ruff, type checking pyright, run by pre-commit and in CI:
make lint # ruff check, ruff format --check, pyright
make test # pytest with coverage
Commit messages follow Conventional Commits; see CONTRIBUTING.md.
Build docs
The documentation in docs/ is an Astro + Starlight site: hand-written
pages, the notebooks in tutorials/ executed and published as pages,
and the API reference generated from the docstrings with
starlight-pydocs. It needs
Node 22 or newer.
make docs-install # npm packages and the Python docs extra
make docs-notebooks # execute tutorials/*.ipynb and convert them to pages
make docs-dev # live preview at http://localhost:4321/methodcard/
make docs-build # the static site in docs/dist
Build the README
README.md is rendered from README.qmd with
Quarto:
make readme
Releases
Before merging a release to main, update the version in
pyproject.toml, src/methodcard/__init__.py and CITATION.cff
(including its release date), and add the release notes to
CHANGELOG.md. The push to main creates a GitHub release with a
vX.Y.Z tag and publishes the package to PyPI with trusted publishing
(OIDC). The one-time PyPI and GitHub configuration is described in the
publishing
tutorial.
Metadata
Release files for methodcard 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| methodcard-0.1.0.tar.gz | 27.1 kB | With provenance | Details for methodcard-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| methodcard-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for methodcard-0.1.0-py3-none-any.whl |
Total release size: 59.2 kB
Release files / methodcard-0.1.0.tar.gz
| Download URL | methodcard-0.1.0.tar.gz |
|---|---|
| Size | 27.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8a28d2149e4cbb46e171e6fc8de277c4701e1d64bd98c5ed330c2c7b125e41e9
|
|
BLAKE2b-256 checksum How to use checksums |
4435fb05b1d51efde8cdc19695df673d92f67819f53f06b68da55ca99cd4c039
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logRelease files / methodcard-0.1.0-py3-none-any.whl
| Download URL | methodcard-0.1.0-py3-none-any.whl |
|---|---|
| Size | 32.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
05dcd89475ba5c1bd7da33b3e76b03aaa9e1efeaa2b300465cb204b5459c61ff
|
|
BLAKE2b-256 checksum How to use checksums |
edc46f9724713436a16810690b50f9102be9d5306c9a3823967500fad5eda379
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logSecurity for methodcard 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for methodcard-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.