def test_refine_y(): # Create a Shape object from the header shape = Shape({ 'x_number': 143, 'x_start': 84000, 'x_step': 500, 'x_stop': 155000, 'y_number': 143, 'y_start': 455000, 'y_step': 500, 'y_stop': 526000 }) # Refine shape with factor 2 shape.refine_y(2) # Extract the dict from the Shape object shape_dict = shape.to_dict() assert shape_dict == { 'x_number': 143, 'x_start': 84000, 'x_step': 500, 'x_stop': 155000, 'y_number': 285, 'y_start': 455000, 'y_step': 250, 'y_stop': 526000 }
def test_refine_y_inf(): # Create a Shape object from the header shape = Shape({ 'x_number': 143, 'x_start': 84000, 'x_step': 500, 'x_stop': 155000, 'y_number': 143, 'y_start': 455000, 'y_step': 500, 'y_stop': 526000 }) # Refine the shape with factor NaN factor = np.inf shape.refine_y(factor) assert False