-
Notifications
You must be signed in to change notification settings - Fork 3
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
Make ensemble's object and source fields public #236
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #236 +/- ##
=======================================
Coverage 92.63% 92.63%
=======================================
Files 22 22
Lines 1140 1140
=======================================
Hits 1056 1056
Misses 84 84
☔ View full report in Codecov by Sentry. |
@hombit I have also added you a reviewer to give you a way to signal whether you are ready to break the current API with this change. |
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.
Looks good to me! The only discussion point I have is protection of .source
/.object
attributes from being accidentally re-assigned by user with ens.source = something
. We can make it work using "defensive shallow copy" pattern (I'm pretty sure that it has a better name =)
class Ensemble:
_object
@property
def object(self):
# Will Dask make a shallow copy here? Could we make it read-only?
return object.copy()
It actually doesn't solve #214, because that one was about |
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.
looks good to me!
We'll get this from the refactor, correct? Is there a need to keep this open @wilsonbb ? |
Yeah this is correct, closing. |
Make
Ensemble._source
andEnsemble._object
public fields (Ensemble.source
andEnsemble.object
respectively).As this is simply a renaming, no new testing is added.