[Git][debian-gis-team/satpy][master] New 0008-Fix-NIRReflectance-test-compatibility-with-newer-xar.patch

Antonio Valentino (@antonio.valentino) gitlab at salsa.debian.org
Mon Oct 31 12:06:39 GMT 2022



Antonio Valentino pushed to branch master at Debian GIS Project / satpy


Commits:
e7f4f19f by Antonio Valentino at 2022-10-31T11:34:38+00:00
New 0008-Fix-NIRReflectance-test-compatibility-with-newer-xar.patch

- - - - -


3 changed files:

- debian/changelog
- + debian/patches/0008-Fix-NIRReflectance-test-compatibility-with-newer-xar.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+satpy (0.37.1-2) UNRELEASED; urgency=medium
+
+  * debia/patches:
+    - new 0008-Fix-NIRReflectance-test-compatibility-with-newer-xar.patch
+
+ -- Antonio Valentino <antonio.valentino at tiscali.it>  Mon, 31 Oct 2022 11:32:49 +0000
+
 satpy (0.37.1-1) unstable; urgency=medium
 
   * New upstream release.


=====================================
debian/patches/0008-Fix-NIRReflectance-test-compatibility-with-newer-xar.patch
=====================================
@@ -0,0 +1,40 @@
+From: Antonio Valentino <antonio.valentino at tiscali.it>
+Date: Mon, 31 Oct 2022 11:31:13 +0000
+Subject: Fix NIRReflectance test compatibility with newer xarray
+
+Backport from upstream 1a0401c1519646b38ca58244e0d1265855632d1c
+
+Forwarded: not-needed
+---
+ satpy/tests/test_modifiers.py | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/satpy/tests/test_modifiers.py b/satpy/tests/test_modifiers.py
+index d8598a5..d43a100 100644
+--- a/satpy/tests/test_modifiers.py
++++ b/satpy/tests/test_modifiers.py
+@@ -169,10 +169,10 @@ class TestNIRReflectance(unittest.TestCase):
+ 
+     def setUp(self):
+         """Set up the test case for the NIRReflectance compositor."""
+-        self.get_lonlats = mock.MagicMock()
++        get_lonlats = mock.MagicMock()
+         self.lons, self.lats = 1, 2
+-        self.get_lonlats.return_value = (self.lons, self.lats)
+-        area = mock.MagicMock(get_lonlats=self.get_lonlats)
++        get_lonlats.return_value = (self.lons, self.lats)
++        area = mock.MagicMock(get_lonlats=get_lonlats)
+ 
+         self.start_time = 1
+         self.metadata = {'platform_name': 'Meteosat-11',
+@@ -241,7 +241,9 @@ class TestNIRReflectance(unittest.TestCase):
+         info = {'modifiers': None}
+         res = comp([self.nir, self.ir_], optional_datasets=[], **info)
+ 
+-        self.get_lonlats.assert_called()
++        # due to copying of DataArrays, self.get_lonlats is not the same as the one that was called
++        # we must used the area from the final result DataArray
++        res.attrs["area"].get_lonlats.assert_called()
+         sza.assert_called_with(self.start_time, self.lons, self.lats)
+         self.refl_from_tbs.assert_called_with(self.da_sunz, self.nir.data, self.ir_.data, tb_ir_co2=None)
+         assert np.allclose(res.data, self.refl * 100).compute()


=====================================
debian/patches/series
=====================================
@@ -5,3 +5,4 @@
 0005-Fix-broken-test-in-i386.patch
 0006-Relax-test-tolerance.patch
 0007-Fix-privacy-breach.patch
+0008-Fix-NIRReflectance-test-compatibility-with-newer-xar.patch



View it on GitLab: https://salsa.debian.org/debian-gis-team/satpy/-/commit/e7f4f19f8a810b9905de9f29bbdd81a6235c03eb

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/satpy/-/commit/e7f4f19f8a810b9905de9f29bbdd81a6235c03eb
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20221031/d4a52419/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list