georunes


Namegeorunes JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/dugucrypter/georunes
SummaryTools for geochemical visualization and modeling
upload_time2025-08-09 16:20:50
maintainerNone
docs_urlNone
authorWiledio Marc-Emile Bonzi
requires_python>=3.6
licenseMIT
keywords geochemistry diagrams oxides chemical elements modeling fitting
VCS
bugtrack_url
requirements numpy matplotlib pandas python-ternary scipy XlsxWriter
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
GeoRunes
----------
[![License](https://img.shields.io/github/license/dugucrypter/georunes)]()
[![PyPI](https://img.shields.io/pypi/v/georunes.svg)](https://pypi.org/project/georunes/)

GeoRunes is a collection of tools and classes designed for creating geochemical diagrams with matplotlib, calculating normative geochemistry, and performing geochemical modeling.
 
**georunes.plot** assists the representation of geochemical data in binary diagrams, ternary diagrams and normalized spider diagrams. It leverages plotting parameters (category, color, marker, label, etc.) defined in the data source file alongside geochemical data to create customized figures.

**georunes.modmin** estimates the modal mineralogy of whole rock compositions, given a list of minerals and their compositions. It supports various optimization algorithms (e.g., least squares, gradient descent, random search) to estimate mineral modes from whole-rock and mineral compositions.

**georunes.petromod** provides petrological modeling tools including mass balance calculations, batch crystallization/melting and Rayleigh crystallization.

## Features

### Data input and configuration
- Supports data source formats: .csv, .xls or .xlsx.
- Automatically configures plotting parameters (color, marker, label, drawing order, etc.) from data source files (see examples/preprocess_files.py).
- Supports internationalization via gettext (pass lang_cfg as a dictionary: {'lang', 'domain' (optional), 'locales' (optional)}).

### Plotting and visualization
- Supports axis scaling, layout padding, figure aspect ratio adjustments, marker transparency, marker size and legend configuration.
- Includes ternary diagrams based on the **python-ternary** package.
- Implements geochemical normalization and supports multiple plotting styles in spider diagrams.

### Geochemical data processing, modal mineralogy and modeling
- Converts chemical data from weight-percent oxides to elemental concentrations (in milligrams or parts per million).
- Calculates Atoms Per Formula Unit (APFU) from mineral geochemical data.
- Calculates CIPW norm and estimates modal mineralogy through optimization methods.
- Offers several modal mineralogy estimation methods: bounded-variable least squares (BVLS), non-negative least squares (NNLS), gradient descent, and random search (stochastic search).
- Performs mass balance calculations (in magmatic context), including computation of a cumulate modal composition derived from a parental melt.
- Performs batch and Rayleigh fractionation modeling based on provided partition coefficients (Kds), with visualization of concentration vs liquid proportion, or normalized spider diagrams.

## Dependencies

- matplotlib
- pandas
- numpy
- scipy
- python-ternary
- XlsxWriter

## Installation

* Install stable version with pip command:

        pip install georunes

* Install the latest development version from:

        git clone https://github.com/dugucrypter/georunes.git
        cd georunes
        python setup.py install --user

This version of the package code has been tested with **Python 3.11.7**, **matplotlib 3.8.4**, **pandas 2.2.1**, **numpy 1.26.4**, and **scipy 1.13.0**.

## Working with GeoRunes

### Short example

```python
import matplotlib.pyplot as plt
from georunes.plot.binary.versus import DiagramVs

# Initialize the diagram with data and parameters
diag_nb_ta = DiagramVs(
    datasource="path/to/data.xls",  # Path to the data file
    sheet="sheet1",                 # Excel sheet name
    group_name='Category',          # Column name for grouping/categorization
    xvar="Nb",                     # X-axis variable
    yvar="Ta",                     # Y-axis variable
    xlabel="Nb (ppm)",             # X-axis label
    ylabel="Ta (ppm)",             # Y-axis label
    xscale='log',                  # Scale for X-axis (logarithmic)
    yscale='log'                   # Scale for Y-axis (logarithmic)
)

# Generate the plot
diag_nb_ta.plot()

# Display the figure
plt.show()
```

More examples can be found in the ./examples directory.

<img src="examples/preview.png">

### Author

W.M.-E. Bonzi, 2021-2025.

### License

This work is under MIT License.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/dugucrypter/georunes",
    "name": "georunes",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "geochemistry, diagrams, oxides, chemical elements, modeling, fitting",
    "author": "Wiledio Marc-Emile Bonzi",
    "author_email": "wiledio.bonzi@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/1c/15/c0516ca4dd22d41e1e8a1f14cdede9dec03ab38cb9cc2cdc54438287d8b9/georunes-1.0.0.tar.gz",
    "platform": null,
    "description": "\r\nGeoRunes\r\n----------\r\n[![License](https://img.shields.io/github/license/dugucrypter/georunes)]()\r\n[![PyPI](https://img.shields.io/pypi/v/georunes.svg)](https://pypi.org/project/georunes/)\r\n\r\nGeoRunes is a collection of tools and classes designed for creating geochemical diagrams with matplotlib, calculating normative geochemistry, and performing geochemical modeling.\r\n \r\n**georunes.plot** assists the representation of geochemical data in binary diagrams, ternary diagrams and normalized spider diagrams. It leverages plotting parameters (category, color, marker, label, etc.) defined in the data source file alongside geochemical data to create customized figures.\r\n\r\n**georunes.modmin** estimates the modal mineralogy of whole rock compositions, given a list of minerals and their compositions. It supports various optimization algorithms (e.g., least squares, gradient descent, random search) to estimate mineral modes from whole-rock and mineral compositions.\r\n\r\n**georunes.petromod** provides petrological modeling tools including mass balance calculations, batch crystallization/melting and Rayleigh crystallization.\r\n\r\n## Features\r\n\r\n### Data input and configuration\r\n- Supports data source formats: .csv, .xls or .xlsx.\r\n- Automatically configures plotting parameters (color, marker, label, drawing order, etc.) from data source files (see examples/preprocess_files.py).\r\n- Supports internationalization via gettext (pass lang_cfg as a dictionary: {'lang', 'domain' (optional), 'locales' (optional)}).\r\n\r\n### Plotting and visualization\r\n- Supports axis scaling, layout padding, figure aspect ratio adjustments, marker transparency, marker size and legend configuration.\r\n- Includes ternary diagrams based on the **python-ternary** package.\r\n- Implements geochemical normalization and supports multiple plotting styles in spider diagrams.\r\n\r\n### Geochemical data processing, modal mineralogy and modeling\r\n- Converts chemical data from weight-percent oxides to elemental concentrations (in milligrams or parts per million).\r\n- Calculates Atoms Per Formula Unit (APFU) from mineral geochemical data.\r\n- Calculates CIPW norm and estimates modal mineralogy through optimization methods.\r\n- Offers several modal mineralogy estimation methods: bounded-variable least squares (BVLS), non-negative least squares (NNLS), gradient descent, and random search (stochastic search).\r\n- Performs mass balance calculations (in magmatic context), including computation of a cumulate modal composition derived from a parental melt.\r\n- Performs batch and Rayleigh fractionation modeling based on provided partition coefficients (Kds), with visualization of concentration vs liquid proportion, or normalized spider diagrams.\r\n\r\n## Dependencies\r\n\r\n- matplotlib\r\n- pandas\r\n- numpy\r\n- scipy\r\n- python-ternary\r\n- XlsxWriter\r\n\r\n## Installation\r\n\r\n* Install stable version with pip command:\r\n\r\n        pip install georunes\r\n\r\n* Install the latest development version from:\r\n\r\n        git clone https://github.com/dugucrypter/georunes.git\r\n        cd georunes\r\n        python setup.py install --user\r\n\r\nThis version of the package code has been tested with **Python 3.11.7**, **matplotlib 3.8.4**, **pandas 2.2.1**, **numpy 1.26.4**, and **scipy 1.13.0**.\r\n\r\n## Working with GeoRunes\r\n\r\n### Short example\r\n\r\n```python\r\nimport matplotlib.pyplot as plt\r\nfrom georunes.plot.binary.versus import DiagramVs\r\n\r\n# Initialize the diagram with data and parameters\r\ndiag_nb_ta = DiagramVs(\r\n    datasource=\"path/to/data.xls\",  # Path to the data file\r\n    sheet=\"sheet1\",                 # Excel sheet name\r\n    group_name='Category',          # Column name for grouping/categorization\r\n    xvar=\"Nb\",                     # X-axis variable\r\n    yvar=\"Ta\",                     # Y-axis variable\r\n    xlabel=\"Nb (ppm)\",             # X-axis label\r\n    ylabel=\"Ta (ppm)\",             # Y-axis label\r\n    xscale='log',                  # Scale for X-axis (logarithmic)\r\n    yscale='log'                   # Scale for Y-axis (logarithmic)\r\n)\r\n\r\n# Generate the plot\r\ndiag_nb_ta.plot()\r\n\r\n# Display the figure\r\nplt.show()\r\n```\r\n\r\nMore examples can be found in the ./examples directory.\r\n\r\n<img src=\"examples/preview.png\">\r\n\r\n### Author\r\n\r\nW.M.-E. Bonzi, 2021-2025.\r\n\r\n### License\r\n\r\nThis work is under MIT License.\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Tools for geochemical visualization and modeling",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/dugucrypter/georunes",
        "Source": "https://github.com/dugucrypter/georunes"
    },
    "split_keywords": [
        "geochemistry",
        " diagrams",
        " oxides",
        " chemical elements",
        " modeling",
        " fitting"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c095a11b4f0c4d6a4d9a4b993d6f873cf412a070399783692d40361f2c30d5e6",
                "md5": "016f71fd73a58fd3af59a8f01a9fef59",
                "sha256": "aabb7850a492a2dee4bd5f897204e8bb684276f895c2ac4392429db562901b57"
            },
            "downloads": -1,
            "filename": "georunes-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "016f71fd73a58fd3af59a8f01a9fef59",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 108313,
            "upload_time": "2025-08-09T16:20:49",
            "upload_time_iso_8601": "2025-08-09T16:20:49.056443Z",
            "url": "https://files.pythonhosted.org/packages/c0/95/a11b4f0c4d6a4d9a4b993d6f873cf412a070399783692d40361f2c30d5e6/georunes-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "1c15c0516ca4dd22d41e1e8a1f14cdede9dec03ab38cb9cc2cdc54438287d8b9",
                "md5": "9dc3ac9d0393aff4e72291c65c4f7725",
                "sha256": "5f8121e1fc771dc81fea80d4f9d89a7324a5d3e2b75341e7a8d16da31399f168"
            },
            "downloads": -1,
            "filename": "georunes-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9dc3ac9d0393aff4e72291c65c4f7725",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 76138,
            "upload_time": "2025-08-09T16:20:50",
            "upload_time_iso_8601": "2025-08-09T16:20:50.199071Z",
            "url": "https://files.pythonhosted.org/packages/1c/15/c0516ca4dd22d41e1e8a1f14cdede9dec03ab38cb9cc2cdc54438287d8b9/georunes-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-09 16:20:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dugucrypter",
    "github_project": "georunes",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "numpy",
            "specs": [
                [
                    ">=",
                    "1.19.3"
                ]
            ]
        },
        {
            "name": "matplotlib",
            "specs": [
                [
                    ">=",
                    "3.7.1"
                ]
            ]
        },
        {
            "name": "pandas",
            "specs": [
                [
                    ">=",
                    "2.1.0"
                ]
            ]
        },
        {
            "name": "python-ternary",
            "specs": [
                [
                    ">=",
                    "1.0.4"
                ]
            ]
        },
        {
            "name": "scipy",
            "specs": [
                [
                    ">=",
                    "1.1.0"
                ]
            ]
        },
        {
            "name": "XlsxWriter",
            "specs": [
                [
                    ">=",
                    "1.3.7"
                ]
            ]
        }
    ],
    "lcname": "georunes"
}
        
Elapsed time: 0.67918s