Skip to content

Commit

Permalink
fix: remove callback for progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
rabii-chaarani committed Jun 6, 2024
1 parent f846d3e commit a6a2051
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
27 changes: 21 additions & 6 deletions FoldOptLib/examples/axial_surface_optimisation_part_1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3313,10 +3313,6 @@
"execution_count": 18,
"id": "bd762c7b-1283-46cb-9c31-c4bfed342ade",
"metadata": {
"collapsed": true,
"jupyter": {
"outputs_hidden": true
},
"scrolled": true
},
"outputs": [
Expand All @@ -3336,10 +3332,29 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 19,
"id": "aca0b748-d57a-4f16-a64c-be0308cb37d7",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Axial surface optimisation results: \n"
]
},
{
"ename": "NameError",
"evalue": "name 'results' is not defined",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[19], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mAxial surface optimisation results: \u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m----> 2\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mstrike: \u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[43mresults\u001b[49m\u001b[38;5;241m.\u001b[39mx[\u001b[38;5;241m0\u001b[39m])\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mdip: \u001b[39m\u001b[38;5;124m'\u001b[39m, results\u001b[38;5;241m.\u001b[39mx[\u001b[38;5;241m1\u001b[39m])\n",
"\u001b[0;31mNameError\u001b[0m: name 'results' is not defined"
]
}
],
"source": [
"print('Axial surface optimisation results: ')\n",
"print('strike: ', results.x[0])\n",
Expand Down
8 changes: 4 additions & 4 deletions FoldOptLib/solvers/solvers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Callable, Dict, Any, Tuple, Union, List
import numpy
from ..utils.utils import create_progress_bar
# from ..utils.utils import create_progress_bar
from scipy.optimize import minimize, differential_evolution
from ..datatypes import SolverType
import beartype
Expand Down Expand Up @@ -35,7 +35,7 @@ def differential_evolution(
polish: bool = False,
strategy: str = "best2exp",
mutation: Tuple[float, float] = (0.3, 0.99),
callback=create_progress_bar(5000),
# callback=create_progress_bar(5000),
**kwargs,
) -> Dict:
"""
Expand Down Expand Up @@ -90,7 +90,7 @@ def constrained_trust_region(
objective_function: Callable,
x0: numpy.ndarray,
constraints=None,
callback=create_progress_bar(5000),
# callback=create_progress_bar(5000),
**kwargs
) -> Dict:
"""
Expand All @@ -117,7 +117,7 @@ def constrained_trust_region(
method="trust-constr",
jac="2-point",
constraints=constraints,
callback=callback,
# callback=callback,
**kwargs,
)

Expand Down

0 comments on commit a6a2051

Please sign in to comment.