Skip to content

Commit

Permalink
Update get_basis_matrix.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Barry57 authored Oct 27, 2024
1 parent 80ecc01 commit e2a587c
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions GENetLib/get_basis_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
'''Calculate a set of basis functions or their derivatives and a set of parameter values'''

def get_basis_matrix(evalarg, basisobj, nderiv=0, returnMatrix=False):

if isinstance(basisobj, (int, float)) and isinstance(evalarg, dict):
temp = basisobj
basisobj = evalarg
evalarg = temp
if evalarg is None:
raise ValueError("evalarg required; is NULL.")
evalarg = np.array(evalarg, dtype=float)
Expand All @@ -26,20 +21,6 @@ def get_basis_matrix(evalarg, basisobj, nderiv=0, returnMatrix=False):
nvalues = len(basisvalues)
N = len(evalarg)
OK = False
for ivalues in range(nvalues):
basisvaluesi = basisvalues[ivalues]
if not isinstance(basisvaluesi, (list, np.ndarray)):
raise ValueError("BASISVALUES does not contain lists.")
argvals = basisvaluesi[0]
if len(basisvaluesi) >= nderiv + 2:
if N == len(argvals):
if np.all(argvals == evalarg):
basismat = basisvaluesi[nderiv + 1]
OK = True
if OK:
if len(basismat.shape) == 2:
return np.asmatrix(basismat)
return basismat
type_ = basisobj['btype']
nbasis = basisobj['nbasis']
params = basisobj['params']
Expand Down

0 comments on commit e2a587c

Please sign in to comment.