-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Description
If I try to pass in a numpy array to LinearConstraintProjections x_scale, it throws an error.
eq = get("precise_QA")
cons = get_fixed_boundary_constraints(eq)
cons = maybe_add_self_consistency(eq, cons)
con = ObjectiveFunction(cons)
obj = ObjectiveFunction(ForceBalance(eq))
lcp_scale_np = np.ones(eq.dim_x)
lcp_scale_np[eq.x_idx["L_lmn"]] *= 5
lcp_scale_jnp = jnp.ones(eq.dim_x)
lcp_scale_jnp = lcp_scale_jnp.at[eq.x_idx["L_lmn"]].multiply(5)
lcp = LinearConstraintProjection(obj, con, x_scale=lcp_scale_np)
lcp.build(verbose=3)ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Same example with lcp_scale_jnp works fine.
Additionally, the user-supplied x_scale is overriden in the line which I think shouldn't happen.
Metadata
Metadata
Assignees
Labels
No labels