From a500a8f22d0e7d6a52cb0c7d0edf2b0b8a4a9b5a Mon Sep 17 00:00:00 2001 From: sgbaird Date: Thu, 22 Jun 2023 17:56:51 -0600 Subject: [PATCH 01/11] add matbench explicitly From 57267298a281a580d93b22c324c1c2c4d1e9775d Mon Sep 17 00:00:00 2001 From: sgbaird Date: Thu, 22 Jun 2023 17:57:22 -0600 Subject: [PATCH 02/11] add gridrdf and min version for matbench_genmetrics, add matbench explicitly From 65e8d40c8f752bd512c4ca9b2eeecc2f8e7d4e41 Mon Sep 17 00:00:00 2001 From: sgbaird Date: Thu, 22 Jun 2023 17:57:31 -0600 Subject: [PATCH 03/11] add gridrdf_helper test From c766fd773398d86fd3b5b968d5d026c9fd08884b Mon Sep 17 00:00:00 2001 From: sgbaird Date: Thu, 22 Jun 2023 17:57:54 -0600 Subject: [PATCH 04/11] based on example from gridrdf repo https://github.com/CumbyLab/gridrdf/blob/28ff373959390ca4140aa3ba10817c9fd9eda1f1/examples/direct_GRID_calculation_without_files.py From ccefa5f75504e54ffdc93a1e66594e25ebaa566c Mon Sep 17 00:00:00 2001 From: sgbaird Date: Thu, 22 Jun 2023 17:58:17 -0600 Subject: [PATCH 05/11] GridRDFWrapper Consider moving wrappers (and relevant imports) to a separate file to avoid import errors From 23ec30711c29d8e77212327bd07218f45d8e3470 Mon Sep 17 00:00:00 2001 From: sgbaird Date: Thu, 22 Jun 2023 17:58:26 -0600 Subject: [PATCH 06/11] gridrdf similarity matrix data From 7386ba6b9dc1d2904a0a20ee5a46cd16a03c4a61 Mon Sep 17 00:00:00 2001 From: sgbaird Date: Thu, 22 Jun 2023 17:58:35 -0600 Subject: [PATCH 07/11] Update structurally-aware-mat-discover-grid-rdf.ipynb From 9041313cba7d8fbca4718c1b14ed13b0bc930d47 Mon Sep 17 00:00:00 2001 From: sgbaird Date: Thu, 22 Jun 2023 20:12:34 -0600 Subject: [PATCH 08/11] append --> concat for pandas dataframes --- examples/crabnet_performance.py | 3 ++- mat_discover/adaptive_design.py | 2 +- mat_discover/mat_discover_.py | 4 ++-- mat_discover/utils/extraordinary.py | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/crabnet_performance.py b/examples/crabnet_performance.py index 54edd42..c3819e8 100644 --- a/examples/crabnet_performance.py +++ b/examples/crabnet_performance.py @@ -4,6 +4,7 @@ # TODO: incorporate CrabNet uncertainty into search """ from crabnet.crabnet_ import CrabNet +import pandas as pd # %% imports from tqdm import tqdm @@ -82,7 +83,7 @@ idx = perf_val_df.pred.idxmax() # idx = np.where(val_pred == max(val_pred))[0][0] move_row = perf_val_df.loc[idx] - perf_train_df.append(move_row) + perf_train_df = pd.concat((perf_train_df, move_row)) perf_val_df = perf_val_df.drop(index=idx) next_experiments.append(move_row.to_dict()) experiment = ad_experiments_metrics( diff --git a/mat_discover/adaptive_design.py b/mat_discover/adaptive_design.py index 6b68ee8..7a2b14c 100644 --- a/mat_discover/adaptive_design.py +++ b/mat_discover/adaptive_design.py @@ -150,7 +150,7 @@ def suggest_next_experiment( # append compound to train, remove from val, and reset indices # https://stackoverflow.com/a/12204428/13697228 move_row = self.val_df[self.val_df.index == next_index] - self.train_df = self.train_df.append(move_row) + self.train_df = pd.concat((self.train_df, move_row)) self.val_df = self.val_df[self.val_df.index != next_index] # self.val_df = self.val_df.drop(index=next_index) diff --git a/mat_discover/mat_discover_.py b/mat_discover/mat_discover_.py index 0b9f705..ec28d81 100644 --- a/mat_discover/mat_discover_.py +++ b/mat_discover/mat_discover_.py @@ -813,8 +813,8 @@ def predict( f"self.val_rad_neigh_avg` and `self.val_k_neigh_avg` are being assigned the same values as `val_dens` for compatibility reasons since a non-DiSCoVeR novelty learner was specified: {self.novelty_learner}." ) # composition-based featurization - X_train: Union[pd.DataFrame, np.ndarray, List] = [] - X_val: Union[pd.DataFrame, np.ndarray, List] = [] + X_train: Union[np.ndarray, List] = [] + X_val: Union[np.ndarray, List] = [] assert self.train_inputs is not None if self.novelty_prop == "mod_petti": assert isinstance(X_train, list) diff --git a/mat_discover/utils/extraordinary.py b/mat_discover/utils/extraordinary.py index 3fae521..602acfb 100644 --- a/mat_discover/utils/extraordinary.py +++ b/mat_discover/utils/extraordinary.py @@ -17,7 +17,7 @@ def extraordinary_split( ): # set aside high-performing candidates if val_df is not None: - train_val_df = train_df.append(val_df) + train_val_df = pd.concat((train_df, val_df)) else: train_val_df = train_df @@ -31,7 +31,7 @@ def extraordinary_split( train_df, val_df = train_test_split( train_val_df, train_size=train_size, random_state=random_state ) - val_df = val_df.append(extraordinary_df) + val_df = pd.concat((val_df, extraordinary_df)) return train_df, val_df, extraordinary_thresh From 1a94263cd7ac33ddcd8ac0810289467460e389f1 Mon Sep 17 00:00:00 2001 From: sgbaird Date: Thu, 22 Jun 2023 21:25:38 -0600 Subject: [PATCH 09/11] try specifying torch < 2 Related to https://github.com/sparks-baird/CrabNet/issues/70 Maybe related to https://github.com/sparks-baird/mat_discover/issues/149 --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index e3bc043..2fae922 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,6 +33,7 @@ dependencies = [ "umap-learn", "dill", "crabnet >=2.0.5,<3.0.0", + "torch <2" "chem_wasserstein >=1.0.8,<2.0.0", "composition_based_feature_vector", "matbench_genmetrics >= 0.6.1", From 45a6f384e20d3715e52a1a9bf15cde9616b3016a Mon Sep 17 00:00:00 2001 From: sgbaird Date: Thu, 22 Jun 2023 21:33:53 -0600 Subject: [PATCH 10/11] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1480220..2725815 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,6 +6,6 @@ repos: # - id: end-of-file-fixer # - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 19.3b0 + rev: 23.3.0 hooks: - id: black From 9f45169e444ef2af22513cab0af6ae9ad56e801d Mon Sep 17 00:00:00 2001 From: sgbaird Date: Thu, 22 Jun 2023 21:34:29 -0600 Subject: [PATCH 11/11] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2fae922..322a35e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ dependencies = [ "umap-learn", "dill", "crabnet >=2.0.5,<3.0.0", - "torch <2" + "torch <2", "chem_wasserstein >=1.0.8,<2.0.0", "composition_based_feature_vector", "matbench_genmetrics >= 0.6.1",