dswah / pyGAM

[HELP REQUESTED] Generalized Additive Models in Python
https://pygam.readthedocs.io
Apache License 2.0
871 stars 159 forks source link

a bug in terms.py? #218

Closed jzang18 closed 5 years ago

jzang18 commented 5 years ago

keep getting error msg: pygam/terms.py:244: FutureWarning: comparison to None will result in an elementwise object comparison in the future. return (np.atleast_1d(self.constraints) != None).any()

It works fine after I changed it to: return np.atleast_1d(self.constraints) is not None

any comments?

dswah commented 5 years ago

@jzang18 good find. i will try out your fix.

could you tell me, your python version and your numpy version?

jzang18 commented 5 years ago

I use python 2.7.15 and numpy 1.11.3

Seems this Numpy version not broadcast '!='. I think change to the following should work: return np.not_equal(np.atleast_1d(self.constraints), None).any()

dswah commented 5 years ago

@jzang18 my mistake. this bug was just fixed in a previous PR https://github.com/dswah/pyGAM/pull/217, but i have not yet published the new version.

expect the new version tonight.

i will close this issue.

jzang18 commented 5 years ago

thanks!