Skip to content

Commit 3800369

Browse files
committed
appease ruff
1 parent 091e20f commit 3800369

File tree

5 files changed

+17
-15
lines changed

5 files changed

+17
-15
lines changed

photutils/converters/apertures.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ class CircularApertureConverter(Converter):
1414
Base class for aperture converters.
1515
"""
1616

17-
tags = ['tag:astropy.org:photutils/aperture/circular_aperture-*']
18-
types = ['photutils.aperture.circle.CircularAperture']
17+
tags = ['tag:astropy.org:photutils/aperture/circular_aperture-*'] # noqa: RUF012
18+
types = ['photutils.aperture.circle.CircularAperture'] # noqa: RUF012
1919

20-
def to_yaml_tree(self, obj, tag, ctx):
20+
def to_yaml_tree(self, obj, tag, ctx): # noqa: ARG002
2121
if obj.positions.shape == (2,):
2222
pos = obj.positions.tolist()
2323
else:
@@ -28,7 +28,7 @@ def to_yaml_tree(self, obj, tag, ctx):
2828
'r': obj.r,
2929
}
3030

31-
def from_yaml_tree(self, node, tag, ctx):
31+
def from_yaml_tree(self, node, tag, ctx): # noqa: ARG002
3232
from photutils.aperture.circle import CircularAperture
3333

3434
return CircularAperture(

photutils/converters/functional_models.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ class AiryDiskPSFConverter(TransformConverterBase):
1515
Converter for AiryDiskPSF.
1616
"""
1717

18-
tags = ['tag:astropy.org:photutils/psf/airy_disk_psf-*']
19-
types = ['photutils.psf.AiryDiskPSF']
18+
tags = ['tag:astropy.org:photutils/psf/airy_disk_psf-*'] # noqa: RUF012
19+
types = ['photutils.psf.AiryDiskPSF'] # noqa: RUF012
2020

21-
def to_yaml_tree_transform(self, model, tag, ctx):
21+
def to_yaml_tree_transform(self, model, tag, ctx): # noqa: ARG002
2222
return {
2323
'flux': parameter_to_value(model.flux),
2424
'x_0': parameter_to_value(model.x_0),
@@ -27,7 +27,7 @@ def to_yaml_tree_transform(self, model, tag, ctx):
2727
'bbox_factor': model.bbox_factor,
2828
}
2929

30-
def from_yaml_tree_transform(self, node, tag, ctx):
30+
def from_yaml_tree_transform(self, node, tag, ctx): # noqa: ARG002
3131
from photutils.psf import AiryDiskPSF
3232

3333
return AiryDiskPSF(

photutils/converters/tests/test_apertures.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ def test_aperture_converters(tmp_path):
2222
for aperture in apertures:
2323
with asdf.AsdfFile() as af:
2424
af["aperture"] = aperture
25-
af.write_to(tmp_path / "aperture.asdf")
25+
af.write_to(tmp_path / 'aperture.asdf')
2626

27-
with asdf.open(tmp_path / "aperture.asdf") as af:
28-
aperture2 = af["aperture"]
27+
with asdf.open(tmp_path / 'aperture.asdf') as af:
28+
aperture2 = af['aperture']
2929

3030
assert np.all(aperture.positions == aperture2.positions)
3131
assert aperture.r == aperture2.r

photutils/converters/tests/test_psf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010

1111

1212
psfs = [
13-
AiryDiskPSF(flux=1*u.Jy, x_0=0*u.arcsec, y_0=0*u.arcsec,
14-
radius=1*u.arcsec, bbox_factor=2),
15-
AiryDiskPSF(flux=2*u.Jy, x_0=1*u.arcsec, y_0=1*u.arcsec,
16-
radius=2*u.arcsec, bbox_factor=3),
13+
AiryDiskPSF(flux=1 * u.Jy, x_0=0 * u.arcsec, y_0=0 * u.arcsec,
14+
radius=1 * u.arcsec, bbox_factor=2),
15+
AiryDiskPSF(flux=2 * u.Jy, x_0=1 * u.arcsec, y_0=1 * u.arcsec,
16+
radius=2 * u.arcsec, bbox_factor=3),
1717
]
1818

1919

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,8 @@ exclude = [
242242
'\._.*', # private functions/methods
243243
'^test_*', # test code
244244
'^conftest.*$', # pytest configuration
245+
'to_yaml_tree', # ASDF converter
246+
'from_yaml_tree', # ASDF converter
245247

246248
# PR01: private classes/functions
247249
'SigmaClipSentinelDefault$',

0 commit comments

Comments
 (0)