-
Notifications
You must be signed in to change notification settings - Fork 188
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
fix VMC.info()
error
#984
fix VMC.info()
error
#984
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
Though I think we should change repr to give more information and get rid of this info...
But that's a good stopgap
I did not know that hasattr syntax! Nice |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, VMC.info()
is a bit of a leftover from v2. But this fix is nice to have for now, thanks @mmezic!
Out of curiosity, @mmezic , do you actually use info() ? For what? |
Codecov Report
@@ Coverage Diff @@
## master #984 +/- ##
=======================================
Coverage 80.14% 80.14%
=======================================
Files 172 172
Lines 10448 10448
Branches 1490 1490
=======================================
Hits 8374 8374
Misses 1677 1677
Partials 397 397
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not know that hasattr syntax! Nice
Actually, that doesn't work as far as I can tell:
>>> class VMC:
... def info(self):
... print("info")
...
>>> vmc = VMC()
>>> vmc.info()
info
>>> hasattr(vmc, "info")
True
>>> hasattr(vmc, "info()")
False
This should work better:
>>> hasattr(vmc, "info") and callable(vmc.info)
True
I came across |
Well, our test coverage of this method is obviously lacking. The fact that I still think we should still fix the method on |
What fix do we need? I'm in Favour of deprecating. |
Solves #983 by renaming
self.sr
toself.preconditioner
.Also fixes an error in the function
info(obj, depth=None)
whenobj
has an attributeinfo
which is not a method.