better-optimize 0.0.2__tar.gz → 0.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: better_optimize
3
- Version: 0.0.2
3
+ Version: 0.0.3
4
4
  Summary: A drop-in replacement for scipy optimize functions with quality of life improvements
5
5
  License: MIT License
6
6
  Project-URL: Homepage, https://github.com/jessegrabowski/better_optimize
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2024-08-19T18:20:27+0800",
11
+ "date": "2024-08-19T21:06:06+0800",
12
12
  "dirty": false,
13
13
  "error": null,
14
- "full-revisionid": "3595536b9c1ead4ca6ea916046e4379d86e36ecc",
15
- "version": "0.0.2"
14
+ "full-revisionid": "6fa51b7ab8759ba1dbd944c0839b97719358c2a2",
15
+ "version": "0.0.3"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -78,6 +78,7 @@ def minimize(
78
78
  # Test hessian function -- if it returns a LinearOperator, it can't be used inside the wrapper
79
79
  args = () if args is None else args
80
80
  use_hess = hess is not None and not isinstance(hess(x0, *args), LinearOperator)
81
+ use_hessp = hessp is not None
81
82
 
82
83
  objective = ObjectiveWrapper(
83
84
  maxeval=maxiter,
@@ -95,8 +96,8 @@ def minimize(
95
96
  x0=x0,
96
97
  method=method,
97
98
  jac=True if has_fused_f_and_grad or jac is not None else None,
98
- hess=hess,
99
- hessp=hessp,
99
+ hess=None if not use_hess else lambda x: hess(x, *args),
100
+ hessp=None if not use_hessp else lambda x, p: hessp(x, p, *args),
100
101
  callback=objective.callback,
101
102
  **optimizer_kwargs,
102
103
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: better-optimize
3
- Version: 0.0.2
3
+ Version: 0.0.3
4
4
  Summary: A drop-in replacement for scipy optimize functions with quality of life improvements
5
5
  License: MIT License
6
6
  Project-URL: Homepage, https://github.com/jessegrabowski/better_optimize