Skip to content

Commit

Permalink
resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
Heerpa committed Apr 8, 2024
1 parent ac98670 commit b30017f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 15 deletions.
6 changes: 3 additions & 3 deletions picasso_workflow/confluence.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def undrift_rcc(self, i, pars_undrift, res_undrift):
self.report_page_name, self.report_page_id, text
)

if driftimg_fn := pars_undrift.get("drift_image"):
if driftimg_fn := pars_undrift.get("filepath_plot"):
self.ci.upload_attachment(self.report_page_id, driftimg_fn)
self.ci.update_page_content_with_image_attachment(
self.report_page_name,
Expand Down Expand Up @@ -289,8 +289,8 @@ def summarize_dataset(self, i, parameters, results):
text += f"""
<p>NeNa</p>
<ul>
<li>Best Values: {str(results.get('best_vals'))}</li>
<li>Result: {str(results.get('res'))}</li>
<li>Best Values: {str(meth_res.get('best_vals'))}</li>
<li>Result: {str(meth_res.get('res'))}</li>
</ul>"""
text += """
</ac:layout-cell></ac:layout-section></ac:layout>
Expand Down
36 changes: 24 additions & 12 deletions picasso_workflow/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,26 +239,33 @@ def run(self):
# self.result_folder, sgl_wkfl_reporter_config['report_name'])
if self.continue_workflow:
try:
logger.debug('loading WorkflowRunner from ' + os.path.join(
self.result_folder,
sgl_wkfl_reporter_config["report_name"]+'_'+self.postfix,
))
logger.debug(
"loading WorkflowRunner from "
+ os.path.join(
self.result_folder,
sgl_wkfl_reporter_config["report_name"]
+ "_"
+ self.postfix,
)
)
wr = WorkflowRunner.load(
os.path.join(
self.result_folder,
sgl_wkfl_reporter_config["report_name"]+'_'+self.postfix,
sgl_wkfl_reporter_config["report_name"]
+ "_"
+ self.postfix,
)
)
except Exception:
logger.debug('loading did not work. creating from dict.')
logger.debug("loading did not work. creating from dict.")
wr = WorkflowRunner.config_from_dicts(
sgl_wkfl_reporter_config,
sgl_wkfl_analysis_config,
parameter_set,
postfix=self.postfix,
)
else:
logger.debug('not dontinuing workflow.starting new.')
logger.debug("not dontinuing workflow.starting new.")
wr = WorkflowRunner.config_from_dicts(
sgl_wkfl_reporter_config,
sgl_wkfl_analysis_config,
Expand Down Expand Up @@ -521,7 +528,10 @@ def run(self):
# analyzed. Skipping."""
# )
# continue
if (all_previously_succeeded and self.module_previously_succeeded(i, module_name)) and self.module_previously_analyzed(i):
if (
all_previously_succeeded
and self.module_previously_succeeded(i, module_name)
) and self.module_previously_analyzed(i):
# if it has, skip this. This way an aborted module
# will be re-analyzed.
logger.debug(
Expand Down Expand Up @@ -567,7 +577,7 @@ def save(self, dirn="."):
"analysis_config": pce.run(self.analysis_config),
"workflow_modules": pce.run(self.workflow_modules),
}
logger.debug('saving data:')
logger.debug("saving data:")
logger.debug(str(data))
with open(filepath, "w") as f:
yaml.dump(data, f)
Expand Down Expand Up @@ -627,9 +637,11 @@ def module_previously_succeeded(self, i, module_name):
whether a previous module evaluation has succeeded
"""
module_id = f"{i:02d}_{module_name}"
logger.debug('looking for previous ' + module_id)
logger.debug("looking for previous " + module_id)
logger.debug(str(self.results.get(module_id, {})))
logger.debug(str(self.results.get(module_id, {}).get("success", False)))
logger.debug(
str(self.results.get(module_id, {}).get("success", False))
)
return self.results.get(module_id, {}).get("success", False)

def call_module(self, fun_name, i, parameters):
Expand Down Expand Up @@ -658,7 +670,7 @@ def call_module(self, fun_name, i, parameters):
try:
parameters, self.results[key] = fun_ap(i, parameters)
except AutoPicassoError as e:
self.results[key]['success'] = False
self.results[key]["success"] = False
logger.error(e)
raise e
logger.debug(f"RESULTS: {self.results[key]}")
Expand Down

0 comments on commit b30017f

Please sign in to comment.