Open
Description
Description
Currently the path
parameter to the __init__
methods of Ensemble
/Model
/Orchestrator
are type hinted as so (or equivalent):
def __init__(
self,
...
path: str | None = os.getcwd(),
...
) -> None:
However, if a user were to exercise the Optional
type of path
, an invalid path of the string "None"
is set on the object, effectively leaving the object in an invalid state that cannot be launched.
How to reproduce
Consider the following repl
>>> from smartsim.database.orchestrator import Orchestrator
>>> from smartsim.entity.ensemble import Ensemble
>>> from smartsim.entity.model import Model
>>> from smartsim.settings import RunSettings
>>>
>>> Orchestrator(path=None).path
'None'
>>> rs = RunSettings("echo", ["hello", "world"])
>>> Ensemble("test-ens", {}, path=None, run_settings=rs, replicas=1).path
'None'
>>> Model("test-model", {}, rs, path=None).path
'None'
Expected behavior
The path should not be set to the string "None"
, but should instead be set to the current working directory. Whether that is the current working directory of at "compile time" or at "run time" remains to be decided.
Alternatively, we could have the path
parameter not have a default value.
System
Any/All
Acceptance Criteria
- Decide on if/what the default path for an
Model
/Ensemble
/Orchestrator
should be - Passing a
path=None
param toModel
/Ensemble
/Orchestrator
results in a "valid" path, or disallowed entirely - If a default path is agreed upon, add tests to ensure that when
path=None
is specified the correct default path is set