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, monotonicity proved by interval arithmetic, values cross-checked against references;
  • ready to use: compute, compose, invert, solve with others as a system of equations, 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, 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
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
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.8.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.8.0
File Size Uploaded Provenance Actions
nomogram-0.8.0.tar.gz 350.8 kB With provenance Details for nomogram-0.8.0.tar.gz

Built distribution (wheel)

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

Total release size: 716.6 kB

Release files / nomogram-0.8.0.tar.gz

Download URL nomogram-0.8.0.tar.gz
Size 350.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4efc1095d9ce98ef3bec6da93829dbaae1f7d158c803851dd712b1e8b79ddba2
BLAKE2b-256 checksum
How to use checksums
c426f1aef97925c00dc609e6b6b1ee45db240ba3bfa874a9646ad17cd5e8ef8b
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 21, 2026.

Transparency log

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

Download URL nomogram-0.8.0-py3-none-any.whl
Size 365.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c6328e3851ce7b77dc802e50e264c07331d564ed0afd5c1bbdc52fd918228eda
BLAKE2b-256 checksum
How to use checksums
77bd7b88507367ba27331e594b6af633fc7a1bb7e8cfaabb6459e919e4c0020b
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 21, 2026.

Transparency log

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