Description
These are all related issues:
Model.standard_broadcasting is not documented.
_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
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
Description
These are all related issues:
Model.standard_broadcastingis not documented._validate_input_shapesdoes not use argumentvalidate_broadcastingwhich I believe is theModel.standard_broadcastingflag and should turn off validation if True._validate_input_shapesclaims 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=Falseinputs with non-broadcastable shapes should be accepted (and handled by the model.This example should work
Actual behavior