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

Fix conversion between shapely and cf for lines #493

Closed jsignell closed 5 months ago

jsignell commented 5 months ago

I started working on conversion between shapely and cf for polygons and in that work I realized that I had misunderstood the roles of part_node_count and node_count in #460.

My new understanding is mostly based on: "Example 7.16. Polygons with holes" in https://cfconventions.org/cf-conventions/cf-conventions.html#geometries

Even though that example is for polygons it shows clearly that the part_node_count is meant to denote the edges of the individual shapes and node_count is meant to denote the edges of multi-shapes.

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (f6c8a1f) 85.81% compared to head (ba4a67f) 93.93%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #493 +/- ## ========================================== + Coverage 85.81% 93.93% +8.11% ========================================== Files 13 12 -1 Lines 2284 1714 -570 Branches 173 0 -173 ========================================== - Hits 1960 1610 -350 + Misses 294 104 -190 + Partials 30 0 -30 ``` | [Flag](https://app.codecov.io/gh/xarray-contrib/cf-xarray/pull/493/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/493/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=xarray-contrib) | `?` | | | [unittests](https://app.codecov.io/gh/xarray-contrib/cf-xarray/pull/493/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=xarray-contrib) | `93.93% <100.00%> (-0.02%)` | :arrow_down: | 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.

dcherian commented 5 months ago

Thanks!