Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add r prefix to docstrings with escape characters to fix SyntaxWarnings in Python 3.12 #462

Merged
merged 2 commits into from
Aug 7, 2024
Merged
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
2 changes: 1 addition & 1 deletion cherab/core/model/laser/model.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ from cherab.core.utility.constants cimport SPEED_OF_LIGHT, ELECTRON_CLASSICAL_RA


cdef class SeldenMatobaThomsonSpectrum(LaserModel):
"""
r"""
Thomson Scattering based on Selden-Matoba.

The class calculates Thomson scattering of the laser to the spectrum. The model of the scattered spectrum used is based on
Expand Down
4 changes: 2 additions & 2 deletions cherab/core/plasma/node.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ cdef class Plasma(Node):

@cython.cdivision(True)
cpdef double z_effective(self, double x, double y, double z) except -1:
"""
r"""
Calculates the effective Z of the plasma.

.. math::
Expand Down Expand Up @@ -435,7 +435,7 @@ cdef class Plasma(Node):
@cython.boundscheck(False)
@cython.wraparound(False)
cpdef double ion_density(self, double x, double y, double z):
"""
r"""
Calculates the total ion density of the plasma.

.. math::
Expand Down
2 changes: 1 addition & 1 deletion cherab/generomak/plasma/plasma.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def get_double_parabola(v_min, v_max, convexity, concavity, xmin=0, xmax=1):


def get_exponential_growth(initial_value, growth_rate, initial_position=1):
"""
r"""
returns exponentially growing Function1D

The returned Function1D is of the form:
Expand Down
2 changes: 1 addition & 1 deletion cherab/tools/emitters/radiation_function.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cimport cython


cdef class RadiationFunction(InhomogeneousVolumeEmitter):
"""
r"""
A general purpose radiation material.

Radiates power over 4 pi according to the supplied 3D radiation
Expand Down
6 changes: 3 additions & 3 deletions cherab/tools/equilibrium/efit.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ from cherab.core.math cimport IsoMapper2D, AxisymmetricMapper, VectorAxisymmetri
from cherab.core.math cimport ClampOutput2D

cdef class EFITEquilibrium:
"""
r"""
An object representing an EFIT equilibrium time-slice.

EFIT is a code commonly used throughout the Fusion research community
Expand Down Expand Up @@ -278,7 +278,7 @@ cdef class EFITEquilibrium:
return AxisymmetricMapper(self.map2d(profile, value_outside_lcfs))

def map_vector2d(self, object toroidal, object poloidal, object normal, Vector3D value_outside_lcfs=None):
"""
r"""
Maps velocity components in flux coordinates onto flux surfaces in the r-z plane.

It is often convenient to express the plasma velocity components in flux coordinates,
Expand Down Expand Up @@ -344,7 +344,7 @@ cdef class EFITEquilibrium:
return VectorBlend2D(value_outside_lcfs, v, self.inside_lcfs)

def map_vector3d(self, object toroidal, object poloidal, object normal, Vector3D value_outside_lcfs=None):
"""
r"""
Maps velocity components in flux coordinates onto flux surfaces in 3D space.

It is often convenient to express the plasma velocity components in flux coordinates,
Expand Down
2 changes: 1 addition & 1 deletion cherab/tools/inversions/lstsq.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@


def invert_regularised_lstsq(w_matrix, b_vector, alpha=0.01, tikhonov_matrix=None):
"""
r"""
Solves :math:`\mathbf{b} = \mathbf{W} \mathbf{x}` for the vector :math:`\mathbf{x}`,
using Tikhonov regulariastion.

Expand Down
4 changes: 2 additions & 2 deletions cherab/tools/inversions/sart.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ cimport cython
@cython.boundscheck(False)
cpdef invert_sart(geometry_matrix, measurement_vector, object initial_guess=None, int max_iterations=250,
double relaxation=1.0, double conv_tol=1.0E-4):
"""
r"""
Performs a SART inversion on the specified measurement vector.

This function implements the Simultaneous Algebraic Reconstruction Technique (SART), as published in
Expand Down Expand Up @@ -161,7 +161,7 @@ cpdef invert_sart(geometry_matrix, measurement_vector, object initial_guess=None
cpdef invert_constrained_sart(geometry_matrix, laplacian_matrix, measurement_vector,
object initial_guess=None, int max_iterations=250, double relaxation=1.0,
double beta_laplace=0.01, double conv_tol=1.0E-4):
"""
r"""

Performs a constrained SART inversion on the specified measurement vector.

Expand Down
4 changes: 2 additions & 2 deletions cherab/tools/raytransfer/emitters.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ cdef class RayTransferIntegrator(VolumeIntegrator):


cdef class CylindricalRayTransferIntegrator(RayTransferIntegrator):
"""
r"""
Calculates the distances traveled by the ray through the voxels defined on a regular grid
in cylindrical coordinate system: :math:`(R, \phi, Z)`. This integrator is used
with the `CylindricalRayTransferEmitter` material class to calculate ray transfer matrices
Expand Down Expand Up @@ -338,7 +338,7 @@ cdef class RayTransferEmitter(InhomogeneousVolumeEmitter):


cdef class CylindricalRayTransferEmitter(RayTransferEmitter):
"""
r"""
A unit emitter defined on a regular 3D :math:`(R, \phi, Z)` grid, which
can be used to calculate ray transfer matrices (geometry matrices) for a single value
of wavelength.
Expand Down
2 changes: 1 addition & 1 deletion cherab/tools/raytransfer/raytransfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def invert_voxel_map(self):


class RayTransferCylinder(RayTransferObject):
"""
r"""
Ray transfer object for cylindrical emitter defined on a regular 3D :math:`(R, \phi, Z)` grid.
This emitter is periodic in :math:`\phi` direction.
The base of the cylinder is located at `Z = 0` plane. Use `transform`
Expand Down
Loading