Open cboulay opened 1 day ago
@cboulay I don't know that numpy is actually a dependency of this package. I've always treated it as an optional dependency and a testing dependency because our tests rely on it and AxisArray depends on it, but we don't require users to use AxisArray if they don't want.
I take quite a bit of pride in stating that ezmsg core has no dependencies (typing-extensions doesn't count IMO) and would like to keep it that way :P
OK. It seems sloppy to have numpy a dependency in the package code but not included in the dependencies list. Maybe we can do something like the following to let the user know this is intentional:
# in ezmsg.util.messages.axisarray
try:
import numpy as np
except ModuleImportError:
print("Use of AxisArray requires ezmsg to be installed with `pip install ezmsg[AxisArray]`")
And we change the pyproject.toml to have the optional dependency group for AxisArray which includes numpy.
Would that work better?
Another option would be to move AxisArray
to ezmsg-sigproc.
Im happy to have the try-except block in there for now. I predict that we will have a lot of activity in AxisArray for the foreseeable future, but the rest of core is pretty stable at the moment. Moving AxisArray to sigproc had crossed my mind but I don't like having to bring in the whole sigproc library for a message definition. For now let's keep it in core with the try except block around the numpy import, but we may consider making AxisArray it's own little package if it gets enough features or possibly including it in a ezmsg-std-msgs repo of common message types (which is what ROS does)
I guess this rarely comes up because almost everything using ezmsg also uses numpy, but not everything! (ezmsg-zmq for example) This should be a quick fix. I'll go straight to main.