Skip to content

Commit

Permalink
Merge pull request #261 from squat/literalidentity
Browse files Browse the repository at this point in the history
pygam/{core,pygam}: fix literal identity check
  • Loading branch information
dswah authored Jul 15, 2020
2 parents 2942579 + 684ddb6 commit 2323eb7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pygam/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class name

# flatten sub-term properties, but not `terms`
k, v = param_kvs.pop()
if flatten_attrs and k is not 'terms':
if flatten_attrs and k != 'terms':
v = flatten(v)

# round the floats first
Expand Down
4 changes: 2 additions & 2 deletions pygam/pygam.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def _validate_params(self):
.format(self.fit_intercept.__class__))

# terms
if (self.terms is not 'auto') and not (isinstance(self.terms, (TermList, Term, type(None)))):
if (self.terms != 'auto') and not (isinstance(self.terms, (TermList, Term, type(None)))):
raise ValueError('terms must be a TermList, but found '\
'terms = {}'.format(self.terms))

Expand Down Expand Up @@ -273,7 +273,7 @@ def _validate_data_dep_params(self, X):
n_samples, m_features = X.shape

# terms
if self.terms is 'auto':
if self.terms == 'auto':
# one numerical spline per feature
self.terms = TermList(*[SplineTerm(feat, verbose=self.verbose) for feat in range(m_features)])

Expand Down

0 comments on commit 2323eb7

Please sign in to comment.