-
-
Notifications
You must be signed in to change notification settings - Fork 417
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
edit groups in idata.extend #1386
Conversation
Good thing we got out CI working! Seems like theres an indentation error hidden in there |
9f8303d
to
64f1756
Compare
Codecov Report
@@ Coverage Diff @@
## master #1386 +/- ##
==========================================
+ Coverage 91.73% 91.74% +0.01%
==========================================
Files 105 105
Lines 10909 10915 +6
==========================================
+ Hits 10007 10014 +7
+ Misses 902 901 -1
Continue to review full report at Codecov.
|
fe7fef8
to
20b07fb
Compare
arviz/data/io_dict.py
Outdated
@@ -69,11 +69,15 @@ def __init__( | |||
self.attrs.pop("created_at", None) | |||
self.attrs.pop("arviz_version", None) | |||
|
|||
@requires("posterior") | |||
def _init_dict(self, attr_name): | |||
dict_or_none = getattr(self, attr_name, None) |
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.
should this return empty dict instead of None?
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.
yeah, much better, it directly takes care about the if else below, thanks!
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.
now I realized the if else is what does the actual work, for now all attrs are set, but it's nice to have this here in case we extended io_dict.
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.
Remember to update the block below too
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.
The block below needs to check for None. This first one catches attributes that have not been set and the one below catches attributes set to None
Description
idata.extend
does add the groups but does not edit the_groups
attributes which makesidata.posterior
to work butposterior
is not shown when printing nor in the html repr.Checklist