Closed Nabushika closed 3 years ago
__repr__
- same style regardless of the dimension (a future todo).test_ne_pos
only checks for changes in y-coordinate, but changes in x / z aren't tested.
- Definitely need to homogenise
__repr__
- same style regardless of the dimension (a future todo).test_ne_pos
only checks for changes in y-coordinate, but changes in x / z aren't tested.
Both should be fixed in the latest commit -- __repr__
style is now consistent and reflected in tests.
Made point class use a
position
tuple, so can use 2, 3, or more dimensions. Should be a drop in replacement for the old point.Changes
not tuple
totuple is None
pos
tuple for generality, plusx
,y
,z
properties for backwards compatibility.__new__
fortorch.Tensor
allocationto_tensor
/from_tensor
to support arbitrary dimensions__lt__
- doesn't make much sense, but is necessary for heaps (need items to be orderable) and Python supports lexicographic ordering or tuples__repr__
/__init__
specialise for 2D/x,y - this was mainly to pass the tests as-is.Future possible things to do/questions to reviewers
diff = Point(dst.x - src.x, dst.y - src.y)
z
as a keyword argument?Things to review