Skip to content

Commit

Permalink
Cleaned up and fixed a rename bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ceriottm committed Jul 29, 2024
1 parent 6d69d1c commit df67f77
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion python/chemiscope/explore.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os

from .jupyter import show


Expand Down Expand Up @@ -103,7 +104,7 @@ def soap_kpca_featurize(frames):

# Use default featurizer
else:
X_reduced = soap_pca(frames)
X_reduced = soap_pca_featurize(frames)

# Add dimensionality reduction results to properties
properties["features"] = X_reduced
Expand Down
8 changes: 4 additions & 4 deletions python/examples/6-explore.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ def fetch_dataset(filename, base_url="https://zenodo.org/records/12748925/files/

# %%
#
# Define the function ``soap_kpca`` which takes one argument (``frames``). This argument
# Define the function ``soap_kpca_featurize`` which takes one argument (``frames``). This argument
# contains the structures provided to :py:func:`chemiscope.explore` and is internally
# passed to the ``featurize`` function.


def soap_kpca(frames):
def soap_kpca_featurize(frames):
# Initialise soap calculator. The detailed explanation of the provided
# hyperparameters can be checked in the documentation of the library (``dscribe``).
soap = SOAP(
Expand Down Expand Up @@ -138,15 +138,15 @@ def soap_kpca(frames):
#
# Provide the created function to :py:func:`chemiscope.explore`.

cs = chemiscope.explore(frames, featurize=soap_kpca)
cs = chemiscope.explore(frames, featurize=soap_kpca_featurize)

# %%
#
# We can also provide the additional properties inside, for example, let's extract
# energy from the frames using :py:func:`chemiscope.extract_properties`.

properties = chemiscope.extract_properties(frames, only=["energy"])
cs = chemiscope.explore(frames, featurize=soap_kpca, properties=properties)
cs = chemiscope.explore(frames, featurize=soap_kpca_featurize, properties=properties)

# %%
#
Expand Down

0 comments on commit df67f77

Please sign in to comment.