Skip to content

Commit

Permalink
Fixed sort breaking the oq-risk-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
micheles committed Sep 26, 2024
1 parent dcde3da commit bad3643
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openquake/hazardlib/contexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -2015,5 +2015,5 @@ def read_ctx_by_grp(dstore):
if par != 'sids':
ctx[par] = sitecol[par][ctx.sids]
grp_ids = numpy.unique(ctx.grp_id)
ctx.sort(order='mag') # NB: the sort is crucial for performance
ctx = ctx[numpy.argsort(ctx.mag)] # NB: crucial for performance
return {grp_id: ctx[ctx.grp_id == grp_id] for grp_id in grp_ids}

0 comments on commit bad3643

Please sign in to comment.