Skip to content

Commit

Permalink
Merge pull request #462 from vsnever/fix/raw_docstrings
Browse files Browse the repository at this point in the history
Add r prefix to docstrings with escape characters to fix SyntaxWarnings in Python 3.12
  • Loading branch information
jacklovell authored Aug 7, 2024
2 parents 2fd8b49 + de28d00 commit 34e8503
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
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

0 comments on commit 34e8503

Please sign in to comment.