Skip to content

Commit

Permalink
v0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
daizutabi committed Apr 21, 2020
1 parent 289ee1a commit 384a382
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ivory/__init__.py
@@ -1,4 +1,4 @@
__version__ = "0.2.0"
__version__ = "0.2.1"

from ivory.core.client import create_client

Expand Down
File renamed without changes.
50 changes: 50 additions & 0 deletions tests/core/test_core_client.py
@@ -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
2 changes: 1 addition & 1 deletion tests/data.yaml
Expand Up @@ -3,7 +3,7 @@ data:
num_samples: 1000
dataset:
def: example.Dataset
dummy: 5
dummy: '5.0'
dataloaders:
batch_size: 10
fold: 0
2 changes: 1 addition & 1 deletion tests/example.yaml
Expand Up @@ -9,7 +9,7 @@ experiment:
class: optuna.pruners.MedianPruner
run:
library: torch
include: data
include: data.yaml
dataloaders:
data:
dataset:
Expand Down

0 comments on commit 384a382

Please sign in to comment.