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
_validate_input_shapes does not use argument validate_broadcasting which I believe is the Model.standard_broadcasting flag and should turn off validation if True.
_validate_input_shapes claims it checks if inputs are broadcastable. In reality it checks that the shapes of the inputs are the same. This prevents some valid use cases from running, e.g. multiply when input shapes are (10, 1) and (24,)
Expected behavior
When Model.standard_broadcasting=False inputs with non-broadcastable shapes should be accepted (and handled by the model.
This example should work
from astropy.modeling.models import math as astmath
t=np.array([np.linspace(0,1,10)]).T
astmath.MultiplyUfunc()(t, np.arange(4))
Actual behavior
astmath.MultiplyUfunc()(t, np.arange(4))
...
~/dev/astropy/astropy/modeling/core.py in _validate_input_shapes(inputs, argnames, n_models, model_set_axis, validate_broadcasting)
3708 if input_shape is None:
3709 raise ValueError(
-> 3710 "All inputs must have identical shapes or must be scalars.")
3711
Activity