Skip to content

Commit

Permalink
Use old numpy exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
LSchueler committed Nov 20, 2024
1 parent 727f86d commit ec9a16c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/gstools/field/pgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,16 @@ def calc_pgs(self):
pgs : :class:`numpy.ndarray`
the plurigaussian field
"""
mapping = np.stack(self._Zs, axis=1)
try:
mapping = np.stack(self._Zs, axis=1)
except np.AxisError:
# if dim==1, `fields` is prob. a raw field & not a 1-tuple or
# equivalent
if self._dim == 1:
self._Zs = [self._Zs]
mapping = np.stack(self._Zs, axis=1)
else:
raise
pos_l = []
for d in range(self._dim):
pos_l.append(
Expand Down

0 comments on commit ec9a16c

Please sign in to comment.