Skip to content

Commit

Permalink
don't forget to remove the dir from the model dir after simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
vtnate committed Dec 22, 2023
1 parent a818717 commit 5ece6ba
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions geojson_modelica_translator/modelica/modelica_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,5 +422,10 @@ def cleanup_path(self, path: Path, model_name: str, **kwargs: dict) -> None:
for f in path.glob(pattern): # type: ignore
Path(f).unlink(missing_ok=True)

# Note that the om.py script that runs within the container does cleanup
# the 'tmp' folder including the 'tmp/temperatureResponseMatrix' folder
# remove the 'tmp' folder that was created, because it will
# have different permissions than the user running the container
if (path / 'tmp' / 'temperatureResponseMatrix').exists():
shutil.rmtree(path / 'tmp' / 'temperatureResponseMatrix')
# check if the tmp folder is empty now, and if so remove
if not any((path / 'tmp').iterdir()):
(path / 'tmp').rmdir()

0 comments on commit 5ece6ba

Please sign in to comment.