array functions (NEP 18) are supposed to treat pure numpy arrays as dimensionless, but the way this treatment is implemented in unyt 3.0.0 isn't robust enough and it chokes when passed Python lists, or unyt_arrays that use a registry other than the default one.
What I Did
The following 3 examples should be produce similar results and certainly not raise errors
import numpy as np
from unyt.unit_object import Unit
from unyt.unit_registry import UnitRegistry
# this is ok
np.concatenate([np.array([1]), [2]*Unit()])
# but this isn't
np.concatenate([[1], [2]*Unit()])
# and neither is this
np.concatenate([np.array([1]), [2]*Unit(registry=UnitRegistry())])
Description
array functions (NEP 18) are supposed to treat pure numpy arrays as dimensionless, but the way this treatment is implemented in unyt 3.0.0 isn't robust enough and it chokes when passed Python lists, or unyt_arrays that use a registry other than the default one.
What I Did
The following 3 examples should be produce similar results and certainly not raise errors