Skip to content

Commit

Permalink
Merge pull request #432 from vsnever/docs/core_atomic_rates
Browse files Browse the repository at this point in the history
Fix incorrect docstrings for atomic rate base classes
  • Loading branch information
jacklovell committed May 10, 2024
2 parents bd36ca1 + af1c2ac commit 3f642b3
Showing 1 changed file with 30 additions and 31 deletions.
61 changes: 30 additions & 31 deletions cherab/core/atomic/rates.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ cdef class IonisationRate:
cpdef double evaluate(self, double density, double temperature) except? -1e999:
"""Returns an effective ionisation rate coefficient at the specified plasma conditions.
:param density: Electron density in m^-3.
:param temperature: Electron temperature in eV.
:param density: Electron density in m^-3
:return: The effective ionisation rate in m^-3.
:return: The effective ionisation rate in m^3.s^-1.
"""
raise NotImplementedError("The evaluate() virtual method must be implemented.")

Expand All @@ -57,9 +57,9 @@ cdef class RecombinationRate:
cpdef double evaluate(self, double density, double temperature) except? -1e999:
"""Returns an effective recombination rate coefficient at the specified plasma conditions.
:param density: Electron density in m^-3.
:param temperature: Electron temperature in eV.
:param density: Electron density in m^-3
:return: The effective ionisation rate in m^-3.
:return: The effective ionisation rate in m^3.s^-1.
"""
raise NotImplementedError("The evaluate() virtual method must be implemented.")

Expand All @@ -79,9 +79,9 @@ cdef class ThermalCXRate:
cpdef double evaluate(self, double density, double temperature) except? -1e999:
"""Returns an effective charge exchange rate coefficient at the specified plasma conditions.
:param density: Electron density in m^-3.
:param temperature: Electron temperature in eV.
:param density: Electron density in m^-3
:return: The effective charge exchange rate in m^-3.
:return: The effective charge exchange rate in m^3.s^-1.
"""
raise NotImplementedError("The evaluate() virtual method must be implemented.")

Expand All @@ -101,9 +101,9 @@ cdef class _PECRate:
cpdef double evaluate(self, double density, double temperature) except? -1e999:
"""Returns a photon emissivity coefficient at given conditions.
:param temperature: Receiver ion temperature in eV.
:param density: Receiver ion density in m^-3
:return: The effective PEC rate in W/m^3.
:param density: Electron density in m^-3.
:param temperature: Electron temperature in eV.
:return: The effective PEC rate in W.m^3.
"""
raise NotImplementedError("The evaluate() virtual method must be implemented.")

Expand Down Expand Up @@ -221,29 +221,28 @@ cdef class BeamEmissionPEC(_BeamRate):


cdef class TotalRadiatedPower():
"""The total radiated power in equilibrium conditions."""
"""The total radiated power rate in equilibrium conditions."""

def __init__(self, Element element):

self.element = element

def __call__(self, double electron_density, double electron_temperature):
"""
Evaluate the radiated power rate at the given plasma conditions.
Calls the cython evaluate() method under the hood.
Evaluate the total radiated power rate at the given plasma conditions.
:param float electron_density: electron density in m^-3
:param float electron_temperature: electron temperature in eV
This function just wraps the cython evaluate() method.
"""
return self.evaluate(electron_density, electron_temperature)

cdef double evaluate(self, double electron_density, double electron_temperature) except? -1e999:
"""
Evaluate the radiated power at the given plasma conditions.
Evaluate the total radiated power rate at the given plasma conditions.
:param float electron_density: Electron density in m^-3.
:param float electron_temperature: Electron temperature in eV.
:param float electron_density: electron density in m^-3
:param float electron_temperature: electron temperature in eV
:return: The total radiated power rate in W.m^3.
"""
raise NotImplementedError("The evaluate() virtual method must be implemented.")

Expand All @@ -260,19 +259,18 @@ cdef class _RadiatedPower:
"""
Evaluate the radiated power rate at the given plasma conditions.
Calls the cython evaluate() method under the hood.
:param float electron_density: electron density in m^-3
:param float electron_temperature: electron temperature in eV
This function just wraps the cython evaluate() method.
"""
return self.evaluate(electron_density, electron_temperature)

cdef double evaluate(self, double electron_density, double electron_temperature) except? -1e999:
"""
Evaluate the radiated power at the given plasma conditions.
:param float electron_density: electron density in m^-3
:param float electron_temperature: electron temperature in eV
:param float density: Electron density in m^-3.
:param float temperature: Electron temperature in eV.
:return: The radiated power rate in W.m^3.
"""
raise NotImplementedError("The evaluate() virtual method must be implemented.")

Expand Down Expand Up @@ -308,9 +306,9 @@ cdef class FractionalAbundance:
"""
Rate provider for fractional abundances in thermodynamic equilibrium.
:param Element element: the radiating element
:param int charge: the integer charge state for this ionisation stage
:param str name: optional label identifying this rate
:param Element element: the radiating element.
:param int charge: the integer charge state for this ionisation stage.
:param str name: optional label identifying this rate.
"""

def __init__(self, element, charge, name=''):
Expand All @@ -326,17 +324,18 @@ cdef class FractionalAbundance:
"""
Evaluate the fractional abundance of this ionisation stage at the given plasma conditions.
:param float electron_density: electron density in m^-3
:param float electron_temperature: electron temperature in eV
:param float electron_density: Electron density in m^-3.
:param float electron_temperature: Electron temperature in eV.
:return: Fractional abundance.
"""
raise NotImplementedError("The evaluate() virtual method must be implemented.")

def __call__(self, double electron_density, double electron_temperature):
"""
Evaluate the fractional abundance of this ionisation stage at the given plasma conditions.
:param float electron_density: electron density in m^-3
:param float electron_temperature: electron temperature in eV
This function just wraps the cython evaluate() method.
"""
return self.evaluate(electron_density, electron_temperature)

Expand Down

0 comments on commit 3f642b3

Please sign in to comment.