georunes


Namegeorunes JSON
Version 0.1.3 PyPI version JSON
download
home_pagehttps://github.com/dugucrypter/georunes
SummaryTools for geochemical visualization and modeling
upload_time2023-11-15 22:15:56
maintainer
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)]()

GeoRunes is a bunch of tools and classes written to generate geochemical diagrams using matplotlib. 

**georunes.plot** assits the representation of geochemical data in binary diagrams, ternary diagrams and normalized spider diagrams. It uses plotting parameters (category, color, marker, label ...) defined in the data source file along with geochemical data to construct the required figures.

**georunes.modmin** estimates the modal mineralogy of some whole rock compositions, provided a list of minerals with their composition.

## Features

- Data source supported formats: .csv, .xls or .xlsx,
- Data loaded as pandas DataFrames,
- Plotting parameters (color, marker, label, drawing order ...) configurable automatically (see examples/preprocess_files.py),
- Support scaling of axes, layout padding, adjusting figure ratio, transparency and size of markers, configuring legends,
- Chemical conversion from wt.% oxide to element (in millications or ppm),
- Ternary diagram (based on the package **python-ternary**),
- Inner geochemical normalization and multiple plotting style in spider diagrams,
- Handling of translations (using gettext, pass the lang_cfg parameter as a dict{'lang', 'domain' if different, 'locales' if different}),
- CIPW norm calculation and estimation (optimization) of modal mineralogy from whole rock and mineral compositions,
- Available methods for estimation of modal mineralogy : bounded-variable least squares, non-negative least squares, gradient descent, or a random research,
- Components of a solid solution can be fixed for estimation a mineralogy,

## Dependencies

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

## Installation

* Install stable version with pip command:

        pip install georunes

* Install updated version from github:

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


This code was tested with **Python 3.11**, **matplotlib 3.7.2**, **pandas 2.1.0**, **numpy 1.24.3**, and **scipy 1.10.0**.

## Working with GeoRunes

### Short example

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

# Initialize diagram class
diag_nb_ta = DiagramVs(datasource="path/to/data.xls", sheet="sheet1",
                       group_name='Category',  # Attribute used for categorization
                       xvar="Nb", yvar="Ta",  # Variables to plot
                       xlabel="Nb (ppm)", ylabel="Ta (ppm)",  # Labels to write in axes
                       xscale='log', yscale='log',  # Custom scaling
                       )

# Plot data
diag_nb_ta.plot()

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

More examples with an arbitrary geochemical dataset are proposed in the \examples directory.

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

## Roadmap

Supplementary whole-rocks and mineral-based geochemical diagrams will be added in the following versions. Long-term updates might provide utilities for geochemical modelling and normative mineralogy.

### Author

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

### License

This work is under MIT License.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/dugucrypter/georunes",
    "name": "georunes",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "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/8a/b6/f13b60dc70dea03625ff7d783cc6f5a9675a282224609d9f2268ef9c3e32/georunes-0.1.3.tar.gz",
    "platform": null,
    "description": "\r\nGeoRunes\r\n----------\r\n[![License](https://img.shields.io/github/license/dugucrypter/georunes)]()\r\n\r\nGeoRunes is a bunch of tools and classes written to generate geochemical diagrams using matplotlib. \r\n\r\n**georunes.plot** assits the representation of geochemical data in binary diagrams, ternary diagrams and normalized spider diagrams. It uses plotting parameters (category, color, marker, label ...) defined in the data source file along with geochemical data to construct the required figures.\r\n\r\n**georunes.modmin** estimates the modal mineralogy of some whole rock compositions, provided a list of minerals with their composition.\r\n\r\n## Features\r\n\r\n- Data source supported formats: .csv, .xls or .xlsx,\r\n- Data loaded as pandas DataFrames,\r\n- Plotting parameters (color, marker, label, drawing order ...) configurable automatically (see examples/preprocess_files.py),\r\n- Support scaling of axes, layout padding, adjusting figure ratio, transparency and size of markers, configuring legends,\r\n- Chemical conversion from wt.% oxide to element (in millications or ppm),\r\n- Ternary diagram (based on the package **python-ternary**),\r\n- Inner geochemical normalization and multiple plotting style in spider diagrams,\r\n- Handling of translations (using gettext, pass the lang_cfg parameter as a dict{'lang', 'domain' if different, 'locales' if different}),\r\n- CIPW norm calculation and estimation (optimization) of modal mineralogy from whole rock and mineral compositions,\r\n- Available methods for estimation of modal mineralogy : bounded-variable least squares, non-negative least squares, gradient descent, or a random research,\r\n- Components of a solid solution can be fixed for estimation a mineralogy,\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\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 updated version from github:\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\n\r\nThis code was tested with **Python 3.11**, **matplotlib 3.7.2**, **pandas 2.1.0**, **numpy 1.24.3**, and **scipy 1.10.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 diagram class\r\ndiag_nb_ta = DiagramVs(datasource=\"path/to/data.xls\", sheet=\"sheet1\",\r\n                       group_name='Category',  # Attribute used for categorization\r\n                       xvar=\"Nb\", yvar=\"Ta\",  # Variables to plot\r\n                       xlabel=\"Nb (ppm)\", ylabel=\"Ta (ppm)\",  # Labels to write in axes\r\n                       xscale='log', yscale='log',  # Custom scaling\r\n                       )\r\n\r\n# Plot data\r\ndiag_nb_ta.plot()\r\n\r\n# Show the figure\r\nplt.show()\r\n```\r\n\r\nMore examples with an arbitrary geochemical dataset are proposed in the \\examples directory.\r\n\r\n<img src=\"examples/preview.png\">\r\n\r\n## Roadmap\r\n\r\nSupplementary whole-rocks and mineral-based geochemical diagrams will be added in the following versions. Long-term updates might provide utilities for geochemical modelling and normative mineralogy.\r\n\r\n### Author\r\n\r\nW.M.-E. Bonzi, 2021-2023.\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": "0.1.3",
    "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": "",
            "digests": {
                "blake2b_256": "626522835fb81f7d72a41834f3d32bbc3f5195639f9b3c576fe3912fab58ab11",
                "md5": "e9a42207a66d9663dc40c6b68d562869",
                "sha256": "22ff356062a51f78f63fb480b2e915192c5bd99fc5b7ff7b79904ab193871224"
            },
            "downloads": -1,
            "filename": "georunes-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e9a42207a66d9663dc40c6b68d562869",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 91093,
            "upload_time": "2023-11-15T22:15:55",
            "upload_time_iso_8601": "2023-11-15T22:15:55.258481Z",
            "url": "https://files.pythonhosted.org/packages/62/65/22835fb81f7d72a41834f3d32bbc3f5195639f9b3c576fe3912fab58ab11/georunes-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8ab6f13b60dc70dea03625ff7d783cc6f5a9675a282224609d9f2268ef9c3e32",
                "md5": "0a5d32a5df2566b979bca035bf81f81f",
                "sha256": "34f9cb9fe111e40c7a73a3c2055a0622dcb854ba4abd9ab797b21a1aa038bba8"
            },
            "downloads": -1,
            "filename": "georunes-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "0a5d32a5df2566b979bca035bf81f81f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 63617,
            "upload_time": "2023-11-15T22:15:56",
            "upload_time_iso_8601": "2023-11-15T22:15:56.911777Z",
            "url": "https://files.pythonhosted.org/packages/8a/b6/f13b60dc70dea03625ff7d783cc6f5a9675a282224609d9f2268ef9c3e32/georunes-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-15 22:15:56",
    "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: 2.28721s