Skip to content
Open
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
@@ -1,14 +1,14 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.12.7"
rev: "v0.14.2"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand Down
14 changes: 7 additions & 7 deletions racs_tools/convolve_uv.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
__author__ = "Wasim Raja"

import gc
from typing import Literal, NamedTuple, Optional
from typing import Literal, NamedTuple

import numpy as np
import scipy.signal
Expand Down Expand Up @@ -134,7 +134,7 @@ def convolve(
new_beam: Beam,
dx: u.Quantity,
dy: u.Quantity,
cutoff: Optional[float] = None,
cutoff: float | None = None,
) -> ConvolutionResult:
"""Convolve by X-ing in the Fourier domain.
- convolution with Gaussian kernels only
Expand Down Expand Up @@ -248,7 +248,7 @@ def convolve_scipy(
new_beam: Beam,
dx: u.Quantity,
dy: u.Quantity,
cutoff: Optional[float] = None,
cutoff: float | None = None,
) -> ConvolutionResult:
"""Convolve using scipy's convolution
Expand Down Expand Up @@ -296,7 +296,7 @@ def convolve_astropy(
new_beam: Beam,
dx: u.Quantity,
dy: u.Quantity,
cutoff: Optional[float] = None,
cutoff: float | None = None,
) -> ConvolutionResult:
"""Convolve using astropy's convolution
Expand Down Expand Up @@ -347,7 +347,7 @@ def convolve_astropy_fft(
new_beam: Beam,
dx: u.Quantity,
dy: u.Quantity,
cutoff: Optional[float] = None,
cutoff: float | None = None,
) -> ConvolutionResult:
"""Convolve using astropy's FFT convolution
Expand Down Expand Up @@ -434,7 +434,7 @@ def get_convolving_beam(
new_beam: Beam,
dx: u.Quantity,
dy: u.Quantity,
cutoff: Optional[float] = None,
cutoff: float | None = None,
) -> tuple[Beam, float]:
"""Get the beam to use for smoothing
Expand Down Expand Up @@ -502,7 +502,7 @@ def smooth(
dx: u.Quantity,
dy: u.Quantity,
conv_mode: Literal["robust", "scipy", "astropy", "astropy_fft"] = "robust",
cutoff: Optional[float] = None,
cutoff: float | None = None,
) -> np.ndarray:
"""Apply smoothing to image in Jy/beam
Expand Down
3 changes: 1 addition & 2 deletions racs_tools/getnoise_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import argparse
import warnings
from typing import Union

import astropy.units as u
import numpy as np
Expand Down Expand Up @@ -146,7 +145,7 @@ def main(
blank: bool = False,
cliplev: float = 5,
iterate: int = 1,
outfile: Union[str, None] = None,
outfile: str | None = None,
save_noise: bool = False,
) -> None:
"""Flag bad channels in Stokes Q and U cubes
Expand Down
3 changes: 1 addition & 2 deletions racs_tools/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import logging
import multiprocessing as mp
from logging.handlers import QueueHandler, QueueListener
from typing import Optional

logging.captureWarnings(True)

Expand All @@ -12,7 +11,7 @@


def setup_logger(
filename: Optional[str] = None,
filename: str | None = None,
) -> tuple[logging.Logger, QueueListener, mp.Queue]:
"""Setup a logger
Expand Down