lina-usc / pylossless

🧠 EEG Processing pipeline that annotates continuous data
https://pylossless.readthedocs.io/en/latest/
MIT License
24 stars 8 forks source link

ENH: simple HTML representation for LosslessPipeline #146

Closed scott-huberty closed 11 months ago

scott-huberty commented 11 months ago

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

codecov[bot] commented 11 months ago

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%) :arrow_up:
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%) :arrow_up:

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

scott-huberty commented 11 months ago

@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 commented 11 months ago

self merging since this is mainly aesthetic.