xarray-contrib / cf-xarray

an accessor for xarray objects that interprets CF attributes
https://cf-xarray.readthedocs.io/
Apache License 2.0
152 stars 39 forks source link

Add conversion between shapely and cf for polygons #495

Closed jsignell closed 5 months ago

jsignell commented 5 months ago

This is a follow up to #460 now with polygons!

There is a slight wrinkle in that unlike shapely cf doesn't seem to associate particular holes with particular polygons. I am kind of assuming that the order will be interleaved exterior and interior rings. This seem to match the examples that I've seen.

codecov[bot] commented 5 months ago

Codecov Report

Attention: 12 lines in your changes are missing coverage. Please review.

Comparison is base (5ee1bc7) 85.78% compared to head (a7db3ad) 85.78%.

Files Patch % Lines
cf_xarray/geometry.py 86.20% 9 Missing and 3 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #495 +/- ## ======================================= Coverage 85.78% 85.78% ======================================= Files 13 13 Lines 2279 2364 +85 Branches 172 183 +11 ======================================= + Hits 1955 2028 +73 - Misses 294 303 +9 - Partials 30 33 +3 ``` | [Flag](https://app.codecov.io/gh/xarray-contrib/cf-xarray/pull/495/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=xarray-contrib) | Coverage Δ | | |---|---|---| | [mypy](https://app.codecov.io/gh/xarray-contrib/cf-xarray/pull/495/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=xarray-contrib) | `38.53% <28.73%> (-0.45%)` | :arrow_down: | | [unittests](https://app.codecov.io/gh/xarray-contrib/cf-xarray/pull/495/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=xarray-contrib) | `93.98% <95.58%> (+0.05%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=xarray-contrib#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jsignell commented 5 months ago

Ok @dcherian I think this one is good to go!

dcherian commented 5 months ago

Thanks Julia! Can we have you on board as a maintainer please/