Better way to deal with an equilibrium having both an iota
and current
profile assigned to it
#1482
Labels
enhancement
General label for enhancement. Please also tag with "Speed", "Interface", "Functionality", etc
P2
Medium Priority, not urgent but should be on the near-term agend
Currently, when we have an equilibrium with both a current and iota profile assigned to it, we will throw an error when doing a default
eq.solve
for instance, because it will try to assignFixCurrent
andFixIota
as profile constraints.However, one may still do things like
eq.compute
or even do an optimization withlsq-auglag
(as that does not trigger an equilibrium solve). This leads to weird behavior where the equilibrium seems ok, but it is not using its assigned current profile at all and is instead using its iota profile (as we check for iota profile existing first in our compute functions for iota).This is in some sense really just due to user error, they should know not to have both a current and iota profile attached, but when a user loads a wout file, by default the iota profile is used, and if they then assign a current profile to it without first setting
eq.iota=None
, then they may not realize they've made a mistake here. We could try to add a warning when a current/iota profileis assigned while the other profile attribute exists, and sayUserWarning: Equilibrium already has existing current profile. Please remove with eq.current=None before using for optimization or equilibrium solving
Or, I would even be ok with automatically removing the other profile, as if I am assigning a current profile to an equilibrium, I almost certainly don't want the iota profile to still be attached to the equilibrium (and in most cases it will cause problems later). We could do this verbosely and still throw a warning saying
UserWarning: Adding an iota profile to Equilibrium which already has existing current profile. Removing the Equilibrium current profile, as only one of iota/current is allowed to be assigned to an equilibrium.
I favor the latter option, but what do you guys think? @PlasmaControl/desc-dev
The text was updated successfully, but these errors were encountered: