From 728927f474270bc90cd1aabd880b61f7cbefa42e Mon Sep 17 00:00:00 2001 From: "Adam.Dybbroe" Date: Thu, 24 Mar 2022 16:33:28 +0100 Subject: [PATCH 01/17] Add example using multiple readers Signed-off-by: Adam.Dybbroe --- satpy/scene.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/satpy/scene.py b/satpy/scene.py index 701aaf6a65..940e8f6f1f 100644 --- a/satpy/scene.py +++ b/satpy/scene.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright (c) 2010-2017 Satpy developers +# Copyright (c) 2010-2017, 2022 Satpy developers # # This file is part of satpy. # @@ -71,6 +71,13 @@ def __init__(self, filenames=None, reader=None, filter_parameters=None, reader_kwargs=None): """Initialize Scene with Reader and Compositor objects. + Notice (see parameters list below) )that it is possible to load a + combinations of files or sets of files each requiring their specific + reader. For that the `filenames` needs to be a ``dict``, like e.g.:: + + scn = Scene(filenames={'nwcsaf-pps_nc': glob('/path/to/nwc/saf/pps/files/*'), + 'modis_l1b': glob('/path/to/modis/lvl1/files/*')}) + To load data `filenames` and preferably `reader` must be specified. If `filenames` is provided without `reader` then the available readers will be searched for a Reader that can support the provided files. This can take a considerable amount of time so it is recommended that `reader` always be provided. Note without `filenames` From a3777510cdc4579ab3f987c09d9af87184b4fc23 Mon Sep 17 00:00:00 2001 From: Adam Dybbroe Date: Fri, 25 Mar 2022 14:53:02 +0100 Subject: [PATCH 02/17] Update satpy/scene.py Fix typographic error Co-authored-by: Gerrit Holl --- satpy/scene.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/satpy/scene.py b/satpy/scene.py index 940e8f6f1f..bf84fc47fa 100644 --- a/satpy/scene.py +++ b/satpy/scene.py @@ -71,7 +71,7 @@ def __init__(self, filenames=None, reader=None, filter_parameters=None, reader_kwargs=None): """Initialize Scene with Reader and Compositor objects. - Notice (see parameters list below) )that it is possible to load a + Notice (see parameters list below) that it is possible to load a combinations of files or sets of files each requiring their specific reader. For that the `filenames` needs to be a ``dict``, like e.g.:: From 6bae054b2f8c29949976b5211a80e9aa4fb61927 Mon Sep 17 00:00:00 2001 From: Adam Dybbroe Date: Fri, 25 Mar 2022 14:53:16 +0100 Subject: [PATCH 03/17] Update satpy/scene.py Fix typo Co-authored-by: Gerrit Holl --- satpy/scene.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/satpy/scene.py b/satpy/scene.py index bf84fc47fa..bd9371092c 100644 --- a/satpy/scene.py +++ b/satpy/scene.py @@ -72,7 +72,7 @@ def __init__(self, filenames=None, reader=None, filter_parameters=None, """Initialize Scene with Reader and Compositor objects. Notice (see parameters list below) that it is possible to load a - combinations of files or sets of files each requiring their specific + combination of files or sets of files each requiring their specific reader. For that the `filenames` needs to be a ``dict``, like e.g.:: scn = Scene(filenames={'nwcsaf-pps_nc': glob('/path/to/nwc/saf/pps/files/*'), From fbf7a4541649fd27c7cd72a016fb228f96295d9f Mon Sep 17 00:00:00 2001 From: Adam Dybbroe Date: Fri, 25 Mar 2022 14:53:35 +0100 Subject: [PATCH 04/17] Update satpy/scene.py Fix typo Co-authored-by: Gerrit Holl --- satpy/scene.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/satpy/scene.py b/satpy/scene.py index bd9371092c..9ec4819d5f 100644 --- a/satpy/scene.py +++ b/satpy/scene.py @@ -73,7 +73,7 @@ def __init__(self, filenames=None, reader=None, filter_parameters=None, Notice (see parameters list below) that it is possible to load a combination of files or sets of files each requiring their specific - reader. For that the `filenames` needs to be a ``dict``, like e.g.:: + reader. For that ``filenames`` needs to be a `dict`, like e.g.:: scn = Scene(filenames={'nwcsaf-pps_nc': glob('/path/to/nwc/saf/pps/files/*'), 'modis_l1b': glob('/path/to/modis/lvl1/files/*')}) From 047b8c6a6b6d4ec7e129b9235be1307216e21427 Mon Sep 17 00:00:00 2001 From: "Adam.Dybbroe" Date: Fri, 1 Apr 2022 10:57:08 +0200 Subject: [PATCH 05/17] Rearrange examples so the most common comes first, and the special case comes last Signed-off-by: Adam.Dybbroe --- satpy/scene.py | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/satpy/scene.py b/satpy/scene.py index 9ec4819d5f..cbea8919c0 100644 --- a/satpy/scene.py +++ b/satpy/scene.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright (c) 2010-2017, 2022 Satpy developers +# Copyright (c) 2010-2022 Satpy developers # # This file is part of satpy. # @@ -71,21 +71,30 @@ def __init__(self, filenames=None, reader=None, filter_parameters=None, reader_kwargs=None): """Initialize Scene with Reader and Compositor objects. - Notice (see parameters list below) that it is possible to load a - combination of files or sets of files each requiring their specific - reader. For that ``filenames`` needs to be a `dict`, like e.g.:: + To load data `filenames` and preferably `reader` must be specified:: - scn = Scene(filenames={'nwcsaf-pps_nc': glob('/path/to/nwc/saf/pps/files/*'), - 'modis_l1b': glob('/path/to/modis/lvl1/files/*')}) + scn = Scene(filenames=glob('/path/to/viirs/sdr/files/*'), reader='viirs_sdr') - To load data `filenames` and preferably `reader` must be specified. If `filenames` is provided without `reader` - then the available readers will be searched for a Reader that can support the provided files. This can take - a considerable amount of time so it is recommended that `reader` always be provided. Note without `filenames` - the Scene is created with no Readers available requiring Datasets to be added manually:: + + If ``filenames`` is provided without ``reader`` then the available readers + will be searched for a Reader that can support the provided files. This + can take a considerable amount of time so it is recommended that + ``reader`` always be provided. Note without ``filenames`` the Scene is + created with no Readers available requiring Datasets to be added + manually:: scn = Scene() scn['my_dataset'] = Dataset(my_data_array, **my_info) + Further, notice that it is also possible to load a combination of files + or sets of files each requiring their specific reader. For that + ``filenames`` needs to be a `dict` (see parameters list below), like + e.g.:: + + scn = Scene(filenames={'nwcsaf-pps_nc': glob('/path/to/nwc/saf/pps/files/*'), + 'modis_l1b': glob('/path/to/modis/lvl1/files/*')}) + + Args: filenames (iterable or dict): A sequence of files that will be used to load data from. A ``dict`` object should map reader names to a list of filenames for that reader. From b1e4240d4464c443f916fcc19a6d32a8c67fa314 Mon Sep 17 00:00:00 2001 From: "Adam.Dybbroe" Date: Sat, 2 Apr 2022 12:48:18 +0200 Subject: [PATCH 06/17] Fix formulation Signed-off-by: Adam.Dybbroe --- satpy/scene.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/satpy/scene.py b/satpy/scene.py index cbea8919c0..6b1f735f0c 100644 --- a/satpy/scene.py +++ b/satpy/scene.py @@ -88,8 +88,7 @@ def __init__(self, filenames=None, reader=None, filter_parameters=None, Further, notice that it is also possible to load a combination of files or sets of files each requiring their specific reader. For that - ``filenames`` needs to be a `dict` (see parameters list below), like - e.g.:: + ``filenames`` needs to be a `dict` (see parameters list below), e.g.:: scn = Scene(filenames={'nwcsaf-pps_nc': glob('/path/to/nwc/saf/pps/files/*'), 'modis_l1b': glob('/path/to/modis/lvl1/files/*')}) From a1f796e04af592e411550eeec653f0c4660f3d95 Mon Sep 17 00:00:00 2001 From: David Hoese Date: Sat, 2 Apr 2022 21:19:37 -0500 Subject: [PATCH 07/17] Remove marine_clean_aerosol from default AHI rayleigh_corrected modifier --- satpy/etc/composites/ahi.yaml | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/satpy/etc/composites/ahi.yaml b/satpy/etc/composites/ahi.yaml index ef75c4c972..7ab2e2820c 100644 --- a/satpy/etc/composites/ahi.yaml +++ b/satpy/etc/composites/ahi.yaml @@ -2,24 +2,11 @@ sensor_name: visir/ahi modifiers: rayleigh_corrected: - modifier: !!python/name:satpy.modifiers.PSPRayleighReflectance - atmosphere: us-standard - aerosol_type: marine_clean_aerosol - prerequisites: - - wavelength: 0.64 - modifiers: [sunz_corrected] - optional_prerequisites: - - satellite_azimuth_angle - - satellite_zenith_angle - - solar_azimuth_angle - - solar_zenith_angle - - no_aerosol_rayleigh_corrected: modifier: !!python/name:satpy.modifiers.PSPRayleighReflectance atmosphere: us-standard aerosol_type: rayleigh_only prerequisites: - - name: B03 + - wavelength: B03 modifiers: [sunz_corrected] optional_prerequisites: - satellite_azimuth_angle @@ -48,9 +35,9 @@ composites: fractions: [0.6321, 0.2928, 0.0751] prerequisites: - name: B02 - modifiers: [sunz_corrected, no_aerosol_rayleigh_corrected] + modifiers: [sunz_corrected, rayleigh_corrected] - name: B03 - modifiers: [sunz_corrected, no_aerosol_rayleigh_corrected] + modifiers: [sunz_corrected, rayleigh_corrected] - name: B04 modifiers: [sunz_corrected] standard_name: none @@ -247,10 +234,10 @@ composites: compositor: !!python/name:satpy.composites.SelfSharpenedRGB prerequisites: - name: B03 - modifiers: [sunz_corrected, no_aerosol_rayleigh_corrected] + modifiers: [sunz_corrected, rayleigh_corrected] - name: green_true_color_reproduction - name: B01 - modifiers: [sunz_corrected, no_aerosol_rayleigh_corrected] + modifiers: [sunz_corrected, rayleigh_corrected] standard_name: true_color_reproduction # true_color_reducedsize_land: From afd52240b9f406e23bc895b6244afd7c14b5f3e8 Mon Sep 17 00:00:00 2001 From: mherbertson <57386258+mherbertson@users.noreply.github.com> Date: Mon, 4 Apr 2022 05:45:27 +0000 Subject: [PATCH 08/17] Ignore alpha when adding luminance --- satpy/composites/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/satpy/composites/__init__.py b/satpy/composites/__init__.py index 90f4e67aac..f0b4b1922a 100644 --- a/satpy/composites/__init__.py +++ b/satpy/composites/__init__.py @@ -1101,7 +1101,8 @@ def __call__(self, projectables, *args, **kwargs): # Get the enhanced version of the RGB composite to be sharpened rgb_img = enhance2dataset(projectables[1]) - rgb_img *= luminance + # Ignore alpha band when applying luminance + rgb_img = rgb_img.where(rgb_img.bands == 'A', rgb_img * luminance) return super(SandwichCompositor, self).__call__(rgb_img, *args, **kwargs) From 99d2e31c8e702116398c2aecb7104011d242fe73 Mon Sep 17 00:00:00 2001 From: mherbertson <57386258+mherbertson@users.noreply.github.com> Date: Tue, 5 Apr 2022 04:51:31 +0000 Subject: [PATCH 09/17] Update test to compare RGBA and A remains intact --- satpy/tests/test_composites.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/satpy/tests/test_composites.py b/satpy/tests/test_composites.py index 77463872b2..d95b37b449 100644 --- a/satpy/tests/test_composites.py +++ b/satpy/tests/test_composites.py @@ -456,20 +456,26 @@ def test_compositor(self, e2d): """Test luminance sharpening compositor.""" from satpy.composites import SandwichCompositor - rgb_arr = da.from_array(np.random.random((3, 2, 2)), chunks=2) - rgb = xr.DataArray(rgb_arr, dims=['bands', 'y', 'x']) + # Test RGBA + bands = ['R', 'G', 'B', 'A'] + rgba_arr = da.from_array(np.random.random((4, 2, 2)), chunks=2) + rgba = xr.DataArray(rgba_arr, dims=['bands', 'y', 'x'], coords={'bands': bands}) lum_arr = da.from_array(100 * np.random.random((2, 2)), chunks=2) lum = xr.DataArray(lum_arr, dims=['y', 'x']) # Make enhance2dataset return unmodified dataset - e2d.return_value = rgb + e2d.return_value = rgba comp = SandwichCompositor(name='test') - res = comp([lum, rgb]) + res = comp([lum, rgba]) - for i in range(3): - np.testing.assert_allclose(res.data[i, :, :], - rgb_arr[i, :, :] * lum_arr / 100.) + for band in rgba: + if band.bands != 'A': + # Check compositor has modified this band + np.testing.assert_allclose(res.loc[band.bands].to_numpy(), band.to_numpy() * lum_arr / 100.) + else: + # Check Alpha band remains intact + np.testing.assert_allclose(res.loc[band.bands].to_numpy(), band.to_numpy()) # make sure the compositor doesn't modify the input data np.testing.assert_allclose(lum.values, lum_arr.compute()) From fe08bec093cdabcfbbaeb320e4ec0938ddcdbfa4 Mon Sep 17 00:00:00 2001 From: mherbertson <57386258+mherbertson@users.noreply.github.com> Date: Tue, 5 Apr 2022 05:03:20 +0000 Subject: [PATCH 10/17] Updated readability --- satpy/tests/test_composites.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/satpy/tests/test_composites.py b/satpy/tests/test_composites.py index d95b37b449..a84282e53b 100644 --- a/satpy/tests/test_composites.py +++ b/satpy/tests/test_composites.py @@ -459,7 +459,8 @@ def test_compositor(self, e2d): # Test RGBA bands = ['R', 'G', 'B', 'A'] rgba_arr = da.from_array(np.random.random((4, 2, 2)), chunks=2) - rgba = xr.DataArray(rgba_arr, dims=['bands', 'y', 'x'], coords={'bands': bands}) + rgba = xr.DataArray(rgba_arr, dims=['bands', 'y', 'x'], + coords={'bands': bands}) lum_arr = da.from_array(100 * np.random.random((2, 2)), chunks=2) lum = xr.DataArray(lum_arr, dims=['y', 'x']) @@ -472,10 +473,12 @@ def test_compositor(self, e2d): for band in rgba: if band.bands != 'A': # Check compositor has modified this band - np.testing.assert_allclose(res.loc[band.bands].to_numpy(), band.to_numpy() * lum_arr / 100.) + np.testing.assert_allclose(res.loc[band.bands].to_numpy(), + band.to_numpy() * lum_arr / 100.) else: # Check Alpha band remains intact - np.testing.assert_allclose(res.loc[band.bands].to_numpy(), band.to_numpy()) + np.testing.assert_allclose(res.loc[band.bands].to_numpy(), + band.to_numpy()) # make sure the compositor doesn't modify the input data np.testing.assert_allclose(lum.values, lum_arr.compute()) From 2f410170148bf277818ae2c1bcc5fe529a8deb9c Mon Sep 17 00:00:00 2001 From: mherbertson <57386258+mherbertson@users.noreply.github.com> Date: Tue, 5 Apr 2022 05:07:40 +0000 Subject: [PATCH 11/17] Remove trailing whitespace --- satpy/tests/test_composites.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/satpy/tests/test_composites.py b/satpy/tests/test_composites.py index a84282e53b..095b5db0a4 100644 --- a/satpy/tests/test_composites.py +++ b/satpy/tests/test_composites.py @@ -459,7 +459,7 @@ def test_compositor(self, e2d): # Test RGBA bands = ['R', 'G', 'B', 'A'] rgba_arr = da.from_array(np.random.random((4, 2, 2)), chunks=2) - rgba = xr.DataArray(rgba_arr, dims=['bands', 'y', 'x'], + rgba = xr.DataArray(rgba_arr, dims=['bands', 'y', 'x'], coords={'bands': bands}) lum_arr = da.from_array(100 * np.random.random((2, 2)), chunks=2) lum = xr.DataArray(lum_arr, dims=['y', 'x']) @@ -473,11 +473,11 @@ def test_compositor(self, e2d): for band in rgba: if band.bands != 'A': # Check compositor has modified this band - np.testing.assert_allclose(res.loc[band.bands].to_numpy(), + np.testing.assert_allclose(res.loc[band.bands].to_numpy(), band.to_numpy() * lum_arr / 100.) else: # Check Alpha band remains intact - np.testing.assert_allclose(res.loc[band.bands].to_numpy(), + np.testing.assert_allclose(res.loc[band.bands].to_numpy(), band.to_numpy()) # make sure the compositor doesn't modify the input data np.testing.assert_allclose(lum.values, lum_arr.compute()) From d88ff92a19bdbeca7d00043569e9205da1d7b226 Mon Sep 17 00:00:00 2001 From: mherbertson <57386258+mherbertson@users.noreply.github.com> Date: Tue, 5 Apr 2022 05:14:53 +0000 Subject: [PATCH 12/17] Remove over indentation --- satpy/tests/test_composites.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/satpy/tests/test_composites.py b/satpy/tests/test_composites.py index 095b5db0a4..eb1690bb46 100644 --- a/satpy/tests/test_composites.py +++ b/satpy/tests/test_composites.py @@ -474,11 +474,11 @@ def test_compositor(self, e2d): if band.bands != 'A': # Check compositor has modified this band np.testing.assert_allclose(res.loc[band.bands].to_numpy(), - band.to_numpy() * lum_arr / 100.) + band.to_numpy() * lum_arr / 100.) else: # Check Alpha band remains intact np.testing.assert_allclose(res.loc[band.bands].to_numpy(), - band.to_numpy()) + band.to_numpy()) # make sure the compositor doesn't modify the input data np.testing.assert_allclose(lum.values, lum_arr.compute()) From eaeb19cd1b3e53d30465e45540c50f146bbf8f40 Mon Sep 17 00:00:00 2001 From: David Hoese Date: Tue, 5 Apr 2022 06:51:01 -0500 Subject: [PATCH 13/17] Fix typo in satpy/etc/composites/ahi.yaml Co-authored-by: Simon Proud --- satpy/etc/composites/ahi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/satpy/etc/composites/ahi.yaml b/satpy/etc/composites/ahi.yaml index 7ab2e2820c..f29a36357f 100644 --- a/satpy/etc/composites/ahi.yaml +++ b/satpy/etc/composites/ahi.yaml @@ -6,7 +6,7 @@ modifiers: atmosphere: us-standard aerosol_type: rayleigh_only prerequisites: - - wavelength: B03 + - name: B03 modifiers: [sunz_corrected] optional_prerequisites: - satellite_azimuth_angle From 66b960fd61f8660dd1af8b115dcd5443ad1562a2 Mon Sep 17 00:00:00 2001 From: David Hoese Date: Tue, 5 Apr 2022 14:42:37 -0500 Subject: [PATCH 14/17] Force panel version in CI --- continuous_integration/environment.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/continuous_integration/environment.yaml b/continuous_integration/environment.yaml index 905cfa2f37..d131bad1e0 100644 --- a/continuous_integration/environment.yaml +++ b/continuous_integration/environment.yaml @@ -11,6 +11,7 @@ dependencies: - Cython - sphinx - cartopy + - panel>=0.12.7 - pillow - matplotlib - scipy From 452b2c5a352e37c6a2a3830e9a2504db8055decb Mon Sep 17 00:00:00 2001 From: mherbertson <57386258+mherbertson@users.noreply.github.com> Date: Wed, 6 Apr 2022 00:59:15 +0000 Subject: [PATCH 15/17] Refactor test to include both RGB and RGBA --- satpy/tests/test_composites.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/satpy/tests/test_composites.py b/satpy/tests/test_composites.py index eb1690bb46..01697114f1 100644 --- a/satpy/tests/test_composites.py +++ b/satpy/tests/test_composites.py @@ -448,29 +448,31 @@ def test_compositor(self): np.testing.assert_allclose(res.data, 0.0, atol=1e-9) -class TestSandwichCompositor(unittest.TestCase): +class TestSandwichCompositor: """Test sandwich compositor.""" + # Test RGB and RGBA + @pytest.mark.parametrize("input_shape,bands", + [((3, 2, 2), ['R', 'G', 'B']), + ((4, 2, 2), ['R', 'G', 'B', 'A'])]) @mock.patch('satpy.composites.enhance2dataset') - def test_compositor(self, e2d): + def test_compositor(self, e2d, input_shape, bands): """Test luminance sharpening compositor.""" from satpy.composites import SandwichCompositor - # Test RGBA - bands = ['R', 'G', 'B', 'A'] - rgba_arr = da.from_array(np.random.random((4, 2, 2)), chunks=2) - rgba = xr.DataArray(rgba_arr, dims=['bands', 'y', 'x'], + rgb_arr = da.from_array(np.random.random(input_shape), chunks=2) + rgb = xr.DataArray(rgb_arr, dims=['bands', 'y', 'x'], coords={'bands': bands}) lum_arr = da.from_array(100 * np.random.random((2, 2)), chunks=2) lum = xr.DataArray(lum_arr, dims=['y', 'x']) # Make enhance2dataset return unmodified dataset - e2d.return_value = rgba + e2d.return_value = rgb comp = SandwichCompositor(name='test') - res = comp([lum, rgba]) + res = comp([lum, rgb]) - for band in rgba: + for band in rgb: if band.bands != 'A': # Check compositor has modified this band np.testing.assert_allclose(res.loc[band.bands].to_numpy(), From 8d554e313407ddf921b1db60bc9c4535523c4ceb Mon Sep 17 00:00:00 2001 From: mherbertson <57386258+mherbertson@users.noreply.github.com> Date: Wed, 6 Apr 2022 01:27:46 +0000 Subject: [PATCH 16/17] Remove whitespace and indents --- satpy/tests/test_composites.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/satpy/tests/test_composites.py b/satpy/tests/test_composites.py index 01697114f1..70f13a44b7 100644 --- a/satpy/tests/test_composites.py +++ b/satpy/tests/test_composites.py @@ -452,9 +452,9 @@ class TestSandwichCompositor: """Test sandwich compositor.""" # Test RGB and RGBA - @pytest.mark.parametrize("input_shape,bands", - [((3, 2, 2), ['R', 'G', 'B']), - ((4, 2, 2), ['R', 'G', 'B', 'A'])]) + @pytest.mark.parametrize("input_shape,bands", + [((3, 2, 2), ['R', 'G', 'B']), + ((4, 2, 2), ['R', 'G', 'B', 'A'])]) @mock.patch('satpy.composites.enhance2dataset') def test_compositor(self, e2d, input_shape, bands): """Test luminance sharpening compositor.""" @@ -462,7 +462,7 @@ def test_compositor(self, e2d, input_shape, bands): rgb_arr = da.from_array(np.random.random(input_shape), chunks=2) rgb = xr.DataArray(rgb_arr, dims=['bands', 'y', 'x'], - coords={'bands': bands}) + coords={'bands': bands}) lum_arr = da.from_array(100 * np.random.random((2, 2)), chunks=2) lum = xr.DataArray(lum_arr, dims=['y', 'x']) From b77c4ad87f203863339003abcb3c1cf6aa945e01 Mon Sep 17 00:00:00 2001 From: mherbertson <57386258+mherbertson@users.noreply.github.com> Date: Wed, 6 Apr 2022 02:13:35 +0000 Subject: [PATCH 17/17] Re-indent pytest.mark.parametrize --- satpy/tests/test_composites.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/satpy/tests/test_composites.py b/satpy/tests/test_composites.py index 70f13a44b7..20fbbfdd51 100644 --- a/satpy/tests/test_composites.py +++ b/satpy/tests/test_composites.py @@ -452,9 +452,13 @@ class TestSandwichCompositor: """Test sandwich compositor.""" # Test RGB and RGBA - @pytest.mark.parametrize("input_shape,bands", - [((3, 2, 2), ['R', 'G', 'B']), - ((4, 2, 2), ['R', 'G', 'B', 'A'])]) + @pytest.mark.parametrize( + "input_shape,bands", + [ + ((3, 2, 2), ['R', 'G', 'B']), + ((4, 2, 2), ['R', 'G', 'B', 'A']) + ] + ) @mock.patch('satpy.composites.enhance2dataset') def test_compositor(self, e2d, input_shape, bands): """Test luminance sharpening compositor."""