From 3a0bbc4e2b7f4d75c3fae43e5f26f163c6c47318 Mon Sep 17 00:00:00 2001 From: daniel-dudt Date: Mon, 26 Aug 2024 16:48:57 -0600 Subject: [PATCH] update default target and error checking --- desc/objectives/_power_balance.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/desc/objectives/_power_balance.py b/desc/objectives/_power_balance.py index 4d23de063..bea66ebbe 100644 --- a/desc/objectives/_power_balance.py +++ b/desc/objectives/_power_balance.py @@ -81,7 +81,7 @@ def __init__( fuel not in ["DT"], ValueError, f"fuel must be one of ['DT'], got {fuel}." ) if target is None and bounds is None: - target = 0 + target = 1e9 self._fuel = fuel self._grid = grid super().__init__( @@ -113,6 +113,11 @@ def build(self, use_jit=True, verbose=1): ValueError, "Equilibrium must have an electron density profile.", ) + errorif( + eq.ion_temperature is None, + ValueError, + "Equilibrium must have an ion temperature profile.", + ) if self._grid is None: self._grid = QuadratureGrid( L=eq.L_grid,