Skip to content

Commit

Permalink
Merge branch 'release/0.1.19'
Browse files Browse the repository at this point in the history
  • Loading branch information
morganjwilliams committed Jul 9, 2019
2 parents 453f444 + 0c5086a commit a70e971
Show file tree
Hide file tree
Showing 35 changed files with 857 additions and 158 deletions.
60 changes: 60 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Changelog
All notable changes to this project will be documented in this file.

## [Unreleased]

## [0.1.18]

## [0.1.17]

## [0.1.16]

## [0.1.15]

## [0.1.14]

## [0.1.13]

## [0.1.12]

## [0.1.11]

## [0.1.10]

## [0.1.9]

## [0.1.8]

## [0.1.7]

## [0.1.6]

## [0.1.5]

## [0.1.4]

## [0.1.2]

## [0.1.1]

## [0.1.0]

[Unreleased]: https://github.com/morganjwilliams/pyrolite/compare/0.1.18...develop
[0.1.18]: https://github.com/morganjwilliams/pyrolite/compare/0.1.17...0.1.18
[0.1.17]: https://github.com/morganjwilliams/pyrolite/compare/0.1.16...0.1.17
[0.1.16]: https://github.com/morganjwilliams/pyrolite/compare/0.1.15...0.1.16
[0.1.15]: https://github.com/morganjwilliams/pyrolite/compare/0.1.14...0.1.15
[0.1.14]: https://github.com/morganjwilliams/pyrolite/compare/0.1.13...0.1.14
[0.1.13]: https://github.com/morganjwilliams/pyrolite/compare/0.1.12...0.1.13
[0.1.12]: https://github.com/morganjwilliams/pyrolite/compare/0.1.11...0.1.12
[0.1.11]: https://github.com/morganjwilliams/pyrolite/compare/0.1.10...0.1.11
[0.1.10]: https://github.com/morganjwilliams/pyrolite/compare/0.1.9...0.1.10
[0.1.9]: https://github.com/morganjwilliams/pyrolite/compare/0.1.8...0.1.9
[0.1.8]: https://github.com/morganjwilliams/pyrolite/compare/0.1.7...0.1.8
[0.1.7]: https://github.com/morganjwilliams/pyrolite/compare/0.1.6...0.1.7
[0.1.6]: https://github.com/morganjwilliams/pyrolite/compare/0.1.5...0.1.6
[0.1.5]: https://github.com/morganjwilliams/pyrolite/compare/0.1.4...0.1.5
[0.1.4]: https://github.com/morganjwilliams/pyrolite/compare/0.1.2...0.1.4
[0.1.2]: https://github.com/morganjwilliams/pyrolite/compare/0.1.1...0.1.2
[0.1.1]: https://github.com/morganjwilliams/pyrolite/compare/0.1.0...0.1.1
[0.1.0]: https://github.com/morganjwilliams/pyrolite/compare/0.0.17...0.1.0
10 changes: 9 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
include versioneer.py
include pyrolite/_version.py
include LICENSE
recursive-include pyrolite/data *
recursive-include pyrolite/data/Aitchison *
include pyrolite/data/alphamelts/env.py
recursive-include pyrolite/data/geochem *
recursive-include pyrolite/data/models *
recursive-include pyrolite/data/refcomp *
recursive-include pyrolite/data/shannon *
recursive-include pyrolite/data/timescale *
exclude pyrolite/data/alphamelts/localinstall
global-exclude __pycache__
17 changes: 11 additions & 6 deletions docs/examples/alphamelts/automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
import numpy as np
from pyrolite.util.synthetic import test_df

df = test_df(cols=["SiO2", "CaO", "MgO", "FeO", "TiO2", "Na2O", "K2O", "P2O5"]) * 100
df = (
test_df(
cols=["SiO2", "CaO", "MgO", "FeO", "TiO2", "Na2O", "K2O", "P2O5"],
index_length=5,
)
* 100
)
df["Sample"] = np.arange(df.index.size)
# %% setup environment
from pyrolite.ext.alphamelts.env import MELTS_Env
Expand All @@ -17,9 +23,6 @@
env.MINP = 2000
env.DELTAT = -3

with open("pyrolite_envfile.txt", "w") as f: # write the environment to a file
f.write(env.to_envfile(unset_variables=False))
# %% setup dataframe
# taking a dataframe with oxide/element headers, set up experiment info
df["Title"] = df.Sample
df["Initial Pressure"] = 7000
Expand All @@ -34,11 +37,13 @@
df.loc[ix, :], # take the specific row
writetraces=False, # ignore trace element data
modes=[
"isobaric",
"isenthalpic",
"fractionate solids",
], # conduct an isobaric experiment where solids are fractionated
exclude=["P2O5", "K2O"], # exclude potassium and phosphorous
)
# create an experiment folder to work in, add the meltsfile and environment file
exp = MeltsExperiment(meltsfile=meltsfile, title=str(df.loc[ix, "Title"]), env=env)
exp = MeltsExperiment(
meltsfile=meltsfile, title="test" + str(df.loc[ix, "Title"]), env=env
)
exp.run(superliquidus_start=True)
35 changes: 35 additions & 0 deletions docs/examples/alphamelts/meltsweb.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from pyrolite.ext.alphamelts.web import *


def default_datadict():
d = {}
d["title"] = ("TestREST",)
d["initialize"] = {
"SiO2": 48.68,
"TiO2": 1.01,
"Al2O3": 17.64,
"Fe2O3": 0.89,
"Cr2O3": 0.0425,
"FeO": 7.59,
"MnO": 0.0,
"MgO": 9.10,
"NiO": 0.0,
"CoO": 0.0,
"CaO": 12.45,
"Na2O": 2.65,
"K2O": 0.03,
"P2O5": 0.08,
"H2O": 0.20,
}
d["calculationMode"] = "findLiquidus"
d["constraints"] = {"setTP": {"initialT": 1200, "initialP": 1000}}
return d


D = default_datadict()
# %% Oxides
melts_oxides(D)
# %% Phases
melts_phases(D)
# %% Compute
melts_compute(D)
2 changes: 1 addition & 1 deletion docs/examples/alphamelts/montecarlo.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
["SiO2", "Al2O3", "FeO", "MnO", "MgO", "CaO", "Na2O", "TiO2", "K2O", "P2O5"],
"value",
]
MORB

MORB["Title"] = Gale_MORB.ModelName
MORB["Initial Temperature"] = 1300
MORB["Final Temperature"] = 800
Expand Down
20 changes: 20 additions & 0 deletions docs/examples/geochem/convert_chemistry.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from pyrolite.geochem.transform import convert_chemistry
# %% Random data
import numpy as np
import pandas as pd
from pyrolite.util.synthetic import test_df

np.random.seed(82)
df = (test_df(cols=["MgO", "SiO2", "FeO", "CaO", "Na2O"]) * 100).join(
test_df(cols=["Ca", "Te", "K", "Na"]) * 1000
)
# %% Unit Conversion
from pyrolite.geochem.ind import common_elements
from pyrolite.geochem.norm import scale

ppm_cols = [i for i in df.columns if i in common_elements()] # elemental headers
df.loc[:, ppm_cols] *= scale("ppm", "wt%")
# Conversion
new_df = convert_chemistry(
df, to=["MgO", "SiO2", "FeO", "CaO", "Te", "Na", "Na/Te", "MgO/SiO2"]
)
File renamed without changes.
38 changes: 0 additions & 38 deletions docs/examples/web_interfaces/melts_web.py

This file was deleted.

6 changes: 6 additions & 0 deletions docs/source/submoddoc/ext/alphamelts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ pyrolite\.ext\.alphamelts\.tables
:members:
:undoc-members:

pyrolite\.ext\.alphamelts\.plottemplates
---------------------------------------
.. automodule:: pyrolite.ext.alphamelts.plottemplates
:members:
:undoc-members:

pyrolite\.ext\.alphamelts\.util
---------------------------------------
.. automodule:: pyrolite.ext.alphamelts.util
Expand Down
7 changes: 0 additions & 7 deletions docs/source/submoddoc/external.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,3 @@ pyrolite\.ext\.datarepo
:maxdepth: 2

ext/datarepo


pyrolite\.ext\.iogas
-------------------------------
.. automodule:: pyrolite.ext.iogas
:members:
:undoc-members:
3 changes: 2 additions & 1 deletion docs/source/tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Tests
.. seealso:: `Contributing <contributing.html>`__

If you clone the source repository, unit tests can be run using pytest from the root
directory after installation:
directory after installation with development dependencies
(:code:`pip install -e .[dev]`):

.. code-block:: bash
Expand Down
14 changes: 4 additions & 10 deletions docs/source/usage/eg/alphamelts/automation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,21 @@ especially for established workflows or repetitive calculations.
:language: python
:end-before: # %% testdf

First we can configure an environment, which in this case is written to file:
First we can configure an environment, which in this case is written to file.
We can then add individual experiment parameters to the :code:`~pandas.DataFrame`:

.. literalinclude:: ../../../../examples/alphamelts/automation.py
:language: python
:start-after: # %% setup environment
:end-before: # %% setup dataframe

We can then add individual experiment parameters to the dataframe:

.. literalinclude:: ../../../../examples/alphamelts/automation.py
:language: python
:start-after: # %% setup dataframe
:end-before: # %% autorun

And finally, we can run an experiment for each composition in the dataframe:
And finally, we can run an experiment for each composition in the
:code:`~pandas.DataFrame`:

.. literalinclude:: ../../../../examples/alphamelts/automation.py
:language: python
:start-after: # %% autorun


.. seealso::

Examples:
Expand Down

0 comments on commit a70e971

Please sign in to comment.