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
2 changes: 1 addition & 1 deletion cherab/core/atomic/gaunt.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ from cherab.core.math cimport Function2D

cdef class FreeFreeGauntFactor():

cpdef double evaluate(self, double z, double temperature, double wavelength) except? -1e999
cdef double evaluate(self, double z, double temperature, double wavelength) except? -1e999


cdef class InterpolatedFreeFreeGauntFactor(FreeFreeGauntFactor):
Expand Down
10 changes: 5 additions & 5 deletions cherab/core/atomic/gaunt.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ cdef class FreeFreeGauntFactor():
The base class for temperature-averaged free-free Gaunt factors.
"""

cpdef double evaluate(self, double z, double temperature, double wavelength) except? -1e999:
cdef double evaluate(self, double z, double temperature, double wavelength) except? -1e999:
"""
Returns the temperature-averaged free-free Gaunt factor for the supplied parameters.
Return the temperature-averaged free-free Gaunt factor for the supplied parameters.

:param double z: Species charge or effective plasma charge.
:param double temperature: Electron temperature in eV.
Expand All @@ -51,7 +51,7 @@ cdef class FreeFreeGauntFactor():

def __call__(self, double z, double temperature, double wavelength):
"""
Returns the temperature-averaged free-free Gaunt factor for the supplied parameters.
Return the temperature-averaged free-free Gaunt factor for the supplied parameters.

:param double z: Species charge or effective plasma charge.
:param double temperature: Electron temperature in eV.
Expand Down Expand Up @@ -106,9 +106,9 @@ cdef class InterpolatedFreeFreeGauntFactor(FreeFreeGauntFactor):
self._gaunt_factor = Interpolator2DArray(np.log10(u), np.log10(gamma2), gaunt_factor, 'cubic', 'none', 0, 0)

@cython.cdivision(True)
cpdef double evaluate(self, double z, double temperature, double wavelength) except? -1e999:
cdef double evaluate(self, double z, double temperature, double wavelength) except? -1e999:
"""
Returns the temperature-averaged free-free Gaunt factor for the supplied parameters.
Return the temperature-averaged free-free Gaunt factor for the supplied parameters.

:param double z: Species charge or effective plasma charge.
:param double temperature: Electron temperature in eV.
Expand Down
2 changes: 1 addition & 1 deletion cherab/core/atomic/zeeman.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,4 @@ cdef class ZeemanStructure():
if polarisation.lower() == 'sigma_minus':
return np.asarray(self.evaluate(b, SIGMA_MINUS_POLARISATION))

raise ValueError('Argument "polarisation" must be "pi", "sigma_plus" or "sigma_minus", {} given.'.fotmat(polarisation))
raise ValueError('Argument "polarisation" must be "pi", "sigma_plus" or "sigma_minus", {} given.'.format(polarisation))
2 changes: 1 addition & 1 deletion cherab/core/math/integrators/integrators1d.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ cdef class Integrator1D:
"""
A 1D function to integrate.

:rtype: int
:rtype: Function1D
"""
return self.function

Expand Down
2 changes: 1 addition & 1 deletion cherab/core/math/integrators/integrators2d.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ cdef class Integrator2D:
"""
A 2D function to integrate.

:rtype: int
:rtype: Function2D
"""
return self.function

Expand Down
3 changes: 0 additions & 3 deletions cherab/core/math/mask.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,3 @@ cdef class PolygonMask2D(Function2D):

cdef double evaluate(self, double x, double y) except? -1e999:
return self._mesh.evaluate(x, y)



12 changes: 6 additions & 6 deletions cherab/core/math/samplers.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ cpdef tuple sample1d(object function1d, tuple x_range):
:param function1d: a Python function or Function1D object
:param x_range: a tuple defining the sample range: (min, max, samples)
:return: a tuple containing the sampled values: (x_points, function_samples)

.. code-block:: pycon

>>> from cherab.core.math import sample1d
Expand Down Expand Up @@ -221,7 +221,7 @@ cpdef np.ndarray sample2d_points(object function2d, object points):

.. code-block:: pycon

>>> from cherab.core.math import sample2d
>>> from cherab.core.math import sample2d_points
>>>
>>> def f1(x, y):
>>> return x**2 + y
Expand Down Expand Up @@ -316,7 +316,7 @@ cpdef tuple sample3d(object function3d, tuple x_range, tuple y_range, tuple z_ra
"""
Samples a 3D function over the specified range.

:param function3d: a Python function or Function2D object
:param function3d: a Python function or Function3D object
:param x_range: a tuple defining the x sample range: (x_min, x_max, x_samples)
:param y_range: a tuple defining the y sample range: (y_min, y_max, y_samples)
:param z_range: a tuple defining the z sample range: (z_min, z_max, z_samples)
Expand All @@ -335,7 +335,7 @@ cpdef tuple sample3d(object function3d, tuple x_range, tuple y_range, tuple z_ra
>>> f_vals
array([[[ 3., 4., 5.],
[ 6., 7., 8.],
[11., 12., 13.]],
[11., 12., 13.]],
[[10., 11., 12.],
[13., 14., 15.],
[18., 19., 20.]],
Expand Down Expand Up @@ -415,7 +415,7 @@ cpdef np.ndarray sample3d_points(object function3d, object points):
:param function3d: a Python function or Function3D object
:param points: an Nx3 array of points at which to sample the function
:return: a 1D array containing the sampled values at each point

.. code-block:: pycon

>>> from cherab.core.math import sample3d_points
Expand Down Expand Up @@ -744,7 +744,7 @@ cpdef tuple samplevector3d(object function3d, tuple x_range, tuple y_range, tupl
The function samples returns are an NxMxKx3 array where the last axis are the
x, y, and z components of the vector respectively.

:param function3d: a Python function or Function2D object
:param function3d: a Python function or Function3D object
:param x_range: a tuple defining the x sample range: (x_min, x_max, x_samples)
:param y_range: a tuple defining the y sample range: (y_min, y_max, y_samples)
:param z_range: a tuple defining the z sample range: (z_min, z_max, z_samples)
Expand Down
4 changes: 2 additions & 2 deletions cherab/core/math/transform/periodic.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ cdef class VectorPeriodicTransform3D(VectorFunction3D):

.. code-block:: pycon

>>> from cherab.core.math import PeriodicTransform3D
>>> from cherab.core.math import VectorPeriodicTransform3D
>>>
>>> def f1(x, y, z):
>>> return Vector3D(x, y, z)
Expand All @@ -327,7 +327,7 @@ cdef class VectorPeriodicTransform3D(VectorFunction3D):
def __init__(self, object function3d, double period_x, double period_y, double period_z):

if not callable(function3d):
raise TypeError("function2d is not callable.")
raise TypeError("function3d is not callable.")

self.function3d = autowrap_vectorfunction3d(function3d)

Expand Down
6 changes: 3 additions & 3 deletions cherab/tools/primitives/axisymmetric_mesh.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ from .toroidal_mesh import toroidal_mesh_from_polygon

cpdef Mesh axisymmetric_mesh_from_polygon(object polygon, int num_toroidal_segments=500):
"""
Generates an Raysect Mesh primitive from the specified 2D polygon.
Generate a Raysect Mesh primitive from the specified 2D polygon.

:param object polygon: An object which can be converted to a numpy array with shape [N,2]
specifying the wall outline polygon in the R-Z plane. The polygon
:param object polygon: An object which can be converted to a numpy array with shape [N,2]
specifying the wall outline polygon in the R-Z plane. The polygon
should not be closed, i.e. vertex i = 0 and i = N should not be the
same vertex, but neighbours.
:param int num_toroidal_segments: The number of repeating toroidal segments that will be used
Expand Down
Loading