8000 Add a note about potential type promotion to interp_multidim by kafitzgerald · Pull Request #504 · NCAR/geocat-comp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add a note about potential type promotion to interp_multidim #504

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 6 commits into from
Nov 23, 2023
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
2 changes: 2 additions & 0 deletions docs/release-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Documentation
^^^^^^^^^^^
* Transferred fourier filter example from Geocat-examples by `Julia Kent`_ in (:pr:`511`)
* Updated documentation links by `Anissa Zacharias`_ in (:pr:`518`)
* Augment documentation for ``interp_multidim`` by `Katelyn FitzGerald`_ in (:pr:`504`)


v2023.10.1
----------
Expand Down
15 changes: 9 additions & 6 deletions geocat/comp/interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,9 +625,12 @@ def interp_multidim(
method: str = "linear",
fill_value: typing.Union[str, np.number] = np.nan) -> supported_types:
"""Multidimensional interpolation of variables. Uses ``xarray.interp`` to
perform linear interpolation. Will not perform extrapolation, returns
perform interpolation. Will not perform extrapolation by default, returns
missing values if any surrounding points contain missing values.

.. warning::
The output data type may be promoted to that of the coordinate data.

Parameters
----------
data_in : :class:`xarray.DataArray`, ndarray
Expand Down Expand Up @@ -662,16 +665,16 @@ def interp_multidim(
“linear” or “nearest” for multidimensional array

fill_value: str, optional
Set as 'extrapolate' to allow extrapoltion of data. Default is
Set as 'extrapolate' to allow extrapolation of data. Default is
no extrapolation.

Returns
-------
data_out : ndarray, :class:`xarray.DataArray`
Returns same data type as input ``data_in``. Shape will be the same as
input array except
for last two dimensions which will be equal to thecoordinates given in
``data_out``
Returns the same type of object as input ``data_in``. However, the type of
612C the data in the array may be promoted to that of the coordinates. Shape
will be the same as input array except for last two dimensions which will
be equal to the coordinates given in ``data_out``.

Examples
--------
Expand Down
0