Skip to content

Commit

Permalink
need to squeeze for NumPy 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MarDiehl committed Jun 19, 2024
1 parent 6bb914e commit 6d7ef46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions python/damask/_geomgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ def load_DREAM3D(fname: Union[str, Path],
O = Rotation.from_Euler_angles(f['/'.join([b,c,Euler_angles])]).as_quaternion().reshape(-1,4) # noqa
unique,unique_inverse = np.unique(np.hstack([O,phase]),return_inverse=True,axis=0)
ma = np.arange(cells.prod()) if len(unique) == cells.prod() else \
np.arange(unique.size)[np.argsort(pd.unique(unique_inverse))][unique_inverse]
np.arange(unique.size)[np.argsort(pd.unique(unique_inverse.squeeze()))][unique_inverse]
else:
ma = f['/'.join([b,c,feature_IDs])][()].flatten()

Expand Down Expand Up @@ -512,7 +512,7 @@ def from_table(table: Table,
unique,unique_inverse = np.unique(np.hstack([table.get(l) for l in labels_]),return_inverse=True,axis=0)

ma = np.arange(cells.prod()) if len(unique) == cells.prod() else \
np.arange(unique.size)[np.argsort(pd.unique(unique_inverse))][unique_inverse]
np.arange(unique.size)[np.argsort(pd.unique(unique_inverse.squeeze()))][unique_inverse]

return GeomGrid(material = ma.reshape(cells,order='F'),
size = size,
Expand Down
4 changes: 2 additions & 2 deletions src/grid/VTI.f90
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ subroutine VTI_readCellsSizeOrigin(cells,geomSize,origin, &

end do outer

if (any(geomSize<=0)) call IO_error(error_ID = 844, ext_msg='size')
if (any(cells<1)) call IO_error(error_ID = 844, ext_msg='cells')
if (any(geomSize<=0)) call IO_error(error_ID = 844, ext_msg='size')
if (any(cells<1)) call IO_error(error_ID = 844, ext_msg='cells')

end subroutine VTI_readCellsSizeOrigin

Expand Down

0 comments on commit 6d7ef46

Please sign in to comment.