Skip to content
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

Porting the converting decorators from v2 #179

Merged
merged 19 commits into from
Nov 28, 2022
Merged
Changes from 1 commit
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
27 changes: 26 additions & 1 deletion tobac/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,18 @@ def xarray_to_iris(func):
-------
wrapper : function
Function including decorator.

Examples
--------
>>> segmentation_xarray = xarray_to_iris(segmentation)

This line creates a new function that can process xarray fields and
also outputs fields in xarray format, but otherwise works just like
the original function:

>>> mask_xarray, features = segmentation_xarray(
data_xarray, dxy, threshold
snilsn marked this conversation as resolved.
Show resolved Hide resolved
)
"""

import iris
Expand Down Expand Up @@ -1130,8 +1142,21 @@ def xarray_to_irispandas(func):
-------
wrapper : function
Function including decorator.
"""

Examples
--------
>>> linking_trackpy_xarray = xarray_to_irispandas(
linking_trackpy
)

This line creates a new function that can process xarray inputs and
also outputs in xarray formats, but otherwise works just like the
original function:

>>> track_xarray = linking_trackpy_xarray(
features_xarray, field_xarray, dt, dx
)
"""
import iris
import xarray
import pandas as pd
Expand Down