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

Changed latex strings to raw strings #1283

Merged
merged 1 commit into from
Oct 14, 2020
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
8 changes: 4 additions & 4 deletions tardis/plasma/properties/atomic.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ class Levels(BaseAtomicDataProperty):

outputs = ("levels", "excitation_energy", "metastability", "g")
latex_name = (
"\\textrm{levels}",
"\\epsilon_{\\textrm{k}}",
"\\textrm{metastability}",
r"\textrm{levels}",
r"\epsilon_{\textrm{k}}",
r"\textrm{metastability}",
"g",
)

Expand Down Expand Up @@ -115,7 +115,7 @@ class PhotoIonizationData(ProcessingPlasmaProperty):
"photo_ion_block_references",
"photo_ion_index",
)
latex_name = ("\\xi_{\\textrm{i}}(\\nu)", "", "")
latex_name = (r"\xi_{\textrm{i}}(\nu)", "", "")

def calculate(self, atomic_data, continuum_interaction_species):
photoionization_data = atomic_data.photoionization_data.set_index(
Expand Down
2 changes: 1 addition & 1 deletion tardis/plasma/properties/continuum_processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class SpontRecombRateCoeff(ProcessingPlasmaProperty):
"""

outputs = ("alpha_sp",)
latex_name = ("\\alpha^{\\textrm{sp}}",)
latex_name = (r"\alpha^{\textrm{sp}}",)

def calculate(
self,
Expand Down
16 changes: 8 additions & 8 deletions tardis/plasma/properties/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class BetaRadiation(ProcessingPlasmaProperty):
"""

outputs = ("beta_rad",)
latex_name = ("\\beta_{\\textrm{rad}}",)
latex_formula = ("\\dfrac{1}{k_{B} T_{\\textrm{rad}}}",)
latex_name = (r"\beta_{\textrm{rad}}",)
latex_formula = (r"\dfrac{1}{k_{B} T_{\textrm{rad}}}",)

def __init__(self, plasma_parent):
super(BetaRadiation, self).__init__(plasma_parent)
Expand All @@ -49,7 +49,7 @@ class GElectron(ProcessingPlasmaProperty):
"""

outputs = ("g_electron",)
latex_name = ("g_{\\textrm{electron}}",)
latex_name = (r"g_{\textrm{electron}}",)
latex_formula = (
r"\Big(\dfrac{2\pi m_{e}/\beta_{\textrm{rad}}}{h^2}\Big)^{3/2}",
)
Expand All @@ -69,7 +69,7 @@ class ThermalGElectron(GElectron):
"""

outputs = ("thermal_g_electron",)
latex_name = ("g_{\\textrm{electron_thermal}}",)
latex_name = (r"g_{\textrm{electron_thermal}}",)
latex_formula = (
r"\Big(\dfrac{2\pi m_{e}/\beta_{\textrm{electron}}}{h^2}\Big)^{3/2}",
)
Expand Down Expand Up @@ -117,8 +117,8 @@ class ElectronTemperature(ProcessingPlasmaProperty):
"""

outputs = ("t_electrons",)
latex_name = ("T_{\\textrm{electron}}",)
latex_formula = ("\\textrm{const.}\\times T_{\\textrm{rad}}",)
latex_name = (r"T_{\textrm{electron}}",)
latex_formula = (r"\textrm{const.}\times T_{\textrm{rad}}",)

def calculate(self, t_rad, link_t_rad_t_electron):
return t_rad * link_t_rad_t_electron
Expand All @@ -132,8 +132,8 @@ class BetaElectron(ProcessingPlasmaProperty):
"""

outputs = ("beta_electron",)
latex_name = ("\\beta_{\\textrm{electron}}",)
latex_formula = ("\\frac{1}{K_{B} T_{\\textrm{electron}}}",)
latex_name = (r"\beta_{\textrm{electron}}",)
latex_formula = (r"\frac{1}{K_{B} T_{\textrm{electron}}}",)

def __init__(self, plasma_parent):
super(BetaElectron, self).__init__(plasma_parent)
Expand Down
29 changes: 13 additions & 16 deletions tardis/plasma/properties/ion_population.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,11 @@ class PhiSahaLTE(ProcessingPlasmaProperty):
"""

outputs = ("phi",)
latex_name = ("\\Phi",)
latex_name = (r"\Phi",)
latex_formula = (
"\\dfrac{2Z_{i,j+1}}{Z_{i,j}}\\Big(\
\\dfrac{2\\pi m_{e}/\\beta_{\\textrm{rad}}}{h^2}\
\\Big)^{3/2}e^{\\dfrac{-\\chi_{i,j}}{kT_{\
\\textrm{rad}}}}",
r"\dfrac{2Z_{i,j+1}}{Z_{i,j}}\Big(\
dfrac{2\pi m_{e}/\beta_{\textrm{rad}}}{h^2}\
Big)^{3/2}e^{\dfrac{-\chi_{i,j}}{kT_{\textrm{rad}}}}",
)

broadcast_ionization_energy = None
Expand Down Expand Up @@ -99,12 +98,11 @@ class ThermalPhiSahaLTE(PhiSahaLTE):
"""

outputs = ("thermal_phi_lte",)
latex_name = ("\\Phi^{*}(T_\\mathrm{e})",)
latex_name = (r"\Phi^{*}(T_\mathrm{e})",)
latex_formula = (
"\\dfrac{2Z_{i,j+1}}{Z_{i,j}}\\Big(\
\\dfrac{2\\pi m_{e}/\\beta_{\\textrm{electron}}}{h^2}\
\\Big)^{3/2}e^{\\dfrac{-\\chi_{i,j}}{kT_{\
\\textrm{electron}}}}",
r"\dfrac{2Z_{i,j+1}}{Z_{i,j}}\Big(\
dfrac{2\pi m_{e}/\beta_{\textrm{electron}}}{h^2}\
Big)^{3/2}e^{\dfrac{-\chi_{i,j}}{kT_{\textrm{electron}}}}",
)

@staticmethod
Expand All @@ -130,11 +128,10 @@ class PhiSahaNebular(ProcessingPlasmaProperty):
"""

outputs = ("phi",)
latex_name = ("\\Phi",)
latex_name = (r"\Phi",)
latex_formula = (
"W(\\delta\\zeta_{i,j}+W(1-\\zeta_{i,j}))\\left(\
\\dfrac{T_{\\textrm{electron}}}{T_{\\textrm{rad}}}\
\\right)^{1/2}",
r"W(\delta\zeta_{i,j}+W(1-\zeta_{i,j}))\left(\
dfrac{T_{\textrm{electron}}}{T_{\textrm{rad}}}\right)^{1/2}",
)

@staticmethod
Expand Down Expand Up @@ -196,7 +193,7 @@ class RadiationFieldCorrection(ProcessingPlasmaProperty):
"""

outputs = ("delta",)
latex_name = ("\\delta",)
latex_name = (r"\delta",)

def __init__(
self,
Expand Down Expand Up @@ -538,7 +535,7 @@ class SahaFactor(ProcessingPlasmaProperty):
"""

outputs = ("phi_ik",)
latex_name = ("\\Phi_{i,\\kappa}",)
latex_name = (r"\Phi_{i,\kappa}",)

def calculate(
self,
Expand Down
6 changes: 3 additions & 3 deletions tardis/plasma/properties/j_blues.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def calculate(lines, nu, t_rad):

class JBluesDiluteBlackBody(ProcessingPlasmaProperty):
outputs = ("j_blues",)
latex_name = "J_{\\textrm{blue}}"
latex_name = r"J_{\textrm{blue}}"

@staticmethod
def calculate(lines, nu, t_rad, w):
Expand Down Expand Up @@ -76,8 +76,8 @@ class JBluesNormFactor(ProcessingPlasmaProperty):

outputs = ("j_blues_norm_factor",)
latex = (
"\\frac{c time_\\textrm{simulation}}}{4 \\pi "
"time_\\textrm{simulation} volume}"
r"\frac{c time_\textrm{simulation}}}{4\pi"
r"time_\textrm{simulation} volume}"
)

@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion tardis/plasma/properties/level_population.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class LevelNumberDensity(ProcessingPlasmaProperty):

outputs = ("level_number_density",)
latex_name = ("N_{i,j,k}",)
latex_formula = ("N_{i,j}\\dfrac{bf_{i,j,k}}{Z_{i,j}}",)
latex_formula = (r"N_{i,j}\dfrac{bf_{i,j,k}}{Z_{i,j}}",)

def __init__(self, plasma_parent):
super(LevelNumberDensity, self).__init__(plasma_parent)
Expand Down
15 changes: 6 additions & 9 deletions tardis/plasma/properties/partition_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ class LevelBoltzmannFactorLTE(ProcessingPlasmaProperty):
outputs = ("general_level_boltzmann_factor",)
latex_name = ("bf_{i,j,k}",)
latex_formula = (
"g_{i,j,k}e^{\\dfrac{-\\epsilon_{i,j,k}}{k_{\
\\textrm{B}}T_{\\textrm{rad}}}}",
r"g_{i,j,k}e^{\dfrac{-\epsilon_{i,j,k}}{k_{\textrm{B}}T_{\textrm{rad}}}}",
)

@staticmethod
Expand Down Expand Up @@ -65,10 +64,9 @@ class ThermalLevelBoltzmannFactorLTE(LevelBoltzmannFactorLTE):
"""

outputs = ("thermal_lte_level_boltzmann_factor",)
latex_name = ("bf_{i,j,k}^{\\textrm{LTE}}(T_e)",)
latex_name = (r"bf_{i,j,k}^{\textrm{LTE}}(T_e)",)
latex_formula = (
"g_{i,j,k}e^{\\dfrac{-\\epsilon_{i,j,k}}{k_{\
\\textrm{B}}T_{\\textrm{electron}}}}",
r"g_{i,j,k}e^{\dfrac{-\epsilon_{i,j,k}}{k_{\textrm{B}}T_{\textrm{electron}}}}",
)

@staticmethod
Expand All @@ -94,8 +92,7 @@ class LevelBoltzmannFactorDiluteLTE(ProcessingPlasmaProperty):
outputs = ("general_level_boltzmann_factor",)
latex_name = ("bf_{i,j,k}",)
latex_formula = (
"Wg_{i,j,k}e^{\\dfrac{-\\epsilon_{i,j,k}}{k_{\
\\textrm{B}}T_{\\textrm{rad}}}}",
r"Wg_{i,j,k}e^{\dfrac{-\epsilon_{i,j,k}}{k_{\textrm{B}}T_{\textrm{rad}}}}",
)

def calculate(
Expand Down Expand Up @@ -368,7 +365,7 @@ class PartitionFunction(ProcessingPlasmaProperty):

outputs = ("partition_function",)
latex_name = ("Z_{i,j}",)
latex_formula = ("\\sum_{k}bf_{i,j,k}",)
latex_formula = (r"\sum_{k}bf_{i,j,k}",)

def calculate(self, level_boltzmann_factor):
return level_boltzmann_factor.groupby(
Expand All @@ -386,7 +383,7 @@ class ThermalLTEPartitionFunction(PartitionFunction):
"""

outputs = ("thermal_lte_partition_function",)
latex_name = ("Z_{i,j}(T_\\mathrm{e}",)
latex_name = (r"Z_{i,j}(T_\mathrm{e}",)

def calculate(self, thermal_lte_level_boltzmann_factor):
return super(ThermalLTEPartitionFunction, self).calculate(
Expand Down
10 changes: 5 additions & 5 deletions tardis/plasma/properties/plasma_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class TRadiative(ArrayInput):
"""

outputs = ("t_rad",)
latex_name = ("T_{\\textrm{rad}}",)
latex_name = (r"T_{\textrm{rad}}",)


class DilutionFactor(ArrayInput):
Expand Down Expand Up @@ -71,7 +71,7 @@ class Density(ArrayInput):
"""

outputs = ("density",)
latex_name = ("\\rho",)
latex_name = (r"\rho",)


class TimeExplosion(Input):
Expand All @@ -83,7 +83,7 @@ class TimeExplosion(Input):
"""

outputs = ("time_explosion",)
latex_name = ("t_{\\textrm{exp}}",)
latex_name = (r"t_{\textrm{exp}}",)


class JBlueEstimator(ArrayInput):
Expand All @@ -94,7 +94,7 @@ class JBlueEstimator(ArrayInput):
"""

outputs = ("j_blue_estimators",)
latex_name = ("J_{\\textrm{blue-estimator}}",)
latex_name = (r"J_{\textrm{blue-estimator}}",)


class LinkTRadTElectron(Input):
Expand All @@ -107,7 +107,7 @@ class LinkTRadTElectron(Input):
"""

outputs = ("link_t_rad_t_electron",)
latex_name = ("T_{\\textrm{electron}}/T_{\\textrm{rad}}",)
latex_name = (r"T_{\textrm{electron}}/T_{\textrm{rad}}",)


class HeliumTreatment(Input):
Expand Down
10 changes: 5 additions & 5 deletions tardis/plasma/properties/radiative_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class StimulatedEmissionFactor(ProcessingPlasmaProperty):
"""

outputs = ("stimulated_emission_factor",)
latex_formula = ("1-\\dfrac{g_{lower}n_{upper}}{g_{upper}n_{lower}}",)
latex_formula = (r"1-\dfrac{g_{lower}n_{upper}}{g_{upper}n_{lower}}",)

def __init__(self, plasma_parent=None, nlte_species=None):
super(StimulatedEmissionFactor, self).__init__(plasma_parent)
Expand Down Expand Up @@ -117,10 +117,10 @@ class TauSobolev(ProcessingPlasmaProperty):
"""

outputs = ("tau_sobolevs",)
latex_name = ("\\tau_{\\textrm{sobolev}}",)
latex_name = (r"\tau_{\textrm{sobolev}}",)
latex_formula = (
"\\dfrac{\\pi e^{2}}{m_{e} c}f_{lu}\\lambda t_{exp}\
n_{lower} \\Big(1-\\dfrac{g_{lower}n_{upper}}{g_{upper}n_{lower}}\\Big)",
r"\dfrac{\pi e^{2}}{m_{e} c}f_{lu}\lambda t_{exp}\
n_{lower} \Big(1-\dfrac{g_{lower}n_{upper}}{g_{upper}n_{lower}}\Big)",
)

def __init__(self, plasma_parent):
Expand Down Expand Up @@ -184,7 +184,7 @@ class BetaSobolev(ProcessingPlasmaProperty):
"""

outputs = ("beta_sobolev",)
latex_name = ("\\beta_{\\textrm{sobolev}}",)
latex_name = (r"\beta_{\textrm{sobolev}}",)

def calculate(self, tau_sobolevs):
if getattr(self, "beta_sobolev", None) is None:
Expand Down