Skip to content

Commit 5213f0d

Browse files
authored
change type of curvefit's p0 and bounds to mapping (#8502)
* change type of curvefit's p0 and bounds to mapping * add entry to whats-new
1 parent abd2068 commit 5213f0d

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

doc/whats-new.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ Bug fixes
5858
- Fix dtype inference for ``pd.CategoricalIndex`` when categories are backed by a ``pd.ExtensionDtype`` (:pull:`8481`)
5959
- Fix writing a variable that requires transposing when not writing to a region (:pull:`8484`)
6060
By `Maximilian Roos <https://github.com/max-sixty>`_.
61-
61+
- Static typing of ``p0`` and ``bounds`` arguments of :py:func:`xarray.DataArray.curvefit` and :py:func:`xarray.Dataset.curvefit`
62+
was changed to ``Mapping`` (:pull:`8502`).
63+
By `Michael Niklas <https://github.com/headtr1ck>`_.
6264

6365
Documentation
6466
~~~~~~~~~~~~~

xarray/core/dataarray.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6220,8 +6220,8 @@ def curvefit(
62206220
func: Callable[..., Any],
62216221
reduce_dims: Dims = None,
62226222
skipna: bool = True,
6223-
p0: dict[str, float | DataArray] | None = None,
6224-
bounds: dict[str, tuple[float | DataArray, float | DataArray]] | None = None,
6223+
p0: Mapping[str, float | DataArray] | None = None,
6224+
bounds: Mapping[str, tuple[float | DataArray, float | DataArray]] | None = None,
62256225
param_names: Sequence[str] | None = None,
62266226
errors: ErrorOptions = "raise",
62276227
kwargs: dict[str, Any] | None = None,

xarray/core/dataset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9622,8 +9622,8 @@ def curvefit(
96229622
func: Callable[..., Any],
96239623
reduce_dims: Dims = None,
96249624
skipna: bool = True,
9625-
p0: dict[str, float | DataArray] | None = None,
9626-
bounds: dict[str, tuple[float | DataArray, float | DataArray]] | None = None,
9625+
p0: Mapping[str, float | DataArray] | None = None,
9626+
bounds: Mapping[str, tuple[float | DataArray, float | DataArray]] | None = None,
96279627
param_names: Sequence[str] | None = None,
96289628
errors: ErrorOptions = "raise",
96299629
kwargs: dict[str, Any] | None = None,

0 commit comments

Comments
 (0)