Skip to content

Commit

Permalink
Merge branch 'release/0.3.6' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
morganjwilliams committed Oct 29, 2024
2 parents 54474a1 + f566919 commit 02d5cc0
Show file tree
Hide file tree
Showing 65 changed files with 491 additions and 217 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/docstest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ jobs:
name: Build Docs
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [3.8, 3.9, "3.10", "3.11"]
python-version: [3.9, "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
python-version: [3.9, "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
__pycache__/
*.py[cod]
*$py.class
.DS_Store

# C extensions
*.so
Expand Down
97 changes: 97 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
cff-version: 1.2.0
title: 'morganjwilliams/pyrolite: 0.3.5.post0'
message: Please cite the following works when using this software.
type: software
authors:
- family-names: Williams
given-names: Morgan
orcid: 'https://orcid.org/0000-0003-4764-9555'
- family-names: Buckle
given-names: Tom
- family-names: Myhill
given-names: Bob
orcid: 'https://orcid.org/0000-0001-9489-5236'
- family-names: Shi
given-names: Sarah
orcid: 'https://orcid.org/0009-0004-8997-7287'
- family-names: Nathwani
given-names: Chetan
orcid: 'https://orcid.org/0000-0003-1208-9041'
- family-names: Piette Lauziere
given-names: Nicolas
orcid: 'https://orcid.org/0000-0003-2812-0357'
- family-names: Lexa
given-names: Ondrej
orcid: 'https://orcid.org/0000-0003-4616-9154'
- family-names: Schoneveld
given-names: Louise
orcid: 'https://orcid.org/0000-0002-9324-1676'
- family-names: Afonso Rodrigues
given-names: Angela
orcid: 'https://orcid.org/0000-0003-3402-9621'
- family-names: Mues
given-names: Malte
orcid: 'https://orcid.org/0000-0002-6291-9886'
- family-names: Bentley
given-names: Martin
- family-names: Gentilini
given-names: Alessandro
- family-names: Scott
given-names: Richard
identifiers:
- type: doi
value: 10.5281/ZENODO.2545106
- type: url
value: 'https://zenodo.org/doi/10.5281/zenodo.2545106'
url: 'https://zenodo.org/doi/10.5281/zenodo.2545106'
version: 0.3.5.post0
date-released: '2024-02-28'
doi: 10.5281/ZENODO.2545106
preferred-citation:
authors:
- family-names: Williams
given-names: Morgan
orcid: 'https://orcid.org/0000-0003-4764-9555'
- family-names: Schoneveld
given-names: Louise
orcid: 'https://orcid.org/0000-0002-9324-1676'
- family-names: Mao
given-names: Ya-Jing
orcid: 'https://orcid.org/0000-0002-2725-2158'
- family-names: Klump
given-names: Jens
occid: 'https://orcid.org/0000-0001-5911-6022'
- family-names: Gosses
given-names: Justin
orcid: 'https://orcid.org/0000-0002-5351-7295'
- family-names: Dalton
given-names: Hayden
orcid: 'https://orcid.org/0000-0003-2114-9894'
- family-names: Bath
given-names: Adam
orcid: 'https://orcid.org/0000-0003-0882-0807'
- family-names: Barnes
given-names: Steve
orcid: 'https://orcid.org/0000-0002-4912-9177'
doi: 10.21105/joss.02314
identifiers:
- type: doi
value: 10.21105/joss.02314
- type: url
value: 'http://dx.doi.org/10.21105/joss.02314'
- type: other
value: 'urn:issn:2475-9066'
title: 'pyrolite: Python for geochemistry'
url: 'http://dx.doi.org/10.21105/joss.02314'
database: Crossref
date-published: '2020-06-09'
year: 2020
month: 6
issn: 2475-9066
issue: '50'
journal: Journal of Open Source Software
publisher:
name: The Open Journal
start: '2314'
type: article
volume: '5'
25 changes: 19 additions & 6 deletions docs/source/dev/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ All notable changes to this project will be documented here.
If you're keen to check something out before its released, you can use a
`development install <development.html#development-installation>`__ .

`0.3.6`_
----------

* **PR Merged**: `Sarah Shi <https://github.com/sarashi>`__ contributed a PR to
better handle values below zero during compositional renormalisation (to 1 or 100%;
`#104 <https://github.com/morganjwilliams/pyrolite/pull/104>`__).
The functions :func:`pyrolite.comp.codata.close` and :func:`pyrolite.comp.codata.renormalise`
will now warn where values below zero exist, and replace these with `numpy.nan`.
* Added a `CITATION.cff` file to the repository.
* Various administrative changes (formatting, linting, meta-file management), minor bugfixes
and addressing various deprecation/other warnings.

`0.3.5`_
----------

Expand All @@ -26,8 +38,8 @@ All notable changes to this project will be documented here.
allow series and dataframes with `Pm` data to be used with the `pyrolite.pyrochem`
REE accessors (i.e., the column will not be dropped if it exists;
`#100 <https://github.com/morganjwilliams/pyrolite/pull/100>`__).
This PR aslo included an update for the `pyrolite.util.lambdas` functions to be more
flexible in terms of access, including as indvidual series (allowing performant
This PR also included an update for the `pyrolite.util.lambdas` functions to be more
flexible in terms of access, including as individual series (allowing performant
usage with `pandarallel <https://github.com/nalepae/pandarallel>`__).
* Updates to `pyrolite.pyrochem` accessors to be more flexible, generally allowing
usage with both DataFrame and Series objects (e.g. `df.pyrochem.REE`,
Expand All @@ -41,13 +53,13 @@ All notable changes to this project will be documented here.
(`#91 <https://github.com/morganjwilliams/pyrolite/pull/91>`__),
update the TAS field names in the JSON template
(`#92 <https://github.com/morganjwilliams/pyrolite/pull/92>`__),
improve the formatting and scaling of TAS diagrams.
improve the formatting and scaling of TAS diagrams
(`#93 <https://github.com/morganjwilliams/pyrolite/pull/93>`__),
add an option to add field labels in the visual centre of polygons (rather than the
'centroid'; `#94 <https://github.com/morganjwilliams/pyrolite/pull/94>`__),
update some usage of :mod:`matplotlib`
(`#96 <https://github.com/morganjwilliams/pyrolite/pull/96>`__),
and allow selective plotting of indiviudal fields when adding a classification
and allow selective plotting of individual fields when adding a classification
diagram to axes (`#98 <https://github.com/morganjwilliams/pyrolite/pull/98>`__).


Expand Down Expand Up @@ -1398,8 +1410,9 @@ All notable changes to this project will be documented here.
`GitHub <https://github.com/morganjwilliams/pyrolite/releases>`__ for reference,
but were :code:`alpha` versions which were never considered stable.

.. _Development: https://github.com/morganjwilliams/pyrolite/compare/0.3.5...develop
.. _0.3.5: https://github.com/morganjwilliams/pyrolite/compare/0.3.4...0.3.5
.. _Development: https://github.com/morganjwilliams/pyrolite/compare/0.3.6...develop
.. _0.3.6: https://github.com/morganjwilliams/pyrolite/compare/0.3.5.post0...0.3.6
.. _0.3.5: https://github.com/morganjwilliams/pyrolite/compare/0.3.4...0.3.5.post0
.. _0.3.4: https://github.com/morganjwilliams/pyrolite/compare/0.3.3...0.3.4
.. _0.3.3: https://github.com/morganjwilliams/pyrolite/compare/0.3.2...0.3.3
.. _0.3.2: https://github.com/morganjwilliams/pyrolite/compare/0.3.1...0.3.2
Expand Down
2 changes: 1 addition & 1 deletion docs/source/dev/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Development History and Planning
--------------------------------

* `Changelog <changelog.html>`__
* `Future <future.html>`__
* `Roadmap <roadmap.html>`__


Contributing
Expand Down
3 changes: 1 addition & 2 deletions docs/source/dev/future.rst → docs/source/dev/roadmap.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Future
Roadmap
========

This page details some of the under-development and planned features for
Expand Down Expand Up @@ -63,7 +63,6 @@ planned be integrated over the longer term.
* assessing uncertainties



Governance and Documentation
------------------------------

Expand Down
13 changes: 13 additions & 0 deletions docs/source/gallery/tutorials/templates.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""
Creating Classification Diagrams
==================================
* Create JSON files
* Add util.classification
* Add plot.templates file
"""
#######################################################################################
# First let's pull in a simple dataset to use throughout these examples:
#
from pyrolite.util.synthetic import normal_frame
4 changes: 2 additions & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ and numerous auxiliary utilities.

- There's also a quick `installation guide <./installation.html>`__, a list of
`recent changes <./dev/changelog.html>`__ and some notes on
where the project is heading in the near `future <./dev/future.html>`__.
where the project is heading in the `roadmap <./dev/roadmap.html>`__.

- If you're interested in `contributing to the project <./dev/contributing.html>`__, there are
many potential avenues, whether you're experienced with python or not.
Expand Down Expand Up @@ -73,7 +73,7 @@ make use of your geochemical data to build and test geological models.

dev/development
dev/changelog
dev/future
dev/roadmap
dev/conduct
dev/contributing
dev/contributors
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ channels:
- defaults

dependencies:
- python=3.10
- python=3.11
# pandas and scientific python
- numpy
- numpydoc
Expand Down
26 changes: 12 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,19 @@ dependencies = [
"numpydoc",
"tinydb>4.1", # >4.1 required for read-only access mode for JSON storage
"periodictable",
"matplotlib",
"matplotlib<3.9",
"mpltern>=0.4.0",
"scipy>=1.2", # uses scipy.optimize.Bounds, added around 1.2
"sympy>=1.7",
"pandas>=1.0", # dataframe acccessors, attrs attribute
"requests", # used by alphaMELTS utilities, util.web
]

[tool.setuptools.packages]
find = { exclude = ['test*', "docs*"] } # "**/__pycache__/*"
# include = ["Aitchison/*.py"],

[tool.setuptools.dynamic]
readme = { file = "README.md", content-type = "text/markdown" }

[project.urls]
"Issue tracker" = "https://github.com/morganjwilliams/pyrolite/issues"
"Documentation" = "https://pyrolite.readthedocs.io/"
"Code" = "https://github.com/morganjwilliams/pyrolite"
Issues = "https://github.com/morganjwilliams/pyrolite/issues"
Documentation = "https://pyrolite.readthedocs.io/"
Repository = "https://github.com/morganjwilliams/pyrolite"
Changelog = "https://github.com/me/spam/blob/master/CHANGELOG.md"

[project.optional-dependencies]
docs = [
Expand Down Expand Up @@ -78,8 +72,12 @@ dev = [
"build",
]

[metadata]
url = "https://github.com/morganjwilliams/pyrolite"
[tool.setuptools.packages]
find = { exclude = ['test*', "docs*"] } # "**/__pycache__/*"
# include = ["Aitchison/*.py"],

[tool.setuptools.dynamic]
readme = { file = "README.md", content-type = "text/markdown" }

[tool.coverage.run]
relative_files = true
Expand All @@ -103,6 +101,6 @@ parentdir_prefix = "pyrolite-"

[tool.pytest.ini_options]
python_files = "*.py"
addopts = "--cov=pyrolite --cov-report html --cov-report xml --cov-report term-missing --cov-config .coveragerc"
addopts = "--cov=pyrolite --cov-report html --cov-report xml --cov-report term-missing"
testpaths = ["test"]
pythonpath = ["."]
2 changes: 1 addition & 1 deletion pyrolite/comp/aggregate.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def np_cross_ratios(X: np.ndarray, debug=False):
diags = ratios[:, np.arange(dims), np.arange(dims)]
# check all diags are 1.
assert np.allclose(diags, 1.0)
except:
except AssertionError:
# check all diags are 1. or nan
assert np.allclose(diags[~np.isnan(diags)], 1.0)

Expand Down
Loading

0 comments on commit 02d5cc0

Please sign in to comment.