Skip to content

Commit

Permalink
In DCPF, check results before unpack
Browse files Browse the repository at this point in the history
  • Loading branch information
jinningwang committed May 18, 2024
1 parent b9ce40e commit 4b2a1bd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ams/routines/dcpf.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ def run(self, force_init=False, no_code=True,
msg = f"<{self.class_name}> solved in {s}, converged in "
msg += n_iter_str + f"with {sstats['solver_name']}."
logger.info(msg)
self.unpack(res)
try:
self.unpack(res)
except Exception:
logger.warning(f"Failed to unpack results from {self.class_name}.")
return False

Check warning on line 172 in ams/routines/dcpf.py

View check run for this annotation

Codecov / codecov/patch

ams/routines/dcpf.py#L170-L172

Added lines #L170 - L172 were not covered by tests
return True
else:
msg = f"{self.class_name} failed in "
Expand Down

0 comments on commit 4b2a1bd

Please sign in to comment.