-
Notifications
You must be signed in to change notification settings - Fork 192
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: Add __str__
method to Orbital Class
#4829
🐛 FIX: Add __str__
method to Orbital Class
#4829
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #4829 +/- ##
===========================================
+ Coverage 79.54% 79.54% +0.01%
===========================================
Files 519 519
Lines 37088 37092 +4
===========================================
+ Hits 29497 29502 +5
+ Misses 7591 7590 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
I don't know our convention for what the result of |
There isn't a well defined convention yet, other than the Python standard that
so for this case, we could do something like
For the identifier we typically take the PK. It is less transferable than the UUID, but the UUID is often very long and not always needed. I am not too familiar with the class itself, so the |
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 @NinadBhat . I responded in a separate comment on the suggested format of the string returned by __str__
. Let's wait to see if we can get confirmation from someone else. If they do, please change to that suggested format. Then simply add a test. As @greschd suggested, a simple test that just calls str(Orbital())
should be sufficient.
aiida/tools/data/orbital/orbital.py
Outdated
out_string = f' orbital @ {position_string}' | ||
|
||
return out_string |
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.
out_string = f' orbital @ {position_string}' | |
return out_string | |
return f' orbital @ {position_string}' |
See also #3087 |
@ltalirz I have made the changes. |
this looks good to me, @ltalirz will merge later today unless you have any objections? |
@chrisjsewell in my review I suggested to change the output to |
Ah fair, I missed that had not been addressed yet |
@chrisjsewell I am not sure how to access (theta, phi, sigma) and node in the Orbital class. |
@sphuber note that this is the |
Ah my bad! I completely missed this, I was indeed thinking of the |
__str__
method to Orbital Class
Fixes #4347
The absence of str was leading to recursion RecursionError #4347. So have added a str method.