MWE:
eq = get("precise_QA")
coils = initialize_modular_coils(eq, num_coils=3, r_over_a=2)
# runs fine
obj = ObjectiveFunction(CoilLength(coils, weight=[0, 1, 2]))
obj.build()
# fails
obj = ObjectiveFunction(CoilTorsion(coils, weight=[0, 1, 2]))
obj.build()
Currently, the masking of the coil objective by weight=0 trick doesn't work if the objective returns quantities on each node of the grid. There are multiple things to fix:
- This line fails since fancy indexing of python lists with numpy arrays is not possible
obj._coilset_tree["coilset_mask"] doesn't have proper length to index grid which has length num_coils
@singh-jaydeep, can you think of any simple fix?
MWE:
Currently, the masking of the coil objective by
weight=0trick doesn't work if the objective returns quantities on each node of the grid. There are multiple things to fix:obj._coilset_tree["coilset_mask"]doesn't have proper length to indexgridwhich has lengthnum_coils@singh-jaydeep, can you think of any simple fix?