Description
DASCore's coordinates should behave like arrays for arithmetic purposes, but they currently do not.
Example
coord = dc.get_coord(data=[1,2,3,])
coord + 1 # Raises a TypeError
Expected behavior
Coords should act just like arrays in these respects, although any arithmetic operation should return a coordinate (which preserves units) not an array. For example,
import dascore as dc
coord =dc.get_coord([1,2,3], units='m')
coord_2 = coord + 1
assert isinstance(coord, dc.BaseCoordinate)
assert coord.units == coord_2.units
This should also be tested on a variety of array functions (plus, minus, np.linalg.norm, np.sqrt, etc).
Versions
- OS [e.g. Ubuntu 20.04]:
- DASCore Version [e.g. 0.0.5]:
- Python Version [e.g. 3.10]:
Description
DASCore's coordinates should behave like arrays for arithmetic purposes, but they currently do not.
Example
Expected behavior
Coords should act just like arrays in these respects, although any arithmetic operation should return a coordinate (which preserves units) not an array. For example,
This should also be tested on a variety of array functions (plus, minus, np.linalg.norm, np.sqrt, etc).
Versions