Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 1, 2024
1 parent b350ce7 commit ab774da
Show file tree
Hide file tree
Showing 39 changed files with 49 additions and 8 deletions.
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

0 comments on commit ab774da

Please sign in to comment.