Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-janssen committed Oct 27, 2024
1 parent 91d2e68 commit a813845
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion executorlib/cache/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def execute_tasks_h5(
memory_dict=memory_dict,
file_name_dict=file_name_dict,
)
resource_dict = task_dict["resource_dict"]
resource_dict = task_dict["resource_dict"].copy()
if "cores" not in resource_dict:
resource_dict["cores"] = cores_per_worker
if "cwd" not in resource_dict:
Expand Down
2 changes: 2 additions & 0 deletions executorlib/standalone/cache/spawner.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def execute_in_subprocess(
]
if resource_dict is None:
resource_dict = {"cwd": None}
elif len(resource_dict) == 0:
resource_dict = {"cwd": None}
return subprocess.Popen(command, universal_newlines=True, cwd=resource_dict["cwd"])


Expand Down
3 changes: 0 additions & 3 deletions tests/test_cache_executor_serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def test_executor_function(self):
"cache_directory": cache_dir,
"execute_function": execute_in_subprocess,
"cores_per_worker": 1,
"resource_dict": {"cwd": None},
"terminate_function": terminate_subprocess,
},
)
Expand Down Expand Up @@ -115,7 +114,6 @@ def test_executor_function_dependence_kwargs(self):
"cache_directory": cache_dir,
"execute_function": execute_in_subprocess,
"cores_per_worker": 1,
"resource_dict": {"cwd": None},
"terminate_function": terminate_subprocess,
},
)
Expand Down Expand Up @@ -157,7 +155,6 @@ def test_executor_function_dependence_args(self):
"cache_directory": cache_dir,
"execute_function": execute_in_subprocess,
"cores_per_worker": 1,
"resource_dict": {"cwd": None},
"terminate_function": terminate_subprocess,
},
)
Expand Down

0 comments on commit a813845

Please sign in to comment.