Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
53 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
__version__ = "0.2.0" | ||
__version__ = "0.2.1" | ||
|
||
from ivory.core.client import create_client | ||
|
||
|
File renamed without changes.
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 |
---|---|---|
@@ -1,2 +1,52 @@ | ||
import pytest | ||
|
||
from ivory.core.client import create_client | ||
|
||
|
||
def test_client_repr(client): | ||
assert repr(client) == "Client(num_objects=2)" | ||
|
||
|
||
def test_create_params(client): | ||
params = client.create_params("example") | ||
assert params["experiment"]["name"] == "example" | ||
|
||
|
||
def test_get_experiment(client): | ||
experiment = next(client.get_experiments()) | ||
assert experiment.name == "example" | ||
for experiment in client.get_experiments(): | ||
pass | ||
assert experiment.name == "example" | ||
|
||
|
||
def test_search_runs(client, run): | ||
run.start() | ||
run_ids = list(client.search_runs()) | ||
assert len(run_ids) | ||
|
||
|
||
def test_get_experiment_from_run_id(client): | ||
run_ids = list(client.search_runs()) | ||
experiment = client.get_experiment_from_run_id(run_ids[0]) | ||
assert experiment.name == "example" | ||
|
||
with pytest.raises(ValueError): | ||
client.get_experiment_from_run_id("ABC") | ||
|
||
|
||
def test_load(client): | ||
run_id = next(client.search_runs()) | ||
params = client.load_params(run_id) | ||
assert params["run"]["trainer"]["max_epochs"] == 10 | ||
|
||
run = client.load_run(run_id) | ||
assert run.id == run_id | ||
|
||
trainer = client.load_instance(run_id, "trainer") | ||
assert trainer.epoch > 0 | ||
|
||
|
||
def test_without_tracker(): | ||
client = create_client(directory="tests", tracker=False) | ||
assert 'tracker' not in 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ data: | |
num_samples: 1000 | ||
dataset: | ||
def: example.Dataset | ||
dummy: 5 | ||
dummy: '5.0' | ||
dataloaders: | ||
batch_size: 10 | ||
fold: 0 |
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