From 4f3805274cb2131c84afb3a30e41f22b2302cf56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20B=C3=BCschelberger?= Date: Thu, 28 Sep 2023 19:23:42 +0200 Subject: [PATCH] update function for mapping results --- osp/tools/mapping_functions.py | 3 ++- osp/wrappers/simzacros/simzacros_session.py | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osp/tools/mapping_functions.py b/osp/tools/mapping_functions.py index 6efd93d..89420d2 100644 --- a/osp/tools/mapping_functions.py +++ b/osp/tools/mapping_functions.py @@ -1901,9 +1901,10 @@ def map_tarball(engine, root_cuds_object, path=None) -> str: :return str: file system path to tarball """ + path = path or engine.path tar = tempfile.NamedTemporaryFile().name - shutil.make_archive(tar, "tar", engine.path) + shutil.make_archive(tar, "tar", path) tar_file = f"{tar}.tar" print(f"Job output dumped to {tar_file}") diff --git a/osp/wrappers/simzacros/simzacros_session.py b/osp/wrappers/simzacros/simzacros_session.py index 282680a..91f3b3d 100644 --- a/osp/wrappers/simzacros/simzacros_session.py +++ b/osp/wrappers/simzacros/simzacros_session.py @@ -65,7 +65,6 @@ def _run(self, root_cuds_object: Cuds): import adaptiveDesignProcedure as adp pz_job = pz.ZacrosJob(settings=pz_settings, lattice=pz_lattice, mechanism=pz_mechanism, cluster_expansion=pz_cluster_expansion) - pz_job.path = self.workdir def get_rate( conditions ): @@ -113,8 +112,8 @@ def get_rate( conditions ): uuid = get_upload(adpML.forestFileForCFD) pkl = emmo.PKLFile(uid=UUID(uuid)) self.adp_cuds.add(pkl, rel=emmo.hasOutput) - - self._tarball = map_results(pz_job, root_cuds_object) + path = os.path.join(self.workdir, self.jobname) + self._tarball = map_results(pz_job, root_cuds_object, path=self.path) else: pz_job = pz.ZacrosJob(settings=pz_settings, lattice=pz_lattice,