Skip to content

Commit

Permalink
[MOD] - set fastmat as optional dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
lpossner committed Jul 22, 2024
1 parent 8acab31 commit 9f09856
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
1 change: 0 additions & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
scipy>=1.10.0
numpy>=1.24.1
fastmat>=0.2.post0
scikit-learn>=1.2.0
h5py>=3.7.0
matplotlib>=3.6.3
Expand Down
9 changes: 4 additions & 5 deletions pygpc/GPC.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
from .Computation import *
from .Grid import *

try:
import fastmat as fm
except ImportError:
pass


class GPC(object):
"""
Expand Down Expand Up @@ -1001,6 +996,10 @@ def solve(self, results, gradient_results=None, solver=None, settings=None, matr
# Orthogonal Matching Pursuit #
###############################
elif solver == 'OMP':
try:
import fastmat as fm
except ImportError:
raise ImportError("Please install the fastmat package to use the OMP solver.")
# transform gPC matrix to fastmat format
matrix_fm = fm.Matrix(matrix)

Expand Down
4 changes: 0 additions & 4 deletions pygpc/MEGPC.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
from .Grid import *
from .SGPC import *

try:
import fastmat as fm
except ImportError:
pass

class MEGPC(object):
"""
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
scipy>=1.10.0
numpy>=1.24.1,<2.0.0
fastmat>=0.2.post0
scikit-learn>=1.2.0
h5py>=3.7.0
matplotlib>=3.6.3
Expand Down

0 comments on commit 9f09856

Please sign in to comment.