DASDAE / dascore

A python library for distributed fiber optic sensing
Other
72 stars 16 forks source link

coord error for stop>start and negative step #321

Closed d-chambers closed 8 months ago

d-chambers commented 8 months ago

Description

A coordinate with its stop > start and a negative step currently doesn't raise an error, but it should.

Example

from dascore.core import get_coord

# no problems here
coord = get_coord(start=1, stop=5, step=-1)

# len still works
len(coord)

# but accessing any of the values fails
coord[0]  # raises IndexError

Expected behavior

It should raise some DASCore Exception indicating the coord is invalid upon construction.