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; 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. 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.5.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.5.0
File Size Uploaded Provenance Actions
nomogram-0.5.0.tar.gz 213.5 kB With provenance Details for nomogram-0.5.0.tar.gz

Built distribution (wheel)

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

Total release size: 441.5 kB

Release files / nomogram-0.5.0.tar.gz

Download URL nomogram-0.5.0.tar.gz
Size 213.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6bbddb77a4ab2b30f6b2b8367963162327b7e3c1cdea6203c47c429386a4bfa3
BLAKE2b-256 checksum
How to use checksums
2fe4bed29e2c3e893147307dfb9835debf0510bd605f03af9070ad2a511364d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 31, 2026.

Transparency log

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

Download URL nomogram-0.5.0-py3-none-any.whl
Size 228.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9be541c11af3c3fff12e9a3bbc4d4a72519bd1bff8c7d374ad9e07a94bbee64b
BLAKE2b-256 checksum
How to use checksums
583e16ea426ba4de3a6f0248f7590f067d5d0f2e70fb3e5c341ffe534ff3cfbe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 31, 2026.

Transparency log

Security for nomogram 0.5.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.5.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 Oct 31, 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