def broadcast_arrays(*args):
is_scalar = all(np.array(arg).ndim == 0 for arg in args)
args = np.atleast_1d(*args)
# np.atleast_1d returns a scalar for only one arg, so need
# to turn it into a list for the np.broadcast_arrays call.
if not isinstance(args, list):
args = [args]
outs = [is_scalar] + np.broadcast_arrays(*args)
return outs
This doesn't impact anything in star_probs, but this is a useful-enough function that I use it elsewhere.
The code should be:
This doesn't impact anything in
star_probs
, but this is a useful-enough function that I use it elsewhere.