Skip to content

Commit 8ab1554

Browse files
committed
Fixed pyflakes issues
1 parent cc2661e commit 8ab1554

File tree

10 files changed

+18
-20
lines changed

10 files changed

+18
-20
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ lint.select = [
187187
"B", # flake8-bugbear
188188
"I", # isort
189189
"UP", # pyupgrade
190+
"F", # pyflakes
190191
]
191192

192193
[tool.ruff.lint.extend-per-file-ignores]

reproject/adaptive/tests/test_core.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
# Licensed under a 3-clause BSD style license - see LICENSE.rst
22

3-
import os
43
from itertools import product
54

65
import numpy as np
76
import pytest
8-
from astropy import units as u
97
from astropy.io import fits
108
from astropy.utils.data import get_pkg_data_filename
119
from astropy.wcs import WCS

reproject/array_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ def map_coordinates(
176176

177177
# Adjust chunks to add padding
178178
for idim, slc in enumerate(chunk):
179-
start = max(0, slc.start - 10)
180-
stop = min(original_shape[idim], slc.stop + 10)
179+
start = max(0, slc.start - padding)
180+
stop = min(original_shape[idim], slc.stop + padding)
181181
chunk[idim] = slice(start, stop)
182182

183183
chunk = tuple(chunk)

reproject/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ def reproject_single_block(a, array_or_path, block_info=None):
305305
array_out_dask = da.empty(shape_out)
306306
array_out_dask = array_out_dask.rechunk(block_size_limit=64 * 1024**2, **rechunk_kwargs)
307307

308-
logger.info(f"Setting up output dask array with map_blocks")
308+
logger.info("Setting up output dask array with map_blocks")
309309

310310
result = da.map_blocks(
311311
reproject_single_block,
@@ -364,7 +364,7 @@ def reproject_single_block(a, array_or_path, block_info=None):
364364

365365
result = da.from_zarr(zarr_path)
366366

367-
logger.info(f"Copying output zarr array into output Numpy arrays")
367+
logger.info("Copying output zarr array into output Numpy arrays")
368368

369369
if return_footprint:
370370
da.store(

reproject/hips/high_level.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,12 @@
88
from pathlib import Path
99

1010
import numpy as np
11-
from astropy import units as u
1211
from astropy.coordinates import ICRS, BarycentricTrueEcliptic, Galactic
1312
from astropy.io import fits
1413
from astropy.nddata import block_reduce
15-
from astropy.wcs import WCS
1614
from astropy_healpix import (
1715
HEALPix,
1816
level_to_nside,
19-
nside_to_level,
20-
pixel_resolution_to_nside,
2117
)
2218
from PIL import Image
2319

reproject/hips/tests/test_high_level.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import os
21
import re
32

43
import numpy as np

reproject/hips/utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import os
22

33
import numpy as np
4+
from astropy.wcs import WCS
45
from astropy.wcs.utils import celestial_frame_to_wcs
5-
from astropy_healpix import HEALPix, level_to_nside
6+
from astropy_healpix import (
7+
HEALPix,
8+
level_to_nside,
9+
nside_to_level,
10+
pixel_resolution_to_nside,
11+
)
612

713
__all__ = ["tile_header", "tile_filename", "make_tile_folders", "determine_healpix_level"]
814

reproject/interpolation/tests/test_core.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import dask.array as da
66
import numpy as np
77
import pytest
8-
from astropy import units as u
98
from astropy.io import fits
109
from astropy.utils.data import get_pkg_data_filename
1110
from astropy.wcs import WCS

reproject/mosaicking/coadd.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ def reproject_and_coadd(
383383

384384
if intermediate_memmap:
385385
# Remove the reference to the memmap before trying to remove the file itself
386-
logger.info(f"Removing memory-mapped weight array")
386+
logger.info("Removing memory-mapped weight array")
387387
weights = None
388388
try:
389389
os.remove(weights_path)
@@ -396,7 +396,7 @@ def reproject_and_coadd(
396396
# output image is empty (due e.g. to no overlap).
397397

398398
if on_the_fly:
399-
logger.info(f"Adding reprojected array to final array")
399+
logger.info("Adding reprojected array to final array")
400400
# By default, values outside of the footprint are set to NaN
401401
# but we set these to 0 here to avoid getting NaNs in the
402402
# means/sums.
@@ -412,7 +412,7 @@ def reproject_and_coadd(
412412
if intermediate_memmap:
413413
# Remove the references to the memmaps themesleves before
414414
# trying to remove the files thermselves.
415-
logger.info(f"Removing memory-mapped array and footprint arrays")
415+
logger.info("Removing memory-mapped array and footprint arrays")
416416
array = None
417417
footprint = None
418418
try:
@@ -422,12 +422,12 @@ def reproject_and_coadd(
422422
pass
423423

424424
else:
425-
logger.info(f"Adding reprojected array to list to combine later")
425+
logger.info("Adding reprojected array to list to combine later")
426426
arrays.append(array)
427427

428428
# If requested, try and match the backgrounds.
429429
if match_background and len(arrays) > 1:
430-
logger.info(f"Match backgrounds")
430+
logger.info("Match backgrounds")
431431
offset_matrix = determine_offset_matrix(arrays)
432432
corrections = solve_corrections_sgd(offset_matrix)
433433
if background_reference:
@@ -448,7 +448,7 @@ def reproject_and_coadd(
448448
output_footprint[array.view_in_original_array] += array.footprint
449449

450450
if combine_function == "mean":
451-
logger.info(f"Handle normalization of output array")
451+
logger.info("Handle normalization of output array")
452452
with np.errstate(invalid="ignore"):
453453
output_array /= output_footprint
454454

reproject/tests/data/generate_asdf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ def generate_asdf(input_file="aia_171_level1.fits", output_file="aia_171_level1.
8282

8383
aia_map = sunpy.map.Map(input_file)
8484

85-
spatial_unit = aia_map.spatial_units[0]
8685
transform = generate_celestial_transform(
8786
crpix=aia_map.reference_pixel,
8887
cdelt=aia_map.scale,

0 commit comments

Comments
 (0)