Skip to content

Commit

Permalink
Better concatenate
Browse files Browse the repository at this point in the history
  • Loading branch information
micheles committed Sep 21, 2023
1 parent 6fcbef8 commit a55786a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion openquake/hazardlib/contexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,10 @@ def split_by_occur(ctx):
out.append(ctx[~nan])
nonpoisson = ctx[nan]
for shp in set(np.probs_occur.shape[1] for np in nonpoisson):
# ctxs with the same shape of prob_occur are concatenated
p_array = [p for p in nonpoisson if p.probs_occur.shape[1] == shp]
out.append(numpy.concatenate(p_array).view(numpy.recarray))
arr = numpy.concatenate(p_array, p_array[0].dtype)
out.append(arr.view(numpy.recarray))
else:
out.append(ctx)
return out
Expand Down

0 comments on commit a55786a

Please sign in to comment.