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

ENH: simple HTML representation for LosslessPipeline #146

Merged
merged 7 commits into from
Oct 30, 2023
Merged

ENH: simple HTML representation for LosslessPipeline #146

merged 7 commits into from
Oct 30, 2023

Conversation

scott-huberty
Copy link
Member

@scott-huberty scott-huberty commented Oct 29, 2023

Now, this is what displays when calling a LosslessPipeline instance:

Screen Shot 2023-10-29 at 1 35 21 PM

Which can be uncollapsed:

Screen Shot 2023-10-29 at 1 35 08 PM

FlaggedChs and FlaggedICs now have nicer __repr__'s too:

Screen Shot 2023-10-29 at 1 36 31 PM

scott-huberty and others added 7 commits April 30, 2023 21:46
- HTML repr for LosslessPipeline
- string repr for flaggedCHs
- flaggedICs displays the dataframe upon call
- flaggedICs no longer subclasses dict, but subclasses a Dataframe directly, thus removing the .data_frame method. This is because at this point we have finished the pipeline, dashboard, and rejection policy, and have never used the flaggedICs dictionary, we only use the dataframe directly. Thus it makes more sense just to use this dataframe, and it makes the dataframe is no longer hidden from the user behind an empty dict class
@codecov
Copy link

codecov bot commented Oct 29, 2023

Codecov Report

Merging #146 (160054c) into main (0927ded) will increase coverage by 1.52%.
The diff coverage is 95.08%.

@@            Coverage Diff             @@
##             main     #146      +/-   ##
==========================================
+ Coverage   68.33%   69.86%   +1.52%     
==========================================
  Files          14       16       +2     
  Lines         960     1012      +52     
==========================================
+ Hits          656      707      +51     
- Misses        304      305       +1     
Files Coverage Δ
pylossless/__init__.py 100.00% <100.00%> (ø)
pylossless/dash/__init__.py 100.00% <100.00%> (ø)
pylossless/pipeline.py 74.34% <100.00%> (+1.63%) ⬆️
pylossless/utils/__init__.py 100.00% <100.00%> (ø)
pylossless/utils/_utils.py 100.00% <ø> (ø)
pylossless/utils/html.py 95.83% <95.83%> (ø)
pylossless/flagging.py 64.78% <71.42%> (+0.50%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@scott-huberty
Copy link
Member Author

@christian-oreilly FYI in response to our discussion, the difference between __repr__ and __str__ dunder methods is that you would have to explicitly call print(pipeline.flags["ch"]) for the __str__ string representation to display. So in this case __repr__ is the right call, so that the string representation displays when you call the pipeline.flags["ch"].

@scott-huberty
Copy link
Member Author

self merging since this is mainly aesthetic.

@scott-huberty scott-huberty merged commit dfd7671 into lina-usc:main Oct 30, 2023
5 checks passed
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.

1 participant