Skip to content

weight=0 for _broadcast_input='Node' fails #2219

Description

@YigitElma

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?

Metadata

Metadata

Assignees

Labels

P3Highest Priority, someone is/should be actively working on this

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions