diff --git a/smt/surrogate_models/gpx.py b/smt/surrogate_models/gpx.py index 8a2993d9b..844a1b5e7 100644 --- a/smt/surrogate_models/gpx.py +++ b/smt/surrogate_models/gpx.py @@ -1,5 +1,4 @@ import numpy as np -import pickle from smt.surrogate_models.surrogate_model import SurrogateModel @@ -173,7 +172,6 @@ def save(self, filename): """ self._gpx.save(filename) - @staticmethod def load(filepath): """Load the model from a previously saved GPX model. diff --git a/smt/surrogate_models/idw.py b/smt/surrogate_models/idw.py index bb489aba7..aa08b3776 100644 --- a/smt/surrogate_models/idw.py +++ b/smt/surrogate_models/idw.py @@ -5,7 +5,6 @@ This package is distributed under New BSD license. """ -import pickle import numpy as np from smt.surrogate_models.idwclib import PyIDW @@ -133,22 +132,3 @@ def _predict_output_derivatives(self, x): dy_dyt = {None: jac} return dy_dyt - - def _save(self, filename=None): - if filename is None: - filename = self.filename - - try: - with open(filename, 'wb') as file: - pickle.dump(self, file) - print("model saved") - except: - print("Couldn't save the model") - - def _load(self, filename): - if filename is None: - return ("file is not found") - else: - with open(filename, "rb") as file: - sm2 = pickle.load(file) - return sm2 diff --git a/smt/surrogate_models/rbf.py b/smt/surrogate_models/rbf.py index fbe5c213f..90912f282 100644 --- a/smt/surrogate_models/rbf.py +++ b/smt/surrogate_models/rbf.py @@ -5,7 +5,6 @@ """ import numpy as np -import pickle from scipy.sparse import csc_matrix from smt.surrogate_models.rbfclib import PyRBF @@ -215,22 +214,3 @@ def _predict_output_derivatives(self, x): dy_dyt = (dytl_dyt.T.dot(dstates_dytl.T).dot(dy_dstates.T)).T dy_dyt = np.einsum("ij,k->ijk", dy_dyt, np.ones(ny)) return {None: dy_dyt} - - def _save(self, filename=None): - if filename is None: - filename = self.filename - - try: - with open(filename, 'wb') as file: - pickle.dump(self, file) - print("model saved") - except: - print("Couldn't save the model") - - def _load(self, filename): - if filename is None: - return ("file is not found") - else: - with open(filename, "rb") as file: - sm2 = pickle.load(file) - return sm2 diff --git a/smt/surrogate_models/rmts.py b/smt/surrogate_models/rmts.py index c0ebac2a8..a672e4e3f 100644 --- a/smt/surrogate_models/rmts.py +++ b/smt/surrogate_models/rmts.py @@ -7,7 +7,6 @@ from numbers import Integral import numpy as np -import pickle import scipy.sparse from smt.surrogate_models.surrogate_model import SurrogateModel @@ -585,22 +584,3 @@ def _predict_output_derivatives(self, x): dy_dyt[kx - 1] = np.einsum("ij,jkl->ikl", dy_dw, dw_dyt) return dy_dyt - - def _save(self, filename=None): - if filename is None: - filename = self.filename - - try: - with open(filename, 'wb') as file: - pickle.dump(self, file) - print("model saved") - except: - print("Couldn't save the model") - - def _load(self, filename): - if filename is None: - return ("file is not found") - else: - with open(filename, "rb") as file: - sm2 = pickle.load(file) - return sm2