Skip to main content

English · Español

GeoNormPy logo

GeoNormPy

Reproducible CIPW normative mineralogy for whole-rock geochemistry

Current delivery state and remaining work.

Transform major-oxide analyses into auditable normative mineral assemblages, diagnostics and batch-ready tables from Python or the command line.

Release Tests Python 3.9+ License: GPL-3.0-or-later

Legacy and congress reference

The earlier GeoNormPy / GeoNormML work was presented as a technical paper at the XXIII Peruvian Geological Congress (CPG XXIII), organized by the Sociedad Geológica del Perú in 2026. That research generation is identified as Legacy; its historical figures are not current benchmarks.

GeoNormPy 1.0.0 is retained as a Legacy release. The congress material advertised 0.1.1, an earlier publication cut. The corrected extended_cipw_v3 3.1 profile in 1.1.0 is not identical to either earlier release. Verma 2003 and Pruseth 2009 are calculation profiles, not trained classifiers. Numerical closure does not establish an improvement in ML accuracy. See citation metadata and the GeoNormML generation decision.

Methodological scope and critical assessment

Engine tests check numerical behavior, component inventories and errors in the documented cases; they do not certify measured mineralogy or classifier accuracy. An inventory can close through free components and signed corrections while the mineral allocation remains incomplete. Inspect calculation status, supported chemistry and warnings rather than relying on closure alone.

Profile comparisons must align inputs, units, normalization and iron policy, while declaring apatite and carbonate conventions. Replacing the profile that generated an ML model's features requires reevaluation under the same design. The completed review neither attributes Legacy metric differences to a GeoNormPy failure nor demonstrates that better closure improves ML accuracy. The GeoNormML methodology and critique distinguishes checked results from the nested and independent evaluation still required for future selection procedures.

Workflow at a glance

Major oxides + sample identifiers
              │
              ▼
 Schema validation and iron-speciation handling
              │
              ▼
 Dry normalization ──► sequential CIPW allocation
              │
              ▼
 Normative minerals + mass balance + saturation flags
              │
              ▼
 Python dictionary / pandas table / CSV workflow

Capabilities

Area Support
Calculation Sequential CIPW normative mineral allocation
Iron Total iron as FeOT or explicit FeO and Fe2O3 inputs
Diagnostics Silica saturation, alumina state, mass-balance error and interpretive flags
Execution Single-sample Python API, pandas batch processing and CLI workflows
Reproducibility YAML configuration, schema inspection, templates and input validation
Integration Reusable normative-feature engine for GeoNormML

Supported chemistry

Model scope

Version 1.1.0 offers extended_cipw_v3 (default compatibility), verma2003 and pruseth2009 profiles, with independently selected iron policies. Their input sets, apatite conventions and free-component accounting differ. Unresolved allocations are reported explicitly; the safe API returns a structured error. See profiles and scientific conventions and model limits and errors.

Core and accessory inputs include:

SiO2, TiO2, Al2O3, Fe2O3, FeO, FeOT, MnO, MgO, CaO, Na2O, K2O, P2O5, ZrO2, Cr2O3, CO2, S, F, Cl and SO3.

Optional identifier columns include Sample_ID and Notes. Input chemistry must use a consistent weight-percent basis and documented treatment of loss on ignition, below-detection values and total iron.

Installation

Latest release

python -m pip install geonormpy

Editable source installation

git clone https://github.com/jordan-zav/GeoNormPy.git
cd GeoNormPy
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -e .

Quick Python example

from geonormpy.norms.cipw import cipw

sample = {
    "SiO2": 72.5,
    "Al2O3": 13.5,
    "FeOT": 2.5,
    "MgO": 0.5,
    "CaO": 1.8,
    "Na2O": 3.4,
    "K2O": 4.0,
}

result = cipw(sample)
print(result["minerals_wtpercent"])
print(result["flags"])

Command-line workflow

geonormpy --help
geonormpy schema
geonormpy make-template
geonormpy make-config
geonormpy validate --input data/test_data.csv
geonormpy run --config config/workflow.yaml

The example batch launcher reads data/test_data.csv and writes data/normative_results.csv:

python run_GeoNormPy.py

Standard outputs

Diagnostic fields

  • silica_saturation
  • alumina_state
  • mass_balance_error
  • interpretive_flag
  • calc_error

Normative mineral fields

Q, Cor, Or, Ab, An, Le, Ne, Kp, Ac, Di, Hd, Wo, En, Fs, Fo, Fa, Mt, Hm, Ilm, Cm, Ru, Tn, Z, Ap, Cc, Py, Fl, Hl, Th, ns and ks.

Downstream software should preserve both the mineral results and the diagnostic columns. Filtering only the successful rows without retaining the error reason breaks traceability.

Scientific boundaries

  • Normative phases are calculated end-members, not minerals observed in thin section.
  • Iron-speciation assumptions can materially change normative mafic and oxide phases.
  • Volatile, alteration and analytical-total problems must be reviewed before interpretation.
  • TAS, QAPF, petrography and CIPW answer related but different classification questions.
  • A successful mass balance does not prove that the input rock name is correct.

Development and verification

Version 1.1.0 adds three selectable CIPW profiles: extended_cipw_v3 (default compatibility), verma2003 and pruseth2009. Iron policies can be selected independently. Results record the selected profile, its version and calculation assumptions. See profiles, API, CLI and scientific conventions.

python -m pip install -e .
python -m pytest -q

The regression suite covers the CIPW engine, robustness cases, CLI behavior and configured workflows. See the complete method description and the audit record.

Repository map

The extended CIPW benchmarks compare the major-oxide core with pyrolite, document numerical stability and iron sensitivity, and distinguish unresolved allocations from valid norms. See the benchmark runner for reproducible commands.

Path Contents
geonormpy/norms CIPW and batch calculation engine
geonormpy/core Chemistry constants, minerals and shared rules
geonormpy/schema.py Supported input/output schema
geonormpy/cli.py Command-line interface
config Example YAML workflow configuration
tests Numerical, robustness, CLI and workflow tests
docs Method, theory and audit material

Citation

Version 1.0.0 introduced structured errors and JSON output. See errors and integration and PyPI publishing.

Use the metadata in CITATION.cff when citing GeoNormPy in a thesis, article or technical report.

License and contact

GeoNormPy is distributed under the GNU General Public License v3.0.

Jordan Zavaleta — GisGeo Dev
jordanzav@gisgeo.dev · gisgeo.dev

Reproducible portfolio examples

The scripts/portfolio_demo.py example runs the focused CIPW, profile and cation conservation checks, then prints the calculation for explicitly synthetic granite chemistry. scripts/portfolio_rich_demo.py presents the same calculation using the optional Rich library and can export its transcript and evidence with --export-dir. Rich is required only for that presentation script, not for the calculation engine.

The retained images and provenance files in docs/assets describe historical captures. They are repository demonstrations, not independent scientific validation. Run the examples and project checks on the development PC before using a new capture or distributing changed software.

Metadata

Release files for geonormpy 1.1.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 geonormpy 1.1.0
File Size Uploaded Provenance Actions
geonormpy-1.1.0.tar.gz 109.4 kB Without provenance Details for geonormpy-1.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 160.1 kB

Release files / geonormpy-1.1.0.tar.gz

Download URL geonormpy-1.1.0.tar.gz
Size 109.4 kB
Tags Source
SHA-256 checksum
How to use checksums
25e8078265eeb16a4314ef62f8f2db1a8442071f32ef86014bd5712fbf789684
BLAKE2b-256 checksum
How to use checksums
00574563debb77f61192ac7828dc5e1e2f149e889a02d93a4b20efca22df966c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / geonormpy-1.1.0-py3-none-any.whl

Download URL geonormpy-1.1.0-py3-none-any.whl
Size 50.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d1e7a96ec40d9cd0456fe87fffa41b5f569595ccdece6e4ea9c18dab03605de8
BLAKE2b-256 checksum
How to use checksums
d65d79534d8f95f66f570c01c76776b3adbd2de66c3ab46248333418c725f814
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Security for geonormpy 1.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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