make sure depthparams handles negative steps and finish step correctly

revised test
This commit is contained in:
sliptonic
2021-11-26 13:27:44 -06:00
parent c410ba4f7d
commit 03f05b5ef9
2 changed files with 143 additions and 105 deletions

View File

@@ -788,8 +788,6 @@ class depth_params(object):
def __init__(self, clearance_height, safe_height, start_depth, step_down, z_finish_step, final_depth, user_depths=None, equalstep=False):
'''self, clearance_height, safe_height, start_depth, step_down, z_finish_depth, final_depth, [user_depths=None], equalstep=False'''
if z_finish_step > step_down:
raise ValueError('z_finish_step must be less than step_down')
self.__clearance_height = clearance_height
self.__safe_height = safe_height
@@ -801,6 +799,9 @@ class depth_params(object):
self.data = self.__get_depths(equalstep=equalstep)
self.index = 0
if self.__z_finish_step > self.__step_down:
raise ValueError('z_finish_step must be less than step_down')
def __iter__(self):
self.index = 0
return self