-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make release-tag: Merge branch 'master' into stable
- Loading branch information
Showing
14 changed files
with
743 additions
and
47 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,10 +8,11 @@ | |
__copyright__ = 'Copyright (c) 2018, MIT Data To AI Lab' | ||
__email__ = '[email protected]' | ||
__license__ = 'MIT' | ||
__version__ = '0.3.0' | ||
__version__ = '0.3.1.dev3' | ||
|
||
from sdgym import benchmark, results, synthesizers | ||
from sdgym.benchmark import run | ||
from sdgym.collect import collect_results | ||
from sdgym.datasets import load_dataset | ||
|
||
__all__ = [ | ||
|
@@ -20,4 +21,5 @@ | |
'results', | ||
'run', | ||
'load_dataset', | ||
'collect_results' | ||
] |
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from sdgym.s3 import read_csv_from_path, write_csv | ||
|
||
|
||
def collect_results(input_path, output_file=None, aws_key=None, aws_secret=None): | ||
"""Collect the results in the given input directory, and | ||
write all the results into one csv file. | ||
Args: | ||
input_path (str): | ||
The path of the directory that the results files | ||
will be read from. | ||
output_file (str): | ||
If ``output_file`` is provided, the consolidated | ||
results will be written there. Otherwise, they | ||
will be written to ``input_path``/results.csv. | ||
aws_key (str): | ||
If an ``aws_key`` is provided, the given access | ||
key id will be used to read from and/or write to | ||
any s3 paths. | ||
aws_secret (str): | ||
If an ``aws_secret`` is provided, the given secret | ||
access key will be used to read from and/or write to | ||
any s3 paths. | ||
""" | ||
print(f'Reading results from {input_path}') | ||
scores = read_csv_from_path(input_path, aws_key, aws_secret) | ||
scores = scores.drop_duplicates() | ||
|
||
if output_file: | ||
output = output_file | ||
else: | ||
output = f'{input_path}/results.csv' | ||
|
||
print(f'Storing results at {output}') | ||
write_csv(scores, output, aws_key, aws_secret) |
Oops, something went wrong.