From 46c0f25bc77e5225219458f13af12aa6240e006f Mon Sep 17 00:00:00 2001 From: Barry57 <160387047+Barry57@users.noreply.github.com> Date: Sun, 27 Oct 2024 14:55:20 +0800 Subject: [PATCH] Update basis_fd.py --- GENetLib/basis_fd.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GENetLib/basis_fd.py b/GENetLib/basis_fd.py index 74a0604..501a972 100644 --- a/GENetLib/basis_fd.py +++ b/GENetLib/basis_fd.py @@ -39,9 +39,9 @@ def basis_fd(btype=None, rangeval=None, nbasis=None, params=None, dropind=None, btype = "power" else: btype = "unknown" - if nbasis <= 0: + if nbasis is not None and nbasis<= 0: raise ValueError("Argument nbasis is not positive.") - if round(nbasis) != nbasis: + if nbasis is not None and round(nbasis) != nbasis: raise ValueError("Argument nbasis is not an integer.") if quadvals is None: quadvals = [] @@ -141,4 +141,4 @@ def basis_fd(btype=None, rangeval=None, nbasis=None, params=None, dropind=None, } return basisobj - \ No newline at end of file +