Skip to content

Commit

Permalink
Merge branch 'release/0.1.21'
Browse files Browse the repository at this point in the history
  • Loading branch information
morganjwilliams committed Sep 19, 2019
2 parents 29d0c3a + 41fa5c6 commit 63ac7a0
Show file tree
Hide file tree
Showing 37 changed files with 578 additions and 148 deletions.
60 changes: 0 additions & 60 deletions CHANGELOG

This file was deleted.

126 changes: 126 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
Changelog
==============

All notable changes to this project will be documented here.

`Development`_
--------------

.. note:: Changes noted in this subsection are to be released in the next version.
If you're keen to check something out before its released, you can use a
`development install <installation.html#development-installation>`__.


`0.1.21`_
--------------

* Parallel coordinate plots
* Updated :func:`~pyrolite.plot.pyroplot.scatter` and
:func:`~pyrolite.plot.tern.ternary` to better deal with colormaps
* Updated alphaMELTS interface
* Docs
* Updated to default to tables with percentages (Wt%, Vol%)
* Updated plot templates y-labels
* Fixed automation grid bug

`0.1.20`_
--------------

New
~~~~~~~~

* Stub for DataFrame.pyrochem accessor (yet to be developed)
* Added :func:`pyrolite.util.skl.vis.plot_mapping` for manifold dimensional reduction
* Added :func:`pyrolite.util.skl.vis.alphas_from_multiclass_prob` for visualising
multi-class classification probabilities in scatter plots

Updates
~~~~~~~~

* Convert reference compositions and normalisation to use a JSON database
* Updated default y-aspect for ternary plots and axes patches
* Updated :mod:`pyrolite.ext.alphamelts.automation`,
:mod:`pyrolite.ext.alphamelts.meltsfile`, :mod:`pyrolite.ext.alphamelts.tables`
* Updated docs to use :class:`pyrolite.ext.alphamelts.automation.MeltsBatch` with a parameter grid
* Added :mod:`pyrolite.plot.biplot` to API docs

`0.1.19`_
--------------

`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`_
--------------


.. _Development: https://github.com/morganjwilliams/pyrolite/compare/0.1.21...develop
.. _0.1.21: https://github.com/morganjwilliams/pyrolite/compare/0.1.20...0.1.21
.. _0.1.20: https://github.com/morganjwilliams/pyrolite/compare/0.1.19...0.1.20
.. _0.1.19: https://github.com/morganjwilliams/pyrolite/compare/0.1.18...0.1.19
.. _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
15 changes: 10 additions & 5 deletions docs/examples/alphamelts/montecarlo.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def blur_compositions(df, noise=0.05, scale=100):
df[compositional] = df[compositional].astype(float).renormalise()
df[compositional] = blur_compositions(df[compositional])

df.Title = df.Title + " " + df.index.map(str) # differentiate titles
df.Title = df.Title + " " + df.index.map(str) # differentiate titles
df.Title = df.Title.apply(slugify)
# %% setup an environment for isobaric fractional crystallisation
from pyrolite.ext.alphamelts.env import MELTS_Env
Expand Down Expand Up @@ -79,24 +79,29 @@ def blur_compositions(df, noise=0.05, scale=100):
"modes": ["isobaric"],
},
grid={
#"Initial Pressure": [3000, 7000],
# "Initial Pressure": [3000, 7000],
"Log fO2 Path": [None, "FMQ"],
#"modifychem": [None, {"H2O": 0.5}],
# "modifychem": [None, {"H2O": 0.5}],
},
env=env,
logger=logger,
fromdir=tempdir,
)

batch.grid # [{}, {'Log fO2 Path': 'FMQ'}]

batch.run(
overwrite=True
) # overwrite=False if you don't want to update existing exp folders

# %% aggregate the results over the same gridded space
from pathlib import Path
from pyrolite.ext.alphamelts.tables import get_experiments_summary
from pyrolite.ext.alphamelts.plottemplates import table_by_phase

summary = get_experiments_summary(tempdir / "isobar5kbar", kelvin=False)
fig = table_by_phase(summary, plotswide=2, figsize=(10, 5))
tempdir = Path("./") / "montecarlo"

summary = get_experiments_summary(tempdir / "isobar5kbar1300-800C", kelvin=False)
fig = table_by_phase(summary, table="phasemass", plotswide=2, figsize=(10, 8))
# %% save figure
save_figure(fig, save_at="../../source/_static", name="melts_montecarlo")
14 changes: 10 additions & 4 deletions docs/examples/plotting/logo.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@

np.random.seed(82)
# %% colors ----------------------------------------------------------------------------
t10b3 = [ # tableau 10 colorblind safe colors, a selection of 3
(r / 255.0, g / 255.0, b / 255.0)
for r, g, b in [(0, 107, 164), (171, 171, 171), (89, 89, 89), (95, 158, 209)]
t10b3 = [ # tableau 10 colorblind safe colors, a selection of 4
(0, 107, 164),
(171, 171, 171),
(89, 89, 89),
(95, 158, 209)
]
t10b3 = [(r / 255.0, g / 255.0, b / 255.0) for r, g, b in t10b3]
# %% data and transforms ---------------------------------------------------------------
d = 1.0 # distance from centre
sig = 0.1 # scale for variance
Expand All @@ -45,7 +48,7 @@
)

means = ILRTransform().inverse_transform(means) # compositional means (D=3)
size = 2000 # logo @ 10000
size = 2000 # logo @ 10000
pts = [random_composition(mean=M, cov=C, size=size) for M, C in zip(means, covs)]

T = ILRTransform()
Expand Down Expand Up @@ -110,6 +113,9 @@
fmts = ["png", "jpg"]
save_axes(ax[1], name="icon", save_at=save_at, save_fmts=fmts, dpi=dpi)
save_axes(ax[1], name="icon_small", save_at=save_at, save_fmts=fmts, dpi=60)

save_axes(ax[1], name="sticker", save_at=save_at, save_fmts=["pdf"], dpi=dpi)

ax[0].set_title("Synthetic Data")
ax[1].set_title("Covariance Ellipses and PCA Vectors")
ax[-2].set_title("Individual Density, with Contours")
Expand Down
44 changes: 44 additions & 0 deletions docs/examples/plotting/parallel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.axes
import pyrolite.plot
import pyrolite.data.Aitchison

# %% Data
# let's load up an example dataset from Aitchison
df = pyrolite.data.Aitchison.load_coxite()
comp = [
i for i in df.columns if i not in ["Depth", "Porosity"]
] # compositional data variables
# %% Default
ax = df.pyroplot.parallel()
# %% save
from pyrolite.util.plot import save_figure

save_figure(ax.figure, save_at="../../source/_static", name="parallel_default")
# %% Default Rescale
ax = df.pyroplot.parallel(rescale=True)
# %% save
save_figure(ax.figure, save_at="../../source/_static", name="parallel_rescale")
# %% CLR
from pyrolite.util.skl.transform import CLRTransform

cmap = "inferno"
compdata = df.copy()
compdata[comp] = CLRTransform().transform(compdata[comp])
ax = compdata.loc[:, comp].pyroplot.parallel(color_by=compdata.Depth.values, cmap=cmap)

# we can add a meaningful colorbar to indicate one variable also, here Depth
sm = plt.cm.ScalarMappable(cmap=cmap)
sm.set_array(df.Depth)
plt.colorbar(sm)
# %% save
save_figure(ax.figure, save_at="../../source/_static", name="parallel_CLR")
# %% CLR Rescale
ax = compdata.loc[:, comp].pyroplot.parallel(
rescale=True, color_by=compdata.Depth.values, cmap=cmap
)
plt.colorbar(sm)
# %% save
save_figure(ax.figure, save_at="../../source/_static", name="parallel_CLR_rescale")
Binary file modified docs/source/_static/logo_eg_all.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/_static/logo_eg_all.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/_static/logo_eg_contours.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/_static/logo_eg_contours.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/_static/logo_eg_density.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/_static/logo_eg_density.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/_static/logo_eg_ellipses.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/_static/logo_eg_ellipses.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/_static/logo_eg_points.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/_static/logo_eg_points.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/_static/melts_montecarlo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/parallel_CLR.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/parallel_CLR_rescale.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/parallel_default.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/parallel_rescale.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Changelog
=============

.. include:: ../../CHANGELOG.rst
:start-line: 3
5 changes: 3 additions & 2 deletions docs/source/contributors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ Contributors
This list includes people who have contributed to the project in the form of code,
comments, testing, bug reports, feature requests.

* Morgan Williams
* `Morgan Williams <https://github.com/morganjwilliams>`__`
* Hayden Dalton
* Louise Schoneveld
* `Louise Schoneveld <https://github.com/lavender22>`__
* Adam Bath
* Yajing Mao
* `Justin Gosses <https://github.com/JustinGOSSES>`__.
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ make use of your geochemical data to build and test geological models.
installation
usage/examples
submodules
changelog
future
tests
contributing
Expand Down
19 changes: 12 additions & 7 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ on `PyPi <https://pypi.org/project/pyrolite/>`_ using the :code:`--upgrade` flag
pip install --upgrade pyrolite
Development Installation
----------------------------

To access and use the development version, you can either
`clone the repository <https://github.com/morganjwilliams/pyrolite>`__ or install
via pip directly from GitHub:

.. code-block:: bash
pip install git+git://github.com//morganjwilliams/pyrolite.git@develop#egg=pyrolite
Optional Dependencies and Local Development
-------------------------------------------

Expand All @@ -33,10 +45,3 @@ For example:
pip install pyrolite[dev]
pip install pyrolite[dev,skl,spatial,db]
To download the development version, you can install via pip directly from GitHub:

.. code-block:: bash
pip install git+git://github.com//morganjwilliams/pyrolite.git@develop#egg=pyrolite
6 changes: 6 additions & 0 deletions docs/source/submoddoc/plot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ pyrolite\.plot\.stem
:members:
:undoc-members:

pyrolite\.plot\.parallel
-------------------------------
.. automodule:: pyrolite.plot.parallel
:members:
:undoc-members:

pyrolite\.plot\.biplot
-------------------------------
.. automodule:: pyrolite.plot.biplot
Expand Down

0 comments on commit 63ac7a0

Please sign in to comment.