Skip to content

Commit edb40a7

Browse files
committed
Merge branch 'dev' into hotfix/allow-path-objects
2 parents 2c5cea6 + 8571492 commit edb40a7

File tree

5 files changed

+42
-11
lines changed

5 files changed

+42
-11
lines changed

poetry.lock

Lines changed: 32 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ torch = [
5454
{platform = "darwin", version="^2.0.0", source="PyPI", optional=true},
5555
{platform = "win32", version="^2.0.0", source="PyPI", optional=true},
5656
]
57+
randomname = "^0.2.1"
5758

5859
[tool.poetry.extras]
5960
plot = ["matplotlib", "plotly"]

simvue/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,9 @@ def get_artifact(
641641
response.content, mimetype, allow_pickle
642642
)
643643

644-
return content or response.content
644+
# Numpy array return means just 'if content' will be ambiguous
645+
# so must explicitly check if None
646+
return response.content if content is None else content
645647

646648
@prettify_pydantic
647649
@pydantic.validate_call

simvue/factory/proxy/offline.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import time
77
import typing
88
import uuid
9+
import randomname
910

1011
from simvue.factory.proxy.base import SimvueBaseClass
1112
from simvue.utilities import (
@@ -65,6 +66,10 @@ def create_run(self, data) -> tuple[typing.Optional[str], typing.Optional[str]]:
6566
if not self._directory:
6667
self._logger.error("No directory specified")
6768
return (None, None)
69+
70+
if not self._name:
71+
self._name = randomname.get_name()
72+
6873
try:
6974
os.makedirs(self._directory, exist_ok=True)
7075
except Exception as err:

simvue/run.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,7 @@ def init(
586586

587587
if not name:
588588
return False
589+
589590
elif name is not True:
590591
self._name = name
591592

@@ -1334,9 +1335,6 @@ def set_status(
13341335
if self._mode == "disabled":
13351336
return True
13361337

1337-
self._error("Cannot update run status, run is not initialised.")
1338-
return False
1339-
13401338
if not self._active:
13411339
self._error("Run is not active")
13421340
return False

0 commit comments

Comments
 (0)