Skip to content

Commit b5ee664

Browse files
Jammy2211claude
authored andcommitted
fix: suppress CLI noise from docstring escape sequences and third-party warnings
Convert docstrings containing LaTeX math and ASCII art to raw strings (r""") to fix SyntaxWarning: invalid escape sequence warnings during test collection. Add pytest filterwarnings for JAX CUDA plugin and deprecation warnings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c838c80 commit b5ee664

9 files changed

Lines changed: 17 additions & 13 deletions

File tree

autogalaxy/convert.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ def shear_angle_from(gamma_1: float, gamma_2: float, xp=np) -> float:
277277
def multipole_k_m_and_phi_m_from(
278278
multipole_comps: Tuple[float, float], m: int, xp=np
279279
) -> Tuple[float, float]:
280-
"""
280+
r"""
281281
Returns the multipole normalization value `k_m` and angle `phi` from the multipole component parameters.
282282
283283
The normalization and angle are given by:
@@ -333,7 +333,7 @@ def multipole_k_m_phi_m_and_shape_angle_from(
333333
ellipse_angle: Optional[float],
334334
xp=np
335335
) -> Tuple[float, float, float]:
336-
"""
336+
r"""
337337
Returns the multipole normalization value `k_m`, angle `phi` and shape_angle `s` from the multipole
338338
component parameters. The shape angle is the difference between the angle of the underlying elliptical profile and
339339
the multipole `phi_m` and is what defines the shape of the perturbation around the ellipse oriented towards the
@@ -404,7 +404,7 @@ def multipole_comps_from(
404404
shape_angle: Optional[float]=None, ellipse_angle: Optional[float]=None,
405405
xp=np
406406
) -> Tuple[float, float]:
407-
"""
407+
r"""
408408
Returns the multipole component parameters from their normalization value `k_m` and angle `phi`.
409409
410410
.. math::

autogalaxy/ellipse/ellipse/ellipse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def __init__(
1111
ell_comps: Tuple[float, float] = (0.0, 0.0),
1212
major_axis: float = 1.0,
1313
):
14-
"""
14+
r"""
1515
class representing an ellispe, which is used to perform ellipse fitting to 2D data (e.g. an image).
1616
1717
The elliptical components (`ell_comps`) of this profile are used to define the `axis_ratio` (q)

autogalaxy/ellipse/ellipse/ellipse_multipole.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def __init__(
1212
m=4,
1313
multipole_comps: Tuple[float, float] = (0.0, 0.0),
1414
):
15-
"""
15+
r"""
1616
class representing the multipole of an ellispe with, which is used to perform ellipse fitting to
1717
2D data (e.g. an image).
1818
@@ -122,7 +122,7 @@ def __init__(
122122
scaled_multipole_comps: Tuple[float, float] = (0.0, 0.0),
123123
major_axis=1.0,
124124
):
125-
"""
125+
r"""
126126
class representing the multipole of an ellipse, which is used to perform ellipse fitting to
127127
2D data (e.g. an image). This multipole is fit with its strength held relative to an ellipse with a
128128
major_axis of 1, allowing for a set of ellipse multipoles to be fit at different major axes but with

autogalaxy/profiles/geometry_profiles.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def __init__(
189189
centre: Tuple[float, float] = (0.0, 0.0),
190190
ell_comps: Tuple[float, float] = (0.0, 0.0),
191191
):
192-
"""
192+
r"""
193193
An elliptical profile, which describes the geometry of profiles defined by an ellipse.
194194
195195
The elliptical components (`ell_comps`) of this profile are used to define the `axis_ratio` (q)

autogalaxy/profiles/light/standard/gaussian.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def __init__(
1717
intensity: float = 0.1,
1818
sigma: float = 1.0,
1919
):
20-
"""
20+
r"""
2121
The elliptical Gaussian light profile.
2222
2323
The intensity distribution of the profile is given by:

autogalaxy/profiles/mass/dark/nfw.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def __init__(
1717
kappa_s: float = 0.05,
1818
scale_radius: float = 1.0,
1919
):
20-
"""
20+
r"""
2121
The elliptical NFW profiles, used to fit the dark matter halo of the lens.
2222
2323
Parameters
@@ -273,7 +273,7 @@ def __init__(
273273
kappa_s: float = 0.05,
274274
scale_radius: float = 1.0,
275275
):
276-
"""
276+
r"""
277277
The spherical NFW profiles, used to fit the dark matter halo of the lens.
278278
279279
Parameters

autogalaxy/profiles/mass/stellar/gaussian_gradient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def __init__(
1414
mass_to_light_gradient: float = 0.0,
1515
mass_to_light_radius: float = 1.0,
1616
):
17-
"""
17+
r"""
1818
The elliptical Gaussian light profile with a gradient in its mass to light conversion.
1919
2020
$\Psi (r) = \Psi_{o} \frac{(\sigma + 0.01)}{R_{ref}}^{\Tau}$

autogalaxy/profiles/mass/total/isothermal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
def psi_from(grid, axis_ratio, core_radius, xp=np):
11-
"""
11+
r"""
1212
Returns the $\Psi$ term in expressions for the calculation of the deflection of an elliptical isothermal mass
1313
distribution. This is used in the `Isothermal` and `Chameleon` `MassProfile`'s.
1414

pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,8 @@ dev = ["pytest", "black"]
6969
"autogalaxy.config" = ["*"]
7070

7171
[tool.pytest.ini_options]
72-
testpaths = ["test_autogalaxy"]
72+
testpaths = ["test_autogalaxy"]
73+
filterwarnings = [
74+
"ignore:cuda_plugin_extension:UserWarning",
75+
"ignore::DeprecationWarning:jax",
76+
]

0 commit comments

Comments
 (0)