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

HTML repr for Maps #227

Merged
merged 5 commits into from
Aug 20, 2020
Merged

HTML repr for Maps #227

merged 5 commits into from
Aug 20, 2020

Conversation

elin1231
Copy link
Collaborator

maps could be displayed in HTML format

@codecov
Copy link

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

setup.cfg Outdated Show resolved Hide resolved
htmap/maps.py Outdated Show resolved Hide resolved
htmap/maps.py Outdated Show resolved Hide resolved
htmap/maps.py Outdated
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
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.

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

This is part of work on #53

@JoshKarpel JoshKarpel added enhancement New feature or request jupyter labels Aug 19, 2020
@JoshKarpel JoshKarpel added this to In progress in v0.7.0 via automation Aug 19, 2020
Copy link
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
v0.7.0 automation moved this from In progress to Done Aug 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request jupyter
Projects
v0.7.0
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants