Skip to content

Add xarray-lmfit extension for curve fitting to ecosystem documentation #10262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@
"sparse": ("https://sparse.pydata.org/en/latest/", None),
"xarray-tutorial": ("https://tutorial.xarray.dev/", None),
"zarr": ("https://zarr.readthedocs.io/en/stable/", None),
"xarray-lmfit": ("https://xarray-lmfit.readthedocs.io/stable", None),
}

# based on numpy doc/source/conf.py
Expand Down
1 change: 1 addition & 0 deletions doc/user-guide/ecosystem.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ Extend xarray capabilities
- `X-regression <https://github.com/kuchaale/X-regression>`_: Multiple linear regression from Statsmodels library coupled with Xarray library.
- `xskillscore <https://github.com/xarray-contrib/xskillscore>`_: Metrics for verifying forecasts.
- `xyzpy <https://xyzpy.readthedocs.io>`_: Easily generate high dimensional data, including parallelization.
- `xarray-lmfit <https://github.com/kmnhan/xarray-lmfit>`_: xarray extension for curve fitting using `lmfit <https://lmfit.github.io/lmfit-py/>`_.

Visualization
~~~~~~~~~~~~~
Expand Down
5 changes: 4 additions & 1 deletion xarray/core/dataarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -6418,7 +6418,7 @@ def curvefit(
"""
Curve fitting optimization for arbitrary functions.

Wraps `scipy.optimize.curve_fit` with `apply_ufunc`.
Wraps :py:func:`scipy.optimize.curve_fit` with :py:func:`~xarray.apply_ufunc`.

Parameters
----------
Expand Down Expand Up @@ -6558,6 +6558,9 @@ def curvefit(
--------
DataArray.polyfit
scipy.optimize.curve_fit
xarray.DataArray.xlm.modelfit
External method from `xarray-lmfit <https://xarray-lmfit.readthedocs.io/>`_
with more curve fitting functionality.
"""
# For DataArray, use the original implementation by converting to a dataset first
return self._to_temp_dataset().curvefit(
Expand Down
5 changes: 4 additions & 1 deletion xarray/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -9566,7 +9566,7 @@ def curvefit(
"""
Curve fitting optimization for arbitrary functions.

Wraps `scipy.optimize.curve_fit` with `apply_ufunc`.
Wraps :py:func:`scipy.optimize.curve_fit` with :py:func:`~xarray.apply_ufunc`.

Parameters
----------
Expand Down Expand Up @@ -9626,6 +9626,9 @@ def curvefit(
--------
Dataset.polyfit
scipy.optimize.curve_fit
xarray.Dataset.xlm.modelfit
External method from `xarray-lmfit <https://xarray-lmfit.readthedocs.io/>`_
with more curve fitting functionality.
"""
from xarray.computation.fit import curvefit as curvefit_impl

Expand Down
Loading