Skip to content

Commit

Permalink
ruff check modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine-Averland committed Dec 9, 2024
1 parent 360d6c7 commit c324dca
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 62 deletions.
2 changes: 0 additions & 2 deletions smt/surrogate_models/gpx.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import numpy as np
import pickle

from smt.surrogate_models.surrogate_model import SurrogateModel

Expand Down Expand Up @@ -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.
Expand Down
20 changes: 0 additions & 20 deletions smt/surrogate_models/idw.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
20 changes: 0 additions & 20 deletions smt/surrogate_models/rbf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"""

import numpy as np
import pickle
from scipy.sparse import csc_matrix

from smt.surrogate_models.rbfclib import PyRBF
Expand Down Expand Up @@ -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
20 changes: 0 additions & 20 deletions smt/surrogate_models/rmts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit c324dca

Please sign in to comment.