Skip to content

Commit

Permalink
Print solver iteration and convergence param
Browse files Browse the repository at this point in the history
  • Loading branch information
timothy-nunn committed Aug 16, 2023
1 parent 0c6010e commit ff70078
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions process/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ def solve(self) -> int:
if self.b is not None:
B = np.identity(numerics.nvar) * self.b

def _solver_callback(i: int, _x, _result, convergence_param: float):
print(f"{i+1} | Convergence Parameter: {convergence_param}")

try:
x, _, _, res = solve(
problem,
Expand All @@ -178,6 +181,7 @@ def solve(self) -> int:
epsilon=self.tolerance,
qsp_options={"eps_rel": 1e-1, "adaptive_rho_interval": 25},
initial_B=B,
callback=_solver_callback,
)
except VMCONConvergenceException as e:
if isinstance(e, LineSearchConvergenceException):
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ pandas>=1.1.5
bokeh==2.4.0
mkdocstrings==0.18.0
flinter==0.3.0
PyVMCON>=2.0.0,<3.0.0
PyVMCON>=2.1.0,<3.0.0
CoolProp>=6.4
Jinja2>=3.0
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"tables",
"SALib",
"numba>=0.55.2",
"PyVMCON>=2.0.0,<3.0.0",
"PyVMCON>=2.1.0,<3.0.0",
"CoolProp>=6.4",
],
"extras_require": {"test": ["pytest"]},
Expand Down

0 comments on commit ff70078

Please sign in to comment.