Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BurnMan 2.1 #616

Merged
merged 3 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.14165625.svg)](https://doi.org/10.5281/zenodo.14165625)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.14238360.svg)](https://doi.org/10.5281/zenodo.14238360)
[![DOI](https://joss.theoj.org/papers/10.21105/joss.05389/status.svg)](https://doi.org/10.21105/joss.05389)

# BurnMan - a Python toolkit for planetary geophysics, geochemistry and thermodynamics
Expand Down Expand Up @@ -42,8 +42,8 @@ If you use BurnMan in your work, we ask that you cite the following publications

- Myhill, R., Cottaar, S., Heister, T., Rose, I., Unterborn, C.,
Dannberg, J., Gassmoeller, R. and Farla, R. (2024):
BurnMan v2.0.0 [Software]. Computational Infrastructure for Geodynamics. Zenodo.
https://doi.org/10.5281/zenodo.14165625
BurnMan v2.1.0 [Software]. Computational Infrastructure for Geodynamics. Zenodo.
https://doi.org/10.5281/zenodo.14238360

- Cottaar S., Heister, T., Rose, I., and Unterborn, C., (2014). BurnMan: A
lower mantle mineral physics toolkit, Geochemistry, Geophysics, and
Expand Down
4 changes: 2 additions & 2 deletions burnman/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@

- Myhill, R., Cottaar, S., Heister, T., Rose, I., Unterborn, C.,
Dannberg, J., Gassmoeller, R. and Farla, R. (2024):
BurnMan v2.0.0 [Software]. Computational Infrastructure for Geodynamics. Zenodo.
`(https://doi.org/10.5281/zenodo.14165625) <https://doi.org/10.5281/zenodo.14165625>`_
BurnMan v2.1.0 [Software]. Computational Infrastructure for Geodynamics. Zenodo.
`(https://doi.org/10.5281/zenodo.14238360) <https://doi.org/10.5281/zenodo.14238360>`_

- Cottaar S., Heister, T., Rose, I., and Unterborn, C., (2014). BurnMan: A
lower mantle mineral physics toolkit, Geochemistry, Geophysics, and
Expand Down
20 changes: 17 additions & 3 deletions burnman/classes/polytope.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,28 @@
from scipy.spatial import Delaunay
from scipy.special import comb
from copy import copy
import cdd as cdd_float

from .material import cached_property

from ..utils.math import independent_row_indices


# Try to import pycddlib.
# First, try separating the imports into float and
# fractional, then fall back to only using the float
# representation, and finally don't import anything
# (limiting functionality)
try:
cdd_float = importlib.import_module("cdd")
cdd_fraction = importlib.import_module("cdd.gmp")
cdd_gmp_loaded = True
except ImportError:
cdd_fraction = importlib.import_module("cdd")
cdd_gmp_loaded = False
try:
cdd_float = importlib.import_module("cdd")
cdd_fraction = importlib.import_module("cdd")
cdd_gmp_loaded = False
except ImportError:
cdd_float = None


class SimplexGrid(object):
Expand Down Expand Up @@ -140,6 +149,11 @@ def __init__(
dependent endmembers are defined.
:type independent_endmember_occupancies: numpy.array (2D) or None
"""
if cdd_float is None:
raise ImportError(
"You need to install pycddlib to create a MaterialPolytope object."
)

if equalities.dtype != inequalities.dtype:
raise Exception(
f"The equalities and inequalities arrays should have the same type ({equalities.dtype} != {inequalities.dtype})."
Expand Down
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Changelog
---------
Release v2.1.0 (November 28, 2024) includes
- New: Added MACAW and SPOCK Equations of State
- Changed: pycddlib returned to optional dependency as hard to install on Windows.

Release v2.0.0 (November 14, 2024) includes
- Compatibility with Python 3.12.
- Compatibility with new versions of numpy (1.26.0), scipy (1.14.0),
Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ If you use BurnMan in your work, we ask that you cite the following publications

- Myhill, R., Cottaar, S., Heister, T., Rose, I., Unterborn, C.,
Dannberg, J., Gassmoeller, R. and Farla, R. (2024):
BurnMan v2.0.0 [Software]. Computational Infrastructure for Geodynamics. Zenodo.
`(https://doi.org/10.5281/zenodo.14165625) <https://doi.org/10.5281/zenodo.14165625>`_
BurnMan v2.1.0 [Software]. Computational Infrastructure for Geodynamics. Zenodo.
`(https://doi.org/10.5281/zenodo.14238360) <https://doi.org/10.5281/zenodo.14238360>`_

- Cottaar S., Heister, T., Rose, I., and Unterborn, C. (2014). BurnMan: A
lower mantle mineral physics toolkit, Geochemistry, Geophysics, and
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "burnman"
version = "2.0.1a0"
version = "2.1.1a"
description = "A thermoelastic and thermodynamic toolkit for the Earth and planetary sciences"
license = "GPL"
authors = ["The BurnMan Team <[email protected]>",]
Expand All @@ -25,12 +25,15 @@ sympy = "^1.12"
cvxpy = "^1.3"
matplotlib = "^3.7"
numba = "^0.59"
pycddlib-standalone = "^3.0"
pycddlib-standalone = {version = "^3.0", optional = true}

[tool.poetry.dev-dependencies]
ipython = "^8.5"
numba = "^0.59"

[tool.poetry.extras]
dev = ["pycddlib-standalone"]

[tool.poetry.group.dev.dependencies]
black = "24.1.1"

Expand Down
6 changes: 5 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fi
$PYTHON --version
# Quietly install burnman in development mode
echo "Installing BurnMan in development mode ..."
$PYTHON -m pip install -q -e .
$PYTHON -m pip install -q -e .[dev]
echo ""

echo "Dependency tree:"
Expand All @@ -30,6 +30,10 @@ pycddlib_version=`pip freeze | grep "pycddlib=" | awk -F"==" '{print $2}'`
if [ ! -z "${pycddlib_version}" ]
then echo "└── pycddlib [optional, installed: ${pycddlib_version}]"
fi
pycddlib_version=`pip freeze | grep "pycddlib-standalone=" | awk -F"==" '{print $2}'`
if [ ! -z "${pycddlib_version}" ]
then echo "└── pycddlib-standalone [optional, installed: ${pycddlib_version}]"
fi
echo ""

# Quietly install optional modules after burnman
Expand Down