pytroll / pyresample

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

Fix shortcut for prime meridian checks #551

Closed djhoese closed 10 months ago

djhoese commented 10 months ago

This shortcut exists in the code to avoid having to convert a CRS to a PROJ.4 dict if it isn't needed. I'm not sure how or why, but .prime_meridian is not an integer, it is an object, and comparing it to == 0 will always give False from what I'm seeing. I should have always been using .prime_meridian.longitude.

I'm not exactly sure how to test this as it is just a performance thing (avoid unnecessary conversions). The end result should have always been the same.

codecov[bot] commented 10 months ago

Codecov Report

Merging #551 (9c73232) into main (c0025ed) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #551   +/-   ##
=======================================
  Coverage   94.25%   94.26%           
=======================================
  Files          82       82           
  Lines       13076    13076           
=======================================
+ Hits        12325    12326    +1     
+ Misses        751      750    -1     
Flag Coverage Δ
unittests 94.26% <100.00%> (+<0.01%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
pyresample/utils/proj4.py 100.00% <100.00%> (+1.13%) :arrow_up:
coveralls commented 10 months ago

Coverage Status

coverage: 93.84% (+0.008%) from 93.832% when pulling 9c7323224e29c5c5c134e17b367a55457052bc84 on djhoese:bugfix-geodetic-crs-pm into c0025ed8905cb8d026de4b3a48451346b802b36c on pytroll:main.

djhoese commented 10 months ago

This was a pretty simple PR so just merging to get it off of my TODO list.