Skip to content

Commit

Permalink
pushing edits
Browse files Browse the repository at this point in the history
  • Loading branch information
amandarichardsonn committed Apr 18, 2024
1 parent 5ff5045 commit 62a1339
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 34 deletions.
33 changes: 0 additions & 33 deletions smartsim/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,15 +498,10 @@ def create_ensemble(
if name is None:
raise AttributeError("Entity has no name. Please set name attribute.")
check_path = path or osp.join(self.exp_path, name)
if not isinstance(check_path, str):
raise TypeError
entity_path: str = osp.abspath(check_path)

try:
new_ensemble = Ensemble(
name=name,
params=params or {},
path=entity_path,
name=name,
params=params or {},
path=entity_path,
Expand Down Expand Up @@ -620,8 +615,6 @@ def create_model(
if name is None:
raise AttributeError("Entity has no name. Please set name attribute.")
check_path = path or osp.join(self.exp_path, name)
if not isinstance(check_path, str):
raise TypeError
entity_path: str = osp.abspath(check_path)
if params is None:
params = {}
Expand All @@ -633,11 +626,6 @@ def create_model(
path=entity_path,
run_settings=run_settings,
batch_settings=batch_settings,
name=name,
params=params,
path=entity_path,
run_settings=run_settings,
batch_settings=batch_settings,
)
if enable_key_prefixing:
new_model.enable_key_prefixing()
Expand Down Expand Up @@ -777,7 +765,6 @@ def create_database(
self,
port: int = 6379,
path: t.Optional[str] = None,
path: t.Optional[str] = None,
db_nodes: int = 1,
batch: bool = False,
hosts: t.Optional[t.Union[t.List[str], str]] = None,
Expand Down Expand Up @@ -842,13 +829,10 @@ def create_database(

self.append_to_db_identifier_list(db_identifier)
check_path = path or osp.join(self.exp_path, db_identifier)
if not isinstance(check_path, str):
raise TypeError
entity_path: str = osp.abspath(check_path)
return Orchestrator(
port=port,
path=entity_path,
path=entity_path,
db_nodes=db_nodes,
batch=batch,
hosts=hosts,
Expand Down Expand Up @@ -973,23 +957,6 @@ def create_entity_dir(entity: t.Union[Orchestrator, Model, Ensemble]) -> None:
for member in ensemble.models:
create_entity_dir(member)

def _create_entity_dir(self, start_manifest: Manifest) -> None:
def create_entity_dir(entity: t.Union[Orchestrator, Model, Ensemble]) -> None:
if not os.path.isdir(entity.path):
os.makedirs(entity.path)

for model in start_manifest.models:
create_entity_dir(model)

for orch in start_manifest.dbs:
create_entity_dir(orch)

for ensemble in start_manifest.ensembles:
create_entity_dir(ensemble)

for member in ensemble.models:
create_entity_dir(member)

def __str__(self) -> str:
return self.name

Expand Down
2 changes: 1 addition & 1 deletion tests/test_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,4 +365,4 @@ def test_default_ensemble_with_path(
member_path = ensemble_path / member.name
assert member_path.exists()
assert member.path == str(member_path)
shutil.rmtree(ensemble_path)
shutil.rmtree(ensemble_path)

0 comments on commit 62a1339

Please sign in to comment.