pytroll / pyresample

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

Fix SwathDefinition html representation error when lons/lats 1D #610

Closed BENR0 closed 1 month ago

BENR0 commented 1 month ago

This is a quick fix for #609. It just sets things like resolution and width/height to Na in the case of 1D lat/lon arrays so the html representation does not break. It also does some quick fixing of formatting issues I noticed.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 81.25000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 93.96%. Comparing base (f3acfb4) to head (9c07da9). Report is 20 commits behind head on main.

Files Patch % Lines
pyresample/_formatting_html.py 81.25% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #610 +/- ## ========================================== - Coverage 93.98% 93.96% -0.03% ========================================== Files 86 86 Lines 13775 13786 +11 ========================================== + Hits 12947 12954 +7 - Misses 828 832 +4 ``` | [Flag](https://app.codecov.io/gh/pytroll/pyresample/pull/610/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/610/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pytroll) | `93.96% <81.25%> (-0.03%)` | :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 1 month ago

Coverage Status

coverage: 93.665% (-0.03%) from 93.692% when pulling 9c07da9b239b60c2df536c4fe9f7c207340977e7 on BENR0:fix_html_repr_swathdefinition into 60629b7f76fb5bd0a2713da8a2997f13f18e4351 on pytroll:main.

djhoese commented 1 month ago

Looks like the unstable environment are failing for some related things, but not only related things. I wonder if this is something we could/should fix in this PR:

 FAILED pyresample/test/test_formatting.py::test_plot_area_def_w_swath_def[LegacySwathDefinition] - TypeError: ufunc 'create_collection' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
FAILED pyresample/test/test_formatting.py::test_plot_area_def_w_swath_def[SwathDefinition] - TypeError: ufunc 'create_collection' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
FAILED pyresample/test/test_formatting.py::test_area_def_cartopy_installed - TypeError: ufunc 'create_collection' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
FAILED pyresample/test/test_formatting.py::test_area_repr_w_static_files - TypeError: ufunc 'create_collection' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
FAILED pyresample/test/test_formatting.py::test_area_repr_wo_static_files - TypeError: ufunc 'create_collection' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
FAILED pyresample/test/test_sgeom/test_point.py::TestSMultiPoint::test_to_shapely - TypeError: ufunc 'create_collection' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
djhoese commented 1 month ago

Bug report for the failures: https://github.com/shapely/shapely/issues/2098

Let's merge this since these failures are not your fault and are in the unstable environment.