Skip to content

Commit

Permalink
Fixes #33 to support numpy 2.0 (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
amir-hossein-zarei authored Jun 21, 2024
1 parent e609868 commit 7771c5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions largestinteriorrectangle/lir_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def predict_vector_size(array):
def h_vector(h_adjacency, x, y):
vector_size = predict_vector_size(h_adjacency[y:, x])
h_vector = np.zeros(vector_size, dtype=np.uint32)
h = np.Inf
h = np.inf
for p in range(vector_size):
h = np.minimum(h_adjacency[y + p, x], h)
h_vector[p] = h
Expand All @@ -63,7 +63,7 @@ def h_vector(h_adjacency, x, y):
def v_vector(v_adjacency, x, y):
vector_size = predict_vector_size(v_adjacency[y, x:])
v_vector = np.zeros(vector_size, dtype=np.uint32)
v = np.Inf
v = np.inf
for q in range(vector_size):
v = np.minimum(v_adjacency[y, x + q], v)
v_vector[q] = v
Expand Down
4 changes: 2 additions & 2 deletions largestinteriorrectangle/lir_within_contour.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def adjacencies_all_directions(grid):
def h_vector_bottom2top(h_adjacency, x, y):
vector_size = predict_vector_size(np.flip(h_adjacency[: y + 1, x]))
h_vector = np.zeros(vector_size, dtype=np.uint32)
h = np.Inf
h = np.inf
for p in range(vector_size):
h = np.minimum(h_adjacency[y - p, x], h)
h_vector[p] = h
Expand All @@ -85,7 +85,7 @@ def h_vectors_all_directions(h_left2right, h_right2left, x, y):
def v_vector_right2left(v_adjacency, x, y):
vector_size = predict_vector_size(np.flip(v_adjacency[y, : x + 1]))
v_vector = np.zeros(vector_size, dtype=np.uint32)
v = np.Inf
v = np.inf
for q in range(vector_size):
v = np.minimum(v_adjacency[y, x - q], v)
v_vector[q] = v
Expand Down

0 comments on commit 7771c5f

Please sign in to comment.