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

🐛 Missed EQSummary use #3704

Merged
merged 3 commits into from
Nov 25, 2024
Merged
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
43 changes: 17 additions & 26 deletions eudemo/eudemo/equilibria/_designer.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,21 @@
)


def plasma_data(eq):
p_dat = eq.analyse_plasma()
return {
"beta_p": p_dat.beta_p,
"delta_95": p_dat.delta_95,
"delta": p_dat.delta,
"I_p": p_dat.I_p,
"kappa_95": p_dat.kappa_95,
"kappa": p_dat.kappa,
"l_i": p_dat.li,
"q_95": p_dat.q_95,
"shaf_shift": np.hypot(p_dat.dx_shaf, p_dat.dz_shaf),
}


@dataclass
class EquilibriumDesignerParams(ParameterFrame):
"""Parameters for running the `UnconstrainedTikhonovSolver`."""
Expand Down Expand Up @@ -163,19 +178,7 @@ def read(self) -> Equilibrium:
return eq

def _update_params_from_eq(self, eq: Equilibrium):
plasma_dict = eq.analyse_plasma()
new_values = {
"beta_p": plasma_dict.beta_p,
"delta_95": plasma_dict.delta_95,
"delta": plasma_dict.delta,
"I_p": plasma_dict.I_p,
"kappa_95": plasma_dict.kappa_95,
"kappa": plasma_dict.kappa,
"l_i": plasma_dict.li,
"q_95": plasma_dict.q_95,
"shaf_shift": np.hypot(plasma_dict.dx_shaf, plasma_dict.dz_shaf),
}
self.params.update_values(new_values, source=type(self).__name__)
self.params.update_values(plasma_data(eq), source=type(self).__name__)

def _make_equilibrium(self) -> Equilibrium:
"""
Expand Down Expand Up @@ -796,16 +799,4 @@ def _make_fbe_opt_problem(
)

def _update_params_from_eq(self, eq: Equilibrium):
plasma_dict = eq.analyse_plasma()
new_values = {
"beta_p": plasma_dict["beta_p"],
"delta_95": plasma_dict["delta_95"],
"delta": plasma_dict["delta"],
"I_p": plasma_dict["Ip"],
"kappa_95": plasma_dict["kappa_95"],
"kappa": plasma_dict["kappa"],
"l_i": plasma_dict["li"],
"q_95": plasma_dict["q_95"],
"shaf_shift": np.hypot(plasma_dict["dx_shaf"], plasma_dict["dz_shaf"]),
}
self.params.update_values(new_values, source=type(self).__name__)
self.params.update_values(plasma_data(eq), source=type(self).__name__)
Loading