conversion between different bounds conventions
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by reviewing cf_xarray's existing conversion functions between bounds and vertices, then examine how pandas IntervalIndex could integrate with xarray DataArray objects. Before implementation, clarify whether IntervalIndex conversions only are in scope or whether spatial representations belong in xvec; completion requires an agreed representation scope and corresponding conversion tests.
Written by the indexing model from the issue text.
Description
Bounds can be stored in different ways, and it would be great to have methods to convert between each of them.
Here's the ones I'm familiar with:
- bounds variables: additional bounds dimension for upper / lower bounds
- vertex variables: store the breaks in a
n + 1array (needs a new dimension) IntervalIndex: dedicated pandas object for intervals (might need some more integration)
The advantage of IntervalIndex is that it has the same dimensions and size as the cell center coordinate and thus can be attached to DataArray objects.
For spatial, there's a few more, but since they combine 2 coordinates they require stacking the spatial coordinates or need to be broadcast to 2D coordinates. For example:
- array of bounding boxes:
left, bottom, right, topfor each grid cell - array of bounding coordinates: list of coordinates of arbitrary length for each grid cell (not a good fit for
xarray's data model, but the limitedawkwardobjects might work?) - array of
shapelypolygons: one polygon of arbitrary length for each grid cell
cf_xarray already has conversion functions between bounds and vertices, so as far as I can tell conversion to and from IntervalIndex seem to be in scope. For the grid cell representation conversions I'm not sure, maybe put them into xvec?
- Dominant language
- Python
- Stars
- 181
- Forks
- 49
- Avg merge
- 43m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from xarray-contrib/cf-xarray
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
xarray-contrib/cf-xarray#623 ·
-
Consider adding opt-in support for circular axes when calling `bounds_to_vertices` (related to #594) Open
Difficulty 5/5 Over a week Newbie friendliness 38/100
xarray-contrib/cf-xarray#596 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
xarray-contrib/cf-xarray#570 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 15/100
xarray-contrib/cf-xarray#568 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
xarray-contrib/cf-xarray#566 · 2 comments ·
All issues in xarray-contrib/cf-xarray
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
zostera/django-bootstrap4#894 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
use-agent-os/agent-os#3276 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
NousResearch/hermes-agent#117848 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
zilliztech/memsearch#759 ·