Skip to content
This repository was archived by the owner on Mar 5, 2026. It is now read-only.

HTML repr for Maps#227

Merged
JoshKarpel merged 5 commits intohtcondor:v0.7.0from
elin1231:jupyter_lab_widget
Aug 20, 2020
Merged

HTML repr for Maps#227
JoshKarpel merged 5 commits intohtcondor:v0.7.0from
elin1231:jupyter_lab_widget

Conversation

@elin1231
Copy link
Copy Markdown
Collaborator

maps could be displayed in HTML format

@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 17, 2020

Codecov Report

Merging #227 into v0.7.0 will increase coverage by 0%.
The diff coverage is 100%.

@@          Coverage Diff          @@
##           v0.7.0   #227   +/-   ##
=====================================
  Coverage      84%    84%           
=====================================
  Files          77     78    +1     
  Lines        3795   3813   +18     
  Branches      391    393    +2     
=====================================
+ Hits         3208   3226   +18     
  Misses        503    503           
  Partials       84     84           
Impacted Files Coverage Δ
htmap/maps.py 78% <100%> (+<1%) ⬆️
tests/integration/test_widgets.py 100% <100%> (ø)

Copy link
Copy Markdown
Contributor

@JoshKarpel JoshKarpel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some quibbles about the code itself, but the structure looks good.

Comment thread setup.cfg Outdated
Comment thread htmap/maps.py Outdated
Comment thread htmap/maps.py Outdated
Comment thread htmap/maps.py
Comment on lines +168 to +184
sc = collections.Counter(self.component_statuses)
row: Dict[str, Union[str, int, float]] = {"tag": self.tag}

for status in state.ComponentStatus.display_statuses():
row[status.value.lower()] = sc[status]

tag = row["tag"]
held = row["held"]
errored = row["errored"]
idle = row["idle"]
running = row["running"]
completed = row["completed"]

local_data = utils.num_bytes_to_str(self.local_data)
max_memory = utils.num_bytes_to_str(max(self.memory_usage) * 1024 * 1024)
max_runtime = str(max(self.runtime))
total_runtime = str(sum(self.runtime, datetime.timedelta()))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The row dictionary seems unhelpful here; just pull the data directly from self.component_statuses (you can still use state.ComponentStatus.display_statuses() to get the ones to show), and use self.tag for the tag.

Comment thread htmap/maps.py Outdated
@JoshKarpel JoshKarpel changed the title Jupyter Lab Widget HTML repr for Maps Aug 19, 2020
@JoshKarpel
Copy link
Copy Markdown
Contributor

This is part of work on #53

Copy link
Copy Markdown
Contributor

@JoshKarpel JoshKarpel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@JoshKarpel JoshKarpel merged commit f10682b into htcondor:v0.7.0 Aug 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request jupyter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants