Skip to content

Commit

Permalink
fixing use of np.bool which seems to fail on new numpy
Browse files Browse the repository at this point in the history
  • Loading branch information
jgostick committed Jun 6, 2023
1 parent cc3742a commit 126bcfb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions openpnm/algorithms/_invasion_percolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,8 @@ def _find_trapped_pores(inv_seq, indices, indptr, outlets): # pragma: no cover
sorted_seq = np.vstack((inv_seq.astype(np.int_), np.arange(Np, dtype=np.int_))).T
sorted_seq = sorted_seq[sorted_seq[:, 0].argsort()][::-1]
cluster = -np.ones(Np, dtype=np.int_)
trapped_pores = np.zeros(Np, dtype=np.bool_)
trapped_clusters = np.zeros(Np, dtype=np.bool_)
trapped_pores = np.zeros(Np, dtype=bool)
trapped_clusters = np.zeros(Np, dtype=bool)
# cluster_map = qupc_initialize(Np)
cluster_map = np.arange(Np, dtype=np.int_)
next_cluster_num = 0
Expand Down
2 changes: 1 addition & 1 deletion openpnm/io/_vtk.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def project_to_vtk(project, filename="",
if array.dtype == "O":
logger.warning(key + " has dtype object," + " will not write to file")
else:
if array.dtype == np.bool:
if array.dtype == bool:
array = array.astype(int)
if np.any(np.isnan(array)):
if fill_nans is None:
Expand Down

0 comments on commit 126bcfb

Please sign in to comment.