Skip to content

Commit

Permalink
wrap the chemiscope shows
Browse files Browse the repository at this point in the history
  • Loading branch information
agoscinski authored and ceriottm committed Sep 28, 2023
1 parent d0d431c commit 2a1ddc1
Showing 1 changed file with 42 additions and 39 deletions.
81 changes: 42 additions & 39 deletions examples/roy_gch/roy_gch.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
`scikit-matter <https://github.com/lab-cosmo/scikit-matter>`
to make the figure.
"""

import matplotlib.tri as mtri
import numpy as np
from matplotlib import pyplot as plt
Expand Down Expand Up @@ -97,23 +96,24 @@
#

import chemiscope
chemiscope.show(
structures,
dict(
energy=energy, density=density,
hull_energy=dch_dist, structure_type=structype
),
settings={
"map": {
"x": {"property": "density"},
"y": {"property": "energy"},
"color": {"property": "hull_energy"},
"symbol": "structure_type",
"size": {"factor": 35},
if chemiscope.jupyter._is_running_in_notebook():
chemiscope.show(
structures,
dict(
energy=energy, density=density,
hull_energy=dch_dist, structure_type=structype
),
settings={
"map": {
"x": {"property": "density"},
"y": {"property": "energy"},
"color": {"property": "hull_energy"},
"symbol": "structure_type",
"size": {"factor": 35},
},
"structure": [{"unitCell": True, "supercell": {"0": 2, "1": 2, "2": 2}}],
},
"structure": [{"unitCell": True, "supercell": {"0": 2, "1": 2, "2": 2}}],
},
)
)



Expand Down Expand Up @@ -238,26 +238,29 @@
f.info["pca_" + str(j + 1)] = pca_features[i, j]
structure_properties = chemiscope.extract_properties(structures)
structure_properties.update({"per_atom_energy": energy, "hull_energy": dch_dist})
chemiscope.show(
frames=structures,
properties=structure_properties,
settings={
"map": {
"x": {"property": "pca_1"},
"y": {"property": "pca_2"},
"z": {"property": "energy"},
"symbol": "type",
"symbol": "type",
"color": {"property": "hull_energy"},
"size": {"factor": 35, "mode": "linear",
"property": "", "reverse": True},

# shows chemiscope if not run in terminal
if chemiscope.jupyter._is_running_in_notebook():
chemiscope.show(
frames=structures,
properties=structure_properties,
settings={
"map": {
"x": {"property": "pca_1"},
"y": {"property": "pca_2"},
"z": {"property": "energy"},
"symbol": "type",
"symbol": "type",
"color": {"property": "hull_energy"},
"size": {"factor": 35, "mode": "linear",
"property": "", "reverse": True},
},
"structure": [
{
"bonds": True,
"unitCell": True,
"keepOrientation": True,
}
],
},
"structure": [
{
"bonds": True,
"unitCell": True,
"keepOrientation": True,
}
],
},
)
)

0 comments on commit 2a1ddc1

Please sign in to comment.