Skip to content

Commit 52297c5

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 728e1f8 commit 52297c5

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

racs_tools/convolve_uv.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
__author__ = "Wasim Raja"
55

66
import gc
7-
from typing import Literal, NamedTuple, Optional
7+
from typing import Literal, NamedTuple
88

99
import numpy as np
1010
import scipy.signal
@@ -134,7 +134,7 @@ def convolve(
134134
new_beam: Beam,
135135
dx: u.Quantity,
136136
dy: u.Quantity,
137-
cutoff: Optional[float] = None,
137+
cutoff: float | None = None,
138138
) -> ConvolutionResult:
139139
"""Convolve by X-ing in the Fourier domain.
140140
- convolution with Gaussian kernels only
@@ -248,7 +248,7 @@ def convolve_scipy(
248248
new_beam: Beam,
249249
dx: u.Quantity,
250250
dy: u.Quantity,
251-
cutoff: Optional[float] = None,
251+
cutoff: float | None = None,
252252
) -> ConvolutionResult:
253253
"""Convolve using scipy's convolution
254254
@@ -296,7 +296,7 @@ def convolve_astropy(
296296
new_beam: Beam,
297297
dx: u.Quantity,
298298
dy: u.Quantity,
299-
cutoff: Optional[float] = None,
299+
cutoff: float | None = None,
300300
) -> ConvolutionResult:
301301
"""Convolve using astropy's convolution
302302
@@ -347,7 +347,7 @@ def convolve_astropy_fft(
347347
new_beam: Beam,
348348
dx: u.Quantity,
349349
dy: u.Quantity,
350-
cutoff: Optional[float] = None,
350+
cutoff: float | None = None,
351351
) -> ConvolutionResult:
352352
"""Convolve using astropy's FFT convolution
353353
@@ -434,7 +434,7 @@ def get_convolving_beam(
434434
new_beam: Beam,
435435
dx: u.Quantity,
436436
dy: u.Quantity,
437-
cutoff: Optional[float] = None,
437+
cutoff: float | None = None,
438438
) -> tuple[Beam, float]:
439439
"""Get the beam to use for smoothing
440440
@@ -502,7 +502,7 @@ def smooth(
502502
dx: u.Quantity,
503503
dy: u.Quantity,
504504
conv_mode: Literal["robust", "scipy", "astropy", "astropy_fft"] = "robust",
505-
cutoff: Optional[float] = None,
505+
cutoff: float | None = None,
506506
) -> np.ndarray:
507507
"""Apply smoothing to image in Jy/beam
508508

racs_tools/getnoise_list.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import argparse
55
import warnings
6-
from typing import Union
76

87
import astropy.units as u
98
import numpy as np
@@ -146,7 +145,7 @@ def main(
146145
blank: bool = False,
147146
cliplev: float = 5,
148147
iterate: int = 1,
149-
outfile: Union[str, None] = None,
148+
outfile: str | None = None,
150149
save_noise: bool = False,
151150
) -> None:
152151
"""Flag bad channels in Stokes Q and U cubes

racs_tools/logging.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import logging
44
import multiprocessing as mp
55
from logging.handlers import QueueHandler, QueueListener
6-
from typing import Optional
76

87
logging.captureWarnings(True)
98

@@ -12,7 +11,7 @@
1211

1312

1413
def setup_logger(
15-
filename: Optional[str] = None,
14+
filename: str | None = None,
1615
) -> tuple[logging.Logger, QueueListener, mp.Queue]:
1716
"""Setup a logger
1817

0 commit comments

Comments
 (0)