-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add queryset save api * Fix py35 errors and adapt ArtifactSet api
- Loading branch information
Showing
6 changed files
with
222 additions
and
109 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# -*- coding: future_fstrings -*- | ||
import os | ||
|
||
|
||
def test_single_save(loader, tmpdir): | ||
exp_ids = [1, 2, 3] | ||
exps = loader.find_by_ids(exp_ids) | ||
exps.artifacts["confusion_matrix"].save(to_dir=tmpdir) | ||
for exp_id in exp_ids: | ||
filepath = tmpdir / f"{exp_id}_confusion_matrix.png" | ||
assert os.path.isfile(str(filepath)) | ||
|
||
|
||
def test_glob_save(loader, tmpdir): | ||
exp_ids = [1, 2, 3] | ||
exps = loader.find_by_ids(exp_ids) | ||
exps.artifacts.filter("confusion_matrix*").save(to_dir=tmpdir) | ||
for exp_id in exp_ids: | ||
filepath = str(tmpdir / f"{exp_id}_confusion_matrix.png") | ||
assert os.path.isfile(filepath) | ||
filepath = str(tmpdir / f"{exp_id}_confusion_matrix.pdf") | ||
assert os.path.isfile(filepath) |