You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Set the cell type you want
switch = m.get('cell.mode')
switch.set_rhs(1)
# Freeze all the (constant) variables to this mode
for var in switch.refs_by():
if var.is_constant():
# Evaluate the variable's RHS, and set its new RHS to the result
var.set_rhs(var.eval()) # Remove the switch, if unused
# Remove unused child variables, if any
what's the best way to do this, if they depend on each other?
if not switch.refs_by():
switch.parent().remove_variable(switch)
The text was updated successfully, but these errors were encountered:
Related: Should probably add a method that lets you delete all children of a VarOwner. This can re-use the variable _delete but with has_ancestor and any ancestor instead of the more limited whole_component=True
E.g. before fitting you'll want to change statements like
to
by doing e.g.
The text was updated successfully, but these errors were encountered: