-
Notifications
You must be signed in to change notification settings - Fork 37
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
Remove Pandas from experiment summary #116
Merged
Spartee
merged 10 commits into
CrayLabs:develop
from
MattToast:remove_np_from_experiment_summary
Dec 9, 2021
Merged
Changes from 4 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e15906b
Remove pandas from experiment.py
MattToast 86c03b1
Update requirements to include tabulate and remove pd
MattToast f60357f
Change table fmt to match pd.df, run black
MattToast d2a854e
ake style
MattToast ad94a40
refactor test to work with str from summary
MattToast d3aaab5
add summary test to test_testexperiment.py, refactor test_simple_enti…
MattToast 5b4408b
Bring in changes on upstream
MattToast 71a3d71
Add format to summary as an optional parameter
MattToast dd52f34
add tabulate format link to docstring
MattToast bd9eaf5
Merge remote-tracking branch 'upstream' into remove_np_from_experimen…
MattToast 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
from os import getcwd | ||
from pprint import pformat | ||
|
||
import pandas as pd | ||
from tabulate import tabulate | ||
from tqdm import trange | ||
|
||
from .control import Controller, Manifest | ||
|
@@ -413,35 +413,35 @@ def summary(self): | |
The summary will show each instance that has been | ||
launched and completed in this ``Experiment`` | ||
|
||
:return: pandas Dataframe of ``Experiment`` history | ||
:rtype: pd.DataFrame | ||
:return: tabulate string of ``Experiment`` history | ||
:rtype: str | ||
""" | ||
index = 0 | ||
df = pd.DataFrame( | ||
columns=[ | ||
"Name", | ||
"Entity-Type", | ||
"JobID", | ||
"RunID", | ||
"Time", | ||
"Status", | ||
"Returncode", | ||
] | ||
) | ||
values = [] | ||
headers = [ | ||
"Name", | ||
"Entity-Type", | ||
"JobID", | ||
"RunID", | ||
"Time", | ||
"Status", | ||
"Returncode", | ||
] | ||
|
||
# TODO should this include running jobs? | ||
for job in self._control._jobs.completed.values(): | ||
for run in range(job.history.runs + 1): | ||
df.loc[index] = [ | ||
job.entity.name, | ||
job.entity.type, | ||
job.history.jids[run], | ||
run, | ||
job.history.job_times[run], | ||
job.history.statuses[run], | ||
job.history.returns[run], | ||
] | ||
index += 1 | ||
return df | ||
values.append( | ||
[ | ||
job.entity.name, | ||
job.entity.type, | ||
job.history.jids[run], | ||
run, | ||
job.history.job_times[run], | ||
job.history.statuses[run], | ||
job.history.returns[run], | ||
] | ||
) | ||
return tabulate(values, headers, showindex=True, tablefmt="plain") | ||
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. lets set the default to |
||
|
||
def _launch_summary(self, manifest): | ||
"""Experiment pre-launch summary of entities that will be launched | ||
|
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 |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
import torch | ||
import torch.nn as nn | ||
import torch.nn.functional as F | ||
|
||
from smartredis import Client | ||
|
||
|
||
|
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 |
---|---|---|
|
@@ -5,7 +5,6 @@ | |
import numpy as np | ||
import torch | ||
import torch.nn as nn | ||
|
||
from smartredis import Client | ||
|
||
|
||
|
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
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.
Lets allow
format
as a parameter here and pass to the tabulate function. Also should add in https://github.com/astanin/python-tabulate#table-format to the docstring so that people know what options are available.