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 and Wikidata, its source, its validity domain when stated;
  • checked: dimensions and units on loading, equivalences proved symbolically, values cross-checked against references;
  • ready to use: compute, compose, invert, plot, and compare with its alternatives.

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

Pure Python, built on SymPy, 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 vocabulary is mapped in docs/rosetta.md, and Shared vocabularies explains how nomogram builds on QUDT, CF and Wikidata and contributes to them; How nomogram earns trust explains what is checked and how, and Displaying formulas shows formulas in notebooks, Markdown and plots. Sea water shows the salinity scales and the vapour pressure of sea water, and what its 2 % lowering changes at the sea surface. Humidity aloft sets the formula of a radiosonde's producer against its users' along a vertical profile, through the dew point, over water or over ice, and against WMO's requirements. The evaporation duct chains the catalog from the measurements of a ship to the height of the duct, through the surface layer of COARE 3.6 and of the IFS, and compares four ways to that height. Security and compliance gathers, for those who approve its use on a laboratory network, how nomogram is developed, checked and published, what remains to do, and a checklist. The logo is 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.7.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.7.0
File Size Uploaded Provenance Actions
nomogram-0.7.0.tar.gz 312.7 kB With provenance Details for nomogram-0.7.0.tar.gz

Built distribution (wheel)

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

Total release size: 638.9 kB

Release files / nomogram-0.7.0.tar.gz

Download URL nomogram-0.7.0.tar.gz
Size 312.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2fe75f0a9ce9bb3d7069a429fc294a8bcb9a684cbc8615584bd92addd1ce5e87
BLAKE2b-256 checksum
How to use checksums
1fc3bb683fa61c3e5dd301742d07576ca57de18ff35184592b37d269c92abf03
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 8, 2026.

Transparency log

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

Download URL nomogram-0.7.0-py3-none-any.whl
Size 326.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f94f8335f93ec0a711105b50cd2d484607f3306b2f21b3e40a2dbb625e3e005f
BLAKE2b-256 checksum
How to use checksums
cd4bdd1936d54507e5e560624917f55b2301856ed5f3776fe9353abbb48a347c
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 8, 2026.

Transparency log

Security for nomogram 0.7.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.7.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 8, 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