Skip to main content

GeoNormPy

Reproducible CIPW normative mineralogy for whole-rock geochemistry

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

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.0.0 exposes the extended_cipw_v3 model. It does not claim complete equivalence to every published CIPW implementation. Unresolved allocations are reported explicitly, and the safe API returns a structured error for them. For compositions rich in F, Cl or S, mass-balance warnings require interpretation of the oxygen basis. Iron estimated from FeOT uses an explicitly configurable fixed ferric fraction. See 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

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

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

La versión 1.0.0 incorpora errores estructurados y salida JSON. Consulta Errores e integración y Publicación en PyPI.

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

Metadata

Release files for geonormpy 1.0.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.0.0
File Size Uploaded Provenance Actions
geonormpy-1.0.0.tar.gz 44.8 kB Without provenance Details for geonormpy-1.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 82.7 kB

Release files / geonormpy-1.0.0.tar.gz

Download URL geonormpy-1.0.0.tar.gz
Size 44.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ebc4fef7790c3b2a74a75b18b2769146a8d74652c3e3f4390d3d8a697a498bb3
BLAKE2b-256 checksum
How to use checksums
c9e2f5596e1420ab84611fc0098f14f2e09174f0cedf7a07b81c088c8e06b05b
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.0.0-py3-none-any.whl

Download URL geonormpy-1.0.0-py3-none-any.whl
Size 37.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
19fa4dd978b8143f3139c65922889759ad7afdf3e130aee36081563fa2634371
BLAKE2b-256 checksum
How to use checksums
89251acf90a0b24d9d726b2d4971be17020e307d1f96679428a708847eb46004
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.0.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