Skip to content

Commit 9796ad1

Browse files
committed
Couple of fixes to align with recent Python API
1 parent bd292aa commit 9796ad1

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ readme = "README.md"
77

88
[tool.poetry.dependencies]
99
python = "^3.12"
10-
simvue = {git = "https://github.com/simvue-io/python-api.git", branch="v1.1"}
10+
simvue = "^1.1.1"
1111
click = "^8.1.7"
1212
click-option-group = "^0.5.6"
1313
click-log = "^0.4.0"

simvue_cli/cli/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ def update_metadata(run_id: str, metadata: dict) -> None:
344344
)
345345
@click.option(
346346
"--count",
347+
"count_limit",
347348
type=int,
348349
help="Maximum number of runs to retrieve",
349350
default=20,

simvue_cli/run.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from datetime import datetime, timezone
2020

2121
from simvue.factory.proxy import Simvue
22-
from simvue.config import SimvueConfiguration
22+
from simvue.config.user import SimvueConfiguration
2323

2424
from simvue.run import get_system
2525
from simvue.client import Client
@@ -49,6 +49,9 @@ def _check_run_exists(run_id: str) -> pathlib.Path:
4949
# retrieve last time step, and the start time of the run
5050
if not run_shelf_file.exists():
5151
metrics = run["metrics"]
52+
53+
if not isinstance(metrics, dict):
54+
raise RuntimeError(f"Expected metrics to be of type 'dict', but got '{metrics}'")
5255
out_data = {"step": 0, "start_time": time.time()}
5356
if metrics and (step := max(metric.get("step") for metric in metrics)):
5457
out_data["step"] = step

tests/test_command_line_interface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def test_runs_list(create_plain_run: tuple[simvue.Run, dict], tab_format: str) -
5757
]
5858
)
5959
assert result.exit_code == 0, result.output
60-
assert run.id and run.id in result.output
60+
assert run.id and run.id in result.output.replace("\\\\", "\\")
6161

6262

6363
def test_runs_json(create_test_run: tuple[simvue.Run, dict]) -> None:

0 commit comments

Comments
 (0)