Skip to main content

nomogram

English | Français

CI CodeQL codecov Python License DOI uv Ruff Checked with mypy Conventional Commits

Formulas as data, not as code.

nomogram does not hard-code functions: it catalogs formulas, each one

  • meaningful: QUDT quantity kinds and units, links to CF, Wikidata and the SI Digital Framework, its source, its validity domain when stated;
  • checked: dimensions and units on loading, equivalences proved symbolically, monotonicity proved by interval arithmetic, values cross-checked against references;
  • ready to use: compute, compose, invert, differentiate, solve with others as a system of equations, plot, compare with its alternatives, and draw with its system as a graph.

Built for trust, not for speed: to show that a calculation is right, and where it comes from.

Pure Python, built on SymPy, mpmath, numpy and pint; it works on an offline workstation (no online engine).

Early stage project (alpha).

Installation

pip install nomogram          # core
pip install "nomogram[viz]"   # with plots (matplotlib)

Installation from source

git clone https://github.com/miki4iaml/nomogram.git
cd nomogram
uv sync

Python 3.12 or later. Plots need the viz extra (matplotlib): uv sync --extra viz.

Example

Every saturation vapour pressure formulation of the catalog against the IAPWS reference, from 0 to 60 °C and within 1 %; curves stop where a formulation leaves its stated validity domain, and the figure takes the option set of nomogram's documentation (script):

import numpy as np
import nomogram as nomo
from nomogram.units import Q_

catalog = nomo.catalog.catalog()
formulations = catalog.formulations_of("SaturationVapourPressureOverWater")
reference = catalog.formulations["iapws_sr1_86"]
temperatures = Q_(np.linspace(-60, 110, 341), "degC")

table = nomo.comparison.compare(
    formulations, reference, {"ThermodynamicTemperature": temperatures}
)
with nomo.display.display_options(nomo.display.DisplayOptions.DOCUMENTATION):
    nomo.plot.plot_deviations(table, xlim=(0, 60), ylim=(-1.0, 1.0))  # extra viz

Deviation of saturation vapour pressure formulations from IAPWS

Usage

The table holds the values and the relative deviations, by formulation; values outside a formulation's validity domain are NaN unless asked otherwise (outside="ignore"). Formulations also chain, for instance the absolute humidity from any saturation vapour pressure formulation:

ha = nomo.comparison.compose(
    catalog.formulations["mass_concentration_ideal_gas"], {"e_s": reference}
)
ha.evaluate(RH=Q_(100, "percent"), T=Q_(20, "degC")).to("g/m^3")  # 17.29

compare gives each value to the input of its quantity kind. A formulation with several inputs of one kind, such as a scheme interpolating between two levels (the target pressure p and the pressures p_1 and p_2 of the levels), compares once all but one of them are fixed, which compare asks for: partial fixes inputs as functools.partial fixes arguments, here the two levels, and leaves a function of p alone, evaluated, compared and plotted like any formulation (Humidity between two levels). It also fixes what is known in advance, such as the levels of a sounding, and names the curve in legends:

levels = {"p_1": Q_(850, "hPa"), "p_2": Q_(500, "hPa"),
          "T_1": Q_(278, "K"), "T_2": Q_(252, "K")}
in_ln_p = nomo.comparison.partial(
    catalog.formulations["log_pressure_interpolation_temperature"],
    label="T linear in ln p", **levels,
)
in_ln_p.evaluate(p=Q_(700, "hPa")).to("K")  # 268.49

Formulations are found by words, wildcards and fields, whatever their notation (Finding formulations):

catalog.search(variable="rho*")                    # ρ in every notation
catalog.search(kind="VapourPressure", source="buck*")

Each formulation keeps its units, validity domain, temperature scale and references. The guides:

Guide What it shows
Concepts
How nomogram earns trust what is checked, and how
Finding formulations words, wildcards, fields, links
Rosetta the vocabulary across QUDT, SI, pint, SymPy, CF, OM
Shared vocabularies QUDT, CF, Wikidata: what nomogram takes and gives back
Displaying formulas notebooks, Markdown, plots
Graphs of kinds and systems the tree of kinds and the equations of a system, with their sources and the driver of a loop, as JSON in the format protee draws
Case studies
Sea water salinity scales, the 2 % lowering of vapour pressure
Humidity aloft a radiosonde's formula against its users', along a profile
The evaporation duct from a ship's measurements to the duct height, four ways
COARE 3.6 as a system the loop of the code solved by Newton's method, and drawn
Contrails when an aircraft's exhaust saturates the air: Schumann's thresholds, Appleman's criterion of 1953
Using it in a laboratory
Security and compliance how it is developed, checked, published; a checklist
The logo a working nomogram

Contributing

References to integrate, information or corrections about catalog entries, new formulas and code are all welcome: see the ways to contribute and the catalog guide.

Data sources

nomogram's units come from QUDT, and so do its quantity kinds, except those QUDT lacks, which nomogram defines as specializations of QUDT kinds. nomogram links some kinds to CF standard names, which come, with their canonical units, from the CF standard name table. The package bundles a subset of each source:

What nomogram selects, changes and adds is listed in NOTICE.md.

License

Code: BSD-3-Clause. Bundled data: see Data sources.

Metadata

Release files for nomogram 0.11.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nomogram 0.11.0
File Size Uploaded Provenance Actions
nomogram-0.11.0.tar.gz 383.8 kB With provenance Details for nomogram-0.11.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nomogram 0.11.0
File Interpreter ABI Platform Actions
nomogram-0.11.0-py3-none-any.whl Python 3 none any Details for nomogram-0.11.0-py3-none-any.whl

Total release size: 784.1 kB

Release files / nomogram-0.11.0.tar.gz

Download URL nomogram-0.11.0.tar.gz
Size 383.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8a48701dd3e7cd3b814529d9c35697af4b1b07fcf90c92629d3ea200dfae978b
BLAKE2b-256 checksum
How to use checksums
e6ebdc89f960698723c15b36e450ddfea4b5fc60983a1aa3502f6c58f6031f62
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 Dec 1, 2026.

Transparency log

Release files / nomogram-0.11.0-py3-none-any.whl

Download URL nomogram-0.11.0-py3-none-any.whl
Size 400.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e474c04ed3c608ed3bcc5527989c273c7dea5f99d4ecf7780ebb1954a01ca545
BLAKE2b-256 checksum
How to use checksums
b141906825f5737ec9f915fe2fa2062f7d6ba4dfce324afb325285038360cb42
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 Dec 1, 2026.

Transparency log

Security for nomogram 0.11.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for nomogram-0.11.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 Dec 1, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page