Skip to content

Commit 83ee340

Browse files
authored
optimize: narrowed OptimizeResult.{fun,x} attrs for minimize[_scalar] (#504)
1 parent fcf1415 commit 83ee340

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

scipy-stubs/optimize/_minimize.pyi

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ _Tuple2: TypeAlias = tuple[_T, _T]
2121
_Tuple3: TypeAlias = tuple[_T, _T, _T]
2222
_Args: TypeAlias = tuple[object, ...]
2323

24-
_Float: TypeAlias = float | np.float64
2524
_Floating: TypeAlias = float | npc.floating
2625
_Float1D: TypeAlias = onp.Array1D[np.float64]
2726
_Float2D: TypeAlias = onp.Array2D[np.float64]
@@ -157,8 +156,8 @@ class _MinimizeScalarOptionsBounded(_MinimizeScalarOptionsCommon, TypedDict, tot
157156

158157
@type_check_only
159158
class _MinimizeScalarResultBase(_OptimizeResult):
160-
x: _Float
161-
fun: _Float
159+
x: np.float64
160+
fun: np.float64
162161

163162
@type_check_only
164163
class _MinimizeScalarResult(_MinimizeScalarResultBase):
@@ -181,7 +180,7 @@ class OptimizeResult(_OptimizeResult):
181180
x: _Float1D
182181
nit: int
183182
maxcv: float # requires `bounds`
184-
fun: _Float
183+
fun: float
185184
nfev: int
186185
jac: _Float1D # requires `jac`
187186
njev: int # requires `jac`

0 commit comments

Comments
 (0)