pytroll / pyresample

Geospatial image resampling in Python
http://pyresample.readthedocs.org
GNU Lesser General Public License v3.0
348 stars 94 forks source link

Refactor area boundary sides retrieval with `_geographic_sides` and `_projection_sides` methods #566

Closed ghiggi closed 10 months ago

ghiggi commented 10 months ago

This PR introduces the methods:

These two methods allow to retrieve the boundary sides for whatever pyresample area, whether is geostationary or not. In a future PR, these two methods will also include the logic to retrieve the boundary of AreaDefinition with out-of-Earth coordinates.

This PR:

BUT :

_get_geographic_sides

_get_projection_sides

codecov[bot] commented 10 months ago

Codecov Report

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

Comparison is base (c240c04) 94.09% compared to head (aee90a1) 94.06%.

Files Patch % Lines
pyresample/geometry.py 81.39% 8 Missing :warning:
pyresample/gradient/__init__.py 81.81% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #566 +/- ## ========================================== - Coverage 94.09% 94.06% -0.04% ========================================== Files 85 85 Lines 13235 13250 +15 ========================================== + Hits 12453 12463 +10 - Misses 782 787 +5 ``` | [Flag](https://app.codecov.io/gh/pytroll/pyresample/pull/566/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pytroll) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/pytroll/pyresample/pull/566/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pytroll) | `94.06% <84.12%> (-0.04%)` | :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=pytroll#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.

coveralls commented 10 months ago

Coverage Status

coverage: 93.644% (-0.03%) from 93.675% when pulling aee90a1879e3510a09e1a9ccdba2931342c28b33 on ghiggi:refactor-geometry-sides-creation into c240c0492ac5fd35add30d3c9fbcf3c45aba36ba on pytroll:main.

ghiggi commented 10 months ago

@djhoese ok now it works. Ready for review and eventually merge ;)

djhoese commented 10 months ago

Ugh, that's what I get for trying to fix something in the github GUI. Working on it...

djhoese commented 10 months ago

I'll merge this when CI passes. Another idea (for a much later PR) I had and maybe mentioned during out last meeting:

How useful are some of these helper methods outside of boundary creation? What if the new Boundary classes had a .from_area or .from_geometry classmethod or how we talked about a factory function (something like boundary_for_geometry(...))? All these little helper methods could be moved there and out of the geometry.py module.