-
Notifications
You must be signed in to change notification settings - Fork 621
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Charlemagne_confusion_matrix' of https://github.com/wan…
…db/client into Charlemagne_confusion_matrix
- Loading branch information
Showing
23 changed files
with
530 additions
and
344 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
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,47 @@ | ||
#!/usr/bin/env python | ||
""" | ||
Test for WB-3758. | ||
""" | ||
|
||
import os | ||
|
||
import wandb | ||
|
||
|
||
# test to ensure | ||
run = wandb.init() | ||
run_project = run.project | ||
run_id = run.id | ||
print("Started run {}/{}".format(run_project, run_id)) | ||
|
||
try: | ||
os.makedirs('./chdir_test') | ||
except Exception as e: | ||
pass | ||
|
||
os.chdir('./chdir_test') | ||
# log some table data, which is saved in the media folder | ||
pr_data = [ | ||
['setosa', 1.0, 1.0], ['setosa', 1.0, 1.0], ['setosa', 1.0, 1.0], ['setosa', 1.0, 1.0], ['setosa', 1.0, 1.0], | ||
['setosa', 1.0, 1.0], ['setosa', 1.0, 1.0], ['setosa', 1.0, 1.0], ['setosa', 1.0, 1.0], ['setosa', 1.0, 1.0], | ||
['setosa', 1.0, 0.0], ['setosa', 1.0, 0.0], ['setosa', 1.0, 0.0], ['setosa', 1.0, 0.0], ['setosa', 1.0, 0.0], | ||
['setosa', 1.0, 0.0], ['setosa', 1.0, 0.0], ['setosa', 1.0, 0.0], ['setosa', 1.0, 0.0], ['setosa', 1.0, 0.0], | ||
['versicolor', 1.0, 1.0], ['versicolor', 1.0, 1.0], ['versicolor', 1.0, 1.0], ['versicolor', 1.0, 1.0], | ||
['versicolor', 1.0, 1.0], ['versicolor', 1.0, 1.0], ['versicolor', 1.0, 1.0], ['versicolor', 1.0, 1.0], | ||
['versicolor', 1.0, 1.0], ['versicolor', 1.0, 1.0], ['versicolor', 1.0, 0.0], ['versicolor', 1.0, 0.0], | ||
['versicolor', 1.0, 0.0], ['versicolor', 1.0, 0.0], ['versicolor', 1.0, 0.0], ['versicolor', 1.0, 0.0], | ||
['versicolor', 1.0, 0.0], ['versicolor', 1.0, 0.0], ['versicolor', 1.0, 0.0], ['versicolor', 1.0, 0.0] | ||
] | ||
|
||
# convert the data to a table | ||
pr_table = wandb.Table(data=pr_data, columns=["class", "precision", "recall"]) | ||
wandb.log({'pr_table': pr_table}) | ||
wandb.finish() | ||
|
||
# Check results | ||
api = wandb.Api() | ||
last_run = api.run("%s/%s" % (run_project, run_id)) | ||
media_path = last_run.summary_metrics["pr_table"]["path"] | ||
media_file = last_run.file(media_path) | ||
assert media_file.size > 0 | ||
print("Success") |
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,32 @@ | ||
"""noop tests""" | ||
|
||
|
||
from __future__ import print_function | ||
import pytest | ||
import wandb | ||
|
||
|
||
def test_noop(): | ||
run = wandb.init(config={"foo": {"bar": {"x": "y"}}}, mode="disabled") | ||
wandb.log({"x": {"y": "z"}}) | ||
wandb.log({"foo": {"bar": {"x": "y"}}}) | ||
assert wandb.run == run | ||
assert wandb.config == run.config | ||
assert wandb.summary == run.summary | ||
assert run.config.foo["bar"]["x"] == "y" | ||
assert wandb.summary["x"].y == "z" | ||
assert wandb.summary["foo"].bar.x == "y" | ||
wandb.summary.foo["bar"].update({"a": "b"}) | ||
assert wandb.summary.foo.bar.a == "b" | ||
|
||
|
||
def test_bad_url(test_settings): | ||
s = wandb.Settings(mode="disabled", base_url="localhost:9000") | ||
test_settings._apply_settings(s) | ||
run = wandb.init(settings=test_settings) | ||
run.log({"acc": 0.9}) | ||
wandb.join() | ||
|
||
|
||
if __name__ == "__main__": | ||
pytest.main([__file__]) |
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
Oops, something went wrong.