batchglm
batchglm copied to clipboard
print(test.model) throws RecursionError
When printing the type of test.model, an error is thrown.
print(test.model)
---------------------------------------------------------------------------
RecursionError Traceback (most recent call last)
<ipython-input-28-359bfcc26acd> in <module>
----> 1 print(test.model)
~/miniconda3/envs/batchglm_gpu/lib/python3.8/site-packages/batchglm/models/base/model.py in __repr__(self)
43
44 def __repr__(self):
---> 45 return self.__str__()
... last 1 frames repeated, from the frame below ...
~/miniconda3/envs/batchglm_gpu/lib/python3.8/site-packages/batchglm/models/base/model.py in __repr__(self)
43
44 def __repr__(self):
---> 45 return self.__str__()
RecursionError: maximum recursion depth exceeded while calling a Python object
The type of test.model
can be checked when by using type
type(test.model)
batchglm.train.numpy.glm_nb.model.ModelIwlsNb
The correction seems to be fixing that self.str() recursion while calling __str__()
Thanks! We can open a PR for this!
Has been fixed here #130 but this is a breaking change since the entire API is reworked. I will leave this open until the next release and inform once we're done merging.