Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #688

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ exclude: '^$'
fail_fast: false
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.2.0'
rev: 'v0.3.5'
hooks:
- id: ruff
args: ["--fix"]
Expand All @@ -15,7 +15,7 @@ repos:
- id: check-yaml
args: [--unsafe]
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.7.0-4
rev: v3.8.0-1
hooks:
- id: shfmt-src # native (requires Go to build)
args: ["-i", "4"]
Expand Down
1 change: 1 addition & 0 deletions doc/source/toctree_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
for more information.
"""

import re

from docutils.parsers.rst import directives
Expand Down
1 change: 1 addition & 0 deletions integration_tests/features/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# input into another program.
# Documentation: http://www.ssec.wisc.edu/software/polar2grid/
"""Configure behave tests."""

import os
import shutil
import sys
Expand Down
1 change: 1 addition & 0 deletions integration_tests/features/steps/compare_images.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Various behavior test steps."""

import glob
import os
import re
Expand Down
1 change: 1 addition & 0 deletions polar2grid/_glue_argparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# input into another program.
# Documentation: http://www.ssec.wisc.edu/software/polar2grid/
"""Argument parsing and script setup for the main glue.py script."""

from __future__ import annotations

import argparse
Expand Down
1 change: 1 addition & 0 deletions polar2grid/add_coastlines.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
# Madison, WI 53706
# [email protected]
"""Script to add coastlines and borders to a geotiff while also creating a PNG."""

from __future__ import annotations

import argparse
Expand Down
1 change: 1 addition & 0 deletions polar2grid/add_colormap.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# input into another program.
# Documentation: http://www.ssec.wisc.edu/software/polar2grid/
"""Add a colortable to an existing GeoTIFF."""

import os
import sys

Expand Down
1 change: 1 addition & 0 deletions polar2grid/core/script_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"""

__docformat__ = "restructuredtext en"

import argparse
Expand Down
1 change: 1 addition & 0 deletions polar2grid/grids/config_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
to a user's own grid configuration file.
"""

from __future__ import annotations

import os
Expand Down
1 change: 1 addition & 0 deletions polar2grid/grids/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
# Madison, WI 53706
# [email protected]
"""Utilities and accessor functions to grids and projections used in polar2grid."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions polar2grid/readers/amsr2_l1b.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
for more information on generating these NRL-like PNGs.
"""

from __future__ import annotations

from argparse import ArgumentParser, _ArgumentGroup
Expand Down
1 change: 1 addition & 0 deletions polar2grid/readers/amsr2_l2_gaasp.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
+-----------------------------------+--------------------------------------------+
"""

from __future__ import annotations

from argparse import ArgumentParser, _ArgumentGroup
Expand Down
1 change: 1 addition & 0 deletions polar2grid/readers/avhrr_l1b_aapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
+--------------------+--------------------------------------------+
"""

from __future__ import annotations

from argparse import ArgumentParser, _ArgumentGroup
Expand Down
1 change: 1 addition & 0 deletions polar2grid/readers/clavrx.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
+------------------------+---------------------------------------------+
"""

from __future__ import annotations

import os
Expand Down
1 change: 1 addition & 0 deletions polar2grid/readers/modis_l1b.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
angle is less than 90 degrees.
"""

from __future__ import annotations

import argparse
Expand Down
1 change: 1 addition & 0 deletions polar2grid/readers/modis_l2.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
+--------------------+--------------------------------------------+
"""

from __future__ import annotations

from argparse import ArgumentParser, _ArgumentGroup
Expand Down
1 change: 1 addition & 0 deletions polar2grid/readers/viirs_edr.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
+---------------------------+-----------------------------------------------------+
"""

from __future__ import annotations

from argparse import ArgumentParser, _ArgumentGroup, BooleanOptionalAction
Expand Down
1 change: 1 addition & 0 deletions polar2grid/readers/viirs_edr_active_fires.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
| T13 | M-Band 13 Temperature (AFMOD Resolution Only) |
+---------------------------+-----------------------------------------------------+
"""

from __future__ import annotations

from argparse import ArgumentParser, _ArgumentGroup
Expand Down
1 change: 1 addition & 0 deletions polar2grid/readers/viirs_edr_flood.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
| WaterDetection | Channel 1 Reflectance Band |
+---------------------------+-----------------------------------------------------+
"""

from __future__ import annotations

from argparse import ArgumentParser, _ArgumentGroup
Expand Down
1 change: 1 addition & 0 deletions polar2grid/readers/viirs_l1b.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
angle is less than 100 degrees.
"""

from __future__ import annotations

__docformat__ = "restructuredtext en"
Expand Down
1 change: 1 addition & 0 deletions polar2grid/readers/virr_l1b.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
| true_color | Ratio sharpened rayleigh corrected true color |N/A |
+---------------------------+-----------------------------------------------------+-------------------------+
"""

from __future__ import annotations

from argparse import ArgumentParser, _ArgumentGroup
Expand Down
1 change: 1 addition & 0 deletions polar2grid/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# input into another program.
# Documentation: http://www.ssec.wisc.edu/software/polar2grid/
"""Tests for polar2grid."""

import os

TEST_ETC_DIR = os.path.realpath(os.path.join(os.path.dirname(__file__), "etc"))
1 change: 1 addition & 0 deletions polar2grid/tests/_abi_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# input into another program.
# Documentation: http://www.ssec.wisc.edu/software/polar2grid/
"""Test fixtures representing ABI gridded data."""

from __future__ import annotations

import pytest
Expand Down
1 change: 1 addition & 0 deletions polar2grid/tests/_avhrr_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# input into another program.
# Documentation: http://www.ssec.wisc.edu/software/polar2grid/
"""Test fixtures representing AVHRR swath data."""

from __future__ import annotations

import dask.array as da
Expand Down
1 change: 1 addition & 0 deletions polar2grid/tests/_fixture_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# input into another program.
# Documentation: http://www.ssec.wisc.edu/software/polar2grid/
"""Shared utilities between fixtures."""

from __future__ import annotations

from datetime import datetime
Expand Down
1 change: 1 addition & 0 deletions polar2grid/tests/_viirs_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# input into another program.
# Documentation: http://www.ssec.wisc.edu/software/polar2grid/
"""Test fixtures representing VIIRS swath data."""

from __future__ import annotations

import dask.array as da
Expand Down
1 change: 1 addition & 0 deletions polar2grid/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# input into another program.
# Documentation: http://www.ssec.wisc.edu/software/polar2grid/
"""Test initialization and fixtures."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions polar2grid/tests/test_add_coastlines.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# input into another program.
# Documentation: http://www.ssec.wisc.edu/software/polar2grid/
"""Basic usability tests for the add_coastlines script."""

from __future__ import annotations

import contextlib
Expand Down
1 change: 1 addition & 0 deletions polar2grid/tests/test_add_colormap.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# input into another program.
# Documentation: http://www.ssec.wisc.edu/software/polar2grid/
"""Basic usability tests for the add_colormap script."""

from __future__ import annotations

import os
Expand Down
1 change: 1 addition & 0 deletions polar2grid/tests/test_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# input into another program.
# Documentation: http://www.ssec.wisc.edu/software/polar2grid/
"""Tests for the compare.py script."""

import os
from glob import glob

Expand Down
1 change: 1 addition & 0 deletions polar2grid/tests/test_filters/test_day_night.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# input into another program.
# Documentation: http://www.ssec.wisc.edu/software/polar2grid/
"""Tests day/night filtering."""

import dask.array as da
import numpy as np
import pytest
Expand Down
8 changes: 5 additions & 3 deletions polar2grid/tests/test_glue.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,11 @@ def extra_viirs_comp_and_enh(extra_viirs_composite_path, extra_viirs_enhancement
@contextlib.contextmanager
def prepare_glue_exec(create_scene_func, max_computes=0, use_polar2grid=True):
use_str = "1" if use_polar2grid else "0"
with set_env(USE_POLAR2GRID_DEFAULTS=use_str), mock.patch(
"polar2grid.glue._create_scene"
) as create_scene, dask.config.set(scheduler=CustomScheduler(max_computes)):
with (
set_env(USE_POLAR2GRID_DEFAULTS=use_str),
mock.patch("polar2grid.glue._create_scene") as create_scene,
dask.config.set(scheduler=CustomScheduler(max_computes)),
):
create_scene.return_value = create_scene_func
yield

Expand Down
12 changes: 7 additions & 5 deletions polar2grid/tests/test_resample/test_resample_scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,13 @@ def test_resample_single_result_per_grid(

from polar2grid.filters.resample_coverage import ResampleCoverageFilter

with dask.config.set(scheduler=CustomScheduler(max_computes)), mock.patch(
"satpy.resample.resample", wraps=resample
) as satpy_resample, mock.patch(
"polar2grid.resample._resample_scene.ResampleCoverageFilter", wraps=ResampleCoverageFilter
) as resamp_cov:
with (
dask.config.set(scheduler=CustomScheduler(max_computes)),
mock.patch("satpy.resample.resample", wraps=resample) as satpy_resample,
mock.patch(
"polar2grid.resample._resample_scene.ResampleCoverageFilter", wraps=ResampleCoverageFilter
) as resamp_cov,
):
input_scene.load(exp_names)
scenes_to_save = resample_scene(
input_scene,
Expand Down
1 change: 1 addition & 0 deletions polar2grid/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# input into another program.
# Documentation: http://www.ssec.wisc.edu/software/polar2grid/
"""Helpers for setting up the Polar2Grid environment and configuration."""

import importlib.metadata as impm
import importlib.resources as impr
import os
Expand Down
1 change: 1 addition & 0 deletions polar2grid/utils/create_awips_debug_tiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# input into another program.
# Documentation: http://www.ssec.wisc.edu/software/polar2grid/
"""Helper script for generating debug AWIPS Tiled files for verifying AWIPS client behavior."""

import contextlib
import os
import sys
Expand Down
1 change: 1 addition & 0 deletions polar2grid/utils/warnings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Warnings or utilities for dealing with warnings."""

from __future__ import annotations

import contextlib
Expand Down
1 change: 1 addition & 0 deletions polar2grid/writers/awips_tiled.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
see the Satpy documentation :mod:`here <satpy.writers.awips_tiled>`.
"""

import logging
from argparse import BooleanOptionalAction

Expand Down
1 change: 1 addition & 0 deletions polar2grid/writers/cf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
different grids, the CF compliant workaround is to save the datasets to separate files.
"""

import json
import logging

Expand Down
1 change: 1 addition & 0 deletions polar2grid/writers/geotiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
as transparent in most image viewers.
"""

import argparse
import logging
import os
Expand Down
1 change: 1 addition & 0 deletions polar2grid/writers/hdf5.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
longitude and latitude data in the file, instructions for output-filename
patterns, and product selection.
"""

from __future__ import annotations

import logging
Expand Down