From df67f77148f7f6f1a90eec4cf5f40601c76dea64 Mon Sep 17 00:00:00 2001 From: Michele Ceriotti Date: Mon, 29 Jul 2024 15:48:05 +0200 Subject: [PATCH] Cleaned up and fixed a rename bug --- python/chemiscope/explore.py | 3 ++- python/examples/6-explore.py | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/python/chemiscope/explore.py b/python/chemiscope/explore.py index f713c0c64..61760123d 100644 --- a/python/chemiscope/explore.py +++ b/python/chemiscope/explore.py @@ -1,4 +1,5 @@ import os + from .jupyter import show @@ -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 diff --git a/python/examples/6-explore.py b/python/examples/6-explore.py index 488a1e991..bb57a8125 100644 --- a/python/examples/6-explore.py +++ b/python/examples/6-explore.py @@ -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( @@ -138,7 +138,7 @@ 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) # %% # @@ -146,7 +146,7 @@ def soap_kpca(frames): # 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) # %% #