Closed djhoese closed 1 year ago
Merging #520 (9e6101a) into main (2b94b70) will increase coverage by
0.01%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## main #520 +/- ##
==========================================
+ Coverage 94.32% 94.33% +0.01%
==========================================
Files 79 79
Lines 12944 12976 +32
==========================================
+ Hits 12209 12241 +32
Misses 735 735
Flag | Coverage Δ | |
---|---|---|
unittests | 94.33% <100.00%> (+0.01%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
Impacted Files | Coverage Δ | |
---|---|---|
pyresample/test/test_resamplers/test_resampler.py | 100.00% <100.00%> (ø) |
Oh shoot. I thought this already had approval and I just forgot to merge it. Sorry @mraspaud. Let me know if you want any changes to this. I completely didn't realize this wasn't already reviewed.
Note the user in the related issue said that this PR fixes their performance issues.
No worries, LGTM
As mentioned in #517, the new comparison added to the base resampler class in #508 was significantly slowing down any cases where non-areas were involved. This was most noticeable with EWA resampling as it is based on this resampler class and only deals with swath definitions.
The primary issue is/was that if the swaths are not equal the
==
used in theif
statement was comparing the every coordinate (every pixel) of the source swath arrays to every pixel of the area definitions generated coordinates. This is usually not necessary since when we get to that point the objects are probably not equal and two swaths that aren't the same exact objects (or the underlying arrays are not the same) are probably not equal even if they have the same shape.This PR is the first step in a proper fix. This should be released in a 1.27.1 release to fix the performance issue. The second step will be a separate PR (as discussed on the pytroll slack) where a
coordinates_equal
method will be added to the geometries to compare coordinates values no matter the cost in performance. The__eq__
method will be updated to be strict about objects needing to be the same type and then take the shortcuts implemented in this PR.git diff origin/main **/*py | flake8 --diff