Skip to content

Commit

Permalink
Fix _print_value_fmt for some objectives and fix some latex labels (#…
Browse files Browse the repository at this point in the history
…1230)

#1189 changed the format of `_print_value_fmt` some recent merged PR's
added new objectives that shouldn't work with the new format and throw
`IndexError: Replacement index 2 out of range for positional args
tuple`.

Also, I think I missed one of the objectives during that PR. This fixes
the formats.

And some small label fixes.
  • Loading branch information
YigitElma authored Aug 28, 2024
2 parents 04e6e56 + 63ed69e commit f21d65b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion desc/compute/_equil.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ def _e_sup_helical_times_sqrt_g_mag(params, transforms, profiles, data, **kwargs

@register_compute_fun(
name="F_anisotropic",
label="F_{anisotropic}",
label="F_{\\mathrm{anisotropic}}",
units="N \\cdot m^{-3}",
units_long="Newtons / cubic meter",
description="Anisotropic force balance error",
Expand Down
4 changes: 2 additions & 2 deletions desc/compute/_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -1644,7 +1644,7 @@ def _B_sub_zeta(params, transforms, profiles, data, **kwargs):

@register_compute_fun(
name="B_phi|r,t",
label="B_{\\phi} = B \\dot \\mathbf{e}_{\\phi} |_{\\rho, \\theta}",
label="B_{\\phi} = B \\cdot \\mathbf{e}_{\\phi} |_{\\rho, \\theta}",
units="T \\cdot m",
units_long="Tesla * meters",
description="Covariant toroidal component of magnetic field in (ρ,θ,ϕ) "
Expand Down Expand Up @@ -2269,7 +2269,7 @@ def _B_sub_zeta_rz(params, transforms, profiles, data, **kwargs):

@register_compute_fun(
name="<|B|>_axis",
label="\\lange |\\mathbf{B}| \\rangle_{axis}",
label="\\langle |\\mathbf{B}| \\rangle_{axis}",
units="T",
units_long="Tesla",
description="Average magnitude of magnetic field on the magnetic axis",
Expand Down
2 changes: 1 addition & 1 deletion desc/objectives/_equilibrium.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ class HelicalForceBalance(_Objective):
_equilibrium = True
_coordinates = "rtz"
_units = "(N)"
_print_value_fmt = "Helical force error: {:10.3e}, "
_print_value_fmt = "Helical force error: "

def __init__(
self,
Expand Down
4 changes: 2 additions & 2 deletions desc/objectives/_power_balance.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class FusionPower(_Objective):

_scalar = True
_units = "(W)"
_print_value_fmt = "Fusion power: {:10.3e} "
_print_value_fmt = "Fusion power: "

def __init__(
self,
Expand Down Expand Up @@ -246,7 +246,7 @@ class HeatingPowerISS04(_Objective):

_scalar = True
_units = "(W)"
_print_value_fmt = "Heating power: {:10.3e} "
_print_value_fmt = "Heating power: "

def __init__(
self,
Expand Down

0 comments on commit f21d65b

Please sign in to comment.