Skip to content

Commit

Permalink
Merge pull request #2894 from pytroll/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
djhoese authored Sep 4, 2024
2 parents b4002a2 + eb5cb99 commit 3127f4a
Show file tree
Hide file tree
Showing 42 changed files with 179 additions and 179 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fail_fast: false
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: 'v0.5.6'
rev: 'v0.6.3'
hooks:
- id: ruff
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand All @@ -19,7 +19,7 @@ repos:
- id: bandit
args: [--ini, .bandit]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.11.1' # Use the sha / tag you want to point at
rev: 'v1.11.2' # Use the sha / tag you want to point at
hooks:
- id: mypy
additional_dependencies:
Expand Down
2 changes: 1 addition & 1 deletion satpy/tests/cf_tests/test_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from satpy.cf.area import _add_grid_mapping, area2cf


@pytest.fixture()
@pytest.fixture
def input_data_arr() -> xr.DataArray:
"""Create a data array."""
return xr.DataArray(
Expand Down
2 changes: 1 addition & 1 deletion satpy/tests/cf_tests/test_coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def test_is_projected(self, caplog):
assert _is_projected(da)
assert "Failed to tell if data are projected." in caplog.text

@pytest.fixture()
@pytest.fixture
def datasets(self):
"""Create test dataset."""
data = [[75, 2], [3, 4]]
Expand Down
4 changes: 2 additions & 2 deletions satpy/tests/cf_tests/test_decoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
class TestDecodeAttrs:
"""Test decoding of CF-encoded attributes."""

@pytest.fixture()
@pytest.fixture
def attrs(self):
"""Get CF-encoded attributes."""
return {
Expand All @@ -41,7 +41,7 @@ def attrs(self):
"my_dict": '{"a": {"b": [1, 2, 3]}, "c": {"d": "2000-01-01 12:15:33.123456"}}'
}

@pytest.fixture()
@pytest.fixture
def expected(self):
"""Get expected decoded results."""
return {
Expand Down
4 changes: 2 additions & 2 deletions satpy/tests/cf_tests/test_encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
class TestUpdateEncoding:
"""Test update of dataset encodings."""

@pytest.fixture()
@pytest.fixture
def fake_ds(self):
"""Create fake data for testing."""
ds = xr.Dataset({"foo": (("y", "x"), [[1, 2], [3, 4]]),
Expand All @@ -35,7 +35,7 @@ def fake_ds(self):
"lon": (("y", "x"), [[7, 8], [9, 10]])})
return ds

@pytest.fixture()
@pytest.fixture
def fake_ds_digit(self):
"""Create fake data for testing."""
ds_digit = xr.Dataset({"CHANNEL_1": (("y", "x"), [[1, 2], [3, 4]]),
Expand Down
8 changes: 4 additions & 4 deletions satpy/tests/compositor_tests/test_viirs.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
class TestVIIRSComposites:
"""Test various VIIRS-specific composites."""

@pytest.fixture()
@pytest.fixture
def area(self):
"""Return fake area for use with DNB tests."""
rows = 5
Expand All @@ -43,7 +43,7 @@ def area(self):
(-20037508.34, -10018754.17, 20037508.34, 10018754.17))
return area

@pytest.fixture()
@pytest.fixture
def dnb(self, area):
"""Return fake channel 1 data for DNB tests."""
dnb = np.zeros(area.shape) + 0.25
Expand All @@ -56,7 +56,7 @@ def dnb(self, area):
"start_time": dt.datetime(2020, 1, 1, 12, 0, 0)})
return c01

@pytest.fixture()
@pytest.fixture
def sza(self, area):
"""Return fake sza dataset for DNB tests."""
# data changes by row, sza changes by col for testing
Expand All @@ -70,7 +70,7 @@ def sza(self, area):
"start_time": dt.datetime(2020, 1, 1, 12, 0, 0)})
return c02

@pytest.fixture()
@pytest.fixture
def lza(self, area):
"""Return fake lunal zenith angle dataset for DNB tests."""
lza = np.zeros(area.shape) + 70.0
Expand Down
2 changes: 1 addition & 1 deletion satpy/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def _clear_function_caches():
load_compositor_configs_for_sensor.cache_clear()


@pytest.fixture()
@pytest.fixture
def include_test_etc():
"""Tell Satpy to use the config 'etc' directory from the tests directory."""
with satpy.config.set(config_path=[TEST_ETC_DIR]):
Expand Down
2 changes: 1 addition & 1 deletion satpy/tests/enhancement_tests/test_enhancements.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ def func(dask_array):
assert res.shape == arr.shape


@pytest.fixture()
@pytest.fixture
def fake_area():
"""Return a fake 2×2 area."""
from pyresample.geometry import create_area_def
Expand Down
10 changes: 5 additions & 5 deletions satpy/tests/modifier_tests/test_parallax.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
# - request


@pytest.fixture()
@pytest.fixture
def fake_tle():
"""Produce fake Two Line Element (TLE) object from pyorbital."""
return pyorbital.tlefile.Tle(
Expand Down Expand Up @@ -566,7 +566,7 @@ def test_parallax_modifier_interface_with_cloud(self):
# do so after parallax correction
assert not (res.diff("x") < 0).any()

@pytest.fixture()
@pytest.fixture
def test_area(self, request):
"""Produce test area for parallax correction unit tests.
Expand Down Expand Up @@ -713,20 +713,20 @@ def test_modifier_interface_cloud_moves_to_observer(self, cth, use_dask, test_ar
class TestParallaxCorrectionSceneLoad:
"""Test that scene load interface works as expected."""

@pytest.fixture()
@pytest.fixture
def yaml_code(self):
"""Return YAML code for parallax_corrected_VIS006."""
return _test_yaml_code

@pytest.fixture()
@pytest.fixture
def conf_file(self, yaml_code, tmp_path):
"""Produce a fake configuration file."""
conf_file = tmp_path / "test.yaml"
with conf_file.open(mode="wt", encoding="ascii") as fp:
fp.write(yaml_code)
return conf_file

@pytest.fixture()
@pytest.fixture
def fake_scene(self, yaml_code):
"""Produce fake scene and prepare fake composite config."""
from satpy import Scene
Expand Down
20 changes: 10 additions & 10 deletions satpy/tests/multiscene_tests/test_blend.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def _get_expected_stack_blend(scene1: Scene, scene2: Scene) -> xr.DataArray:
return expected


@pytest.fixture()
@pytest.fixture
def test_area():
"""Get area definition used by test DataArrays."""
return _create_test_area()
Expand All @@ -77,7 +77,7 @@ def image_mode(request):
return request.param


@pytest.fixture()
@pytest.fixture
def cloud_type_data_array1(test_area, data_type, image_mode):
"""Get DataArray for cloud type in the first test Scene."""
dsid1 = make_dataid(
Expand Down Expand Up @@ -107,7 +107,7 @@ def cloud_type_data_array1(test_area, data_type, image_mode):
return data_arr


@pytest.fixture()
@pytest.fixture
def cloud_type_data_array2(test_area, data_type, image_mode):
"""Get DataArray for cloud type in the second test Scene."""
dsid1 = make_dataid(
Expand All @@ -133,7 +133,7 @@ def cloud_type_data_array2(test_area, data_type, image_mode):
return data_arr


@pytest.fixture()
@pytest.fixture
def scene1_with_weights(cloud_type_data_array1, test_area):
"""Create first test scene with a dataset of weights."""
from satpy import Scene
Expand All @@ -160,7 +160,7 @@ def scene1_with_weights(cloud_type_data_array1, test_area):
return scene, [wgt1, wgt2]


@pytest.fixture()
@pytest.fixture
def scene2_with_weights(cloud_type_data_array2, test_area):
"""Create second test scene."""
from satpy import Scene
Expand All @@ -183,7 +183,7 @@ def scene2_with_weights(cloud_type_data_array2, test_area):
return scene, [wgt1, wgt2]


@pytest.fixture()
@pytest.fixture
def multi_scene_and_weights(scene1_with_weights, scene2_with_weights):
"""Create small multi-scene for testing."""
from satpy import MultiScene
Expand All @@ -193,7 +193,7 @@ def multi_scene_and_weights(scene1_with_weights, scene2_with_weights):
return MultiScene([scene1, scene2]), [weights1, weights2]


@pytest.fixture()
@pytest.fixture
def groups():
"""Get group definitions for the MultiScene."""
return {
Expand Down Expand Up @@ -277,7 +277,7 @@ def test_blend_two_scenes_using_stack_weighted(self, multi_scene_and_weights, gr
assert result.attrs["start_time"] == dt.datetime(2023, 1, 16, 11, 9, 17)
assert result.attrs["end_time"] == dt.datetime(2023, 1, 16, 11, 28, 1, 900000)

@pytest.fixture()
@pytest.fixture
def datasets_and_weights(self):
"""X-Array datasets with area definition plus weights for input to tests."""
shape = (8, 12)
Expand Down Expand Up @@ -389,7 +389,7 @@ def _check_stacked_metadata(data_arr: xr.DataArray, exp_name: str) -> None:
class TestTemporalRGB:
"""Test the temporal RGB blending method."""

@pytest.fixture()
@pytest.fixture
def nominal_data(self):
"""Return the input arrays for the nominal use case."""
da1 = xr.DataArray([1, 0, 0], attrs={"start_time": dt.datetime(2023, 5, 22, 9, 0, 0)})
Expand All @@ -398,7 +398,7 @@ def nominal_data(self):

return [da1, da2, da3]

@pytest.fixture()
@pytest.fixture
def expected_result(self):
"""Return the expected result arrays."""
return [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
Expand Down
8 changes: 4 additions & 4 deletions satpy/tests/multiscene_tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def test_from_files(self):
class TestMultiSceneGrouping:
"""Test dataset grouping in MultiScene."""

@pytest.fixture()
@pytest.fixture
def scene1(self):
"""Create first test scene."""
from satpy import Scene
Expand All @@ -152,7 +152,7 @@ def scene1(self):
scene[dsid2] = _create_test_dataset(name="ds2")
return scene

@pytest.fixture()
@pytest.fixture
def scene2(self):
"""Create second test scene."""
from satpy import Scene
Expand All @@ -173,13 +173,13 @@ def scene2(self):
scene[dsid2] = _create_test_dataset(name="ds4")
return scene

@pytest.fixture()
@pytest.fixture
def multi_scene(self, scene1, scene2):
"""Create small multi scene for testing."""
from satpy import MultiScene
return MultiScene([scene1, scene2])

@pytest.fixture()
@pytest.fixture
def groups(self):
"""Get group definitions for the MultiScene."""
return {
Expand Down
Loading

0 comments on commit 3127f4a

Please sign in to comment.