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

Make ensemble's object and source fields public #236

Closed
wants to merge 2 commits into from
Closed

Conversation

wilsonbb
Copy link
Collaborator

@wilsonbb wilsonbb commented Sep 18, 2023

Make Ensemble._source and Ensemble._object public fields (Ensemble.source and Ensemble.object respectively).

As this is simply a renaming, no new testing is added.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@codecov
Copy link

codecov bot commented Sep 18, 2023

Codecov Report

Patch coverage: 81.25% and no project coverage change.

Comparison is base (7561df3) 92.63% compared to head (f6e1f4d) 92.63%.

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           
Files Changed Coverage Δ
src/tape/ensemble.py 89.64% <81.25%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wilsonbb wilsonbb linked an issue Sep 19, 2023 that may be closed by this pull request
@wilsonbb wilsonbb requested a review from dougbrn September 19, 2023 23:09
@wilsonbb wilsonbb marked this pull request as ready for review September 19, 2023 23:09
@wilsonbb wilsonbb requested a review from hombit September 19, 2023 23:11
@wilsonbb
Copy link
Collaborator Author

@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.

Copy link
Contributor

@hombit hombit left a 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()

@hombit
Copy link
Contributor

hombit commented Sep 20, 2023

It actually doesn't solve #214, because that one was about ._time_col, ._flux_col, etc

Copy link
Collaborator

@dougbrn dougbrn left a 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!

@dougbrn
Copy link
Collaborator

dougbrn commented Nov 29, 2023

We'll get this from the refactor, correct? Is there a need to keep this open @wilsonbb ?

@wilsonbb
Copy link
Collaborator Author

We'll get this from the refactor, correct? Is there a need to keep this open @wilsonbb ?

Yeah this is correct, closing.

@wilsonbb wilsonbb closed this Nov 29, 2023
@dougbrn dougbrn deleted the tape_objects branch April 4, 2024 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make Ensemble._*_col public
3 participants