This repository has been archived by the owner on Jan 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Related Jobs in Dataset and Model view #767
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Related Jobs Feature
Reduced complexity of implementation Newline fixes Removed a print Fixes Fixed link for future resilience Typo
- Loading branch information
commit eeddff2828040f311a4b56837de9ba6f7b36faba
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -214,6 +214,29 @@ def get_job(self, job_id): | |
return None | ||
return self.jobs.get(job_id, None) | ||
|
||
def get_related_jobs(self, job): | ||
""" | ||
Look through self.jobs to try to find the Jobs | ||
whose parent contains job | ||
""" | ||
related_jobs = [] | ||
|
||
if isinstance(job, ModelJob): | ||
datajob = job.dataset | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the updates! If you don't mind a couple more comments... there you can do:
so you can take lines 233-235 out. |
||
related_jobs.append(datajob) | ||
elif isinstance(job, DatasetJob): | ||
datajob = job | ||
else: | ||
raise ValueError("Unhandled job type %s" % job.job_type()) | ||
|
||
for j in self.jobs.values(): | ||
# Any model that shares (this/the same) dataset should be added too: | ||
if isinstance(j, ModelJob): | ||
if datajob == j.train_task().dataset: | ||
related_jobs.append(j) | ||
|
||
return related_jobs | ||
|
||
def abort_job(self, job_id): | ||
""" | ||
Aborts a running Job | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -235,6 +235,53 @@ <h4 class="panel-title"> | |
</div> | ||
<div class="gpu-utilization-info" style="display:none;"></div> | ||
|
||
|
||
<!-- Related jobs --> | ||
{% if related_jobs is not none and related_jobs|length > 0 %} | ||
<div class="panel panel-default"> | ||
<div class="panel-heading"> | ||
<h4 class="panel-title"> | ||
Related jobs | ||
</h4> | ||
</div> | ||
<div class="panel-collapse"> | ||
<div class="panel-body"> | ||
<div class="panel-group"> | ||
<!-- Related model jobs --> | ||
{% for r_job in related_jobs %} | ||
{% if prev_job_model != r_job.job_type() %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it might have been more explicit to call this |
||
<h4 class="panel-title" style="margin:10px">{{r_job.job_type()}}</h4> | ||
{% set prev_job_model = r_job.job_type() %} | ||
{% endif %} | ||
<div id="{{r_job.id()}}-status" class="panel panel-{{ r_job.status.css }}"> | ||
<div class="panel-heading"> | ||
<h4 class="panel-title"> | ||
<a href="{{ url_for('digits.views.show_job', job_id=r_job.id()) }}"> | ||
{{ r_job.name() }} | ||
<small>{{r_job.status.name}}</small> | ||
</a> | ||
<a data-toggle="collapse" href="#{{r_job.id()}}-status-collapse" style="float:right"> | ||
<span class="caret"></span> | ||
</a> | ||
</h4> | ||
</div> | ||
<div id="{{r_job.id()}}-status-collapse" class="panel-collapse collapse"> | ||
<div class="panel-body"> | ||
<div class="task-statuses"> | ||
{% with updates = r_job.status_history %} | ||
{% include "status_updates.html" %} | ||
{% endwith %} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{% endif %} | ||
|
||
<div id="notes-information" class="panel panel-default"> | ||
<div class="panel-heading"> | ||
<h4>Notes</h4> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you forgot to add this parameter to the
show()
function indigits/dataset/generic/views.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah that's because the file
digits/dataset/generic/views.py
is brand new. Didn't catch that, well spotted.