Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

print(test.model) throws RecursionError #115

Open
ilibarra opened this issue Jan 18, 2021 · 2 comments · Fixed by #130
Open

print(test.model) throws RecursionError #115

ilibarra opened this issue Jan 18, 2021 · 2 comments · Fixed by #130
Assignees
Labels
bug Something isn't working

Comments

@ilibarra
Copy link
Member

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__()

@davidsebfischer
Copy link
Contributor

Thanks! We can open a PR for this!

@picciama picciama self-assigned this Mar 4, 2022
@picciama
Copy link
Collaborator

picciama commented Mar 4, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants