diff --git a/debian/changelog b/debian/changelog index d26a5aaf79c6..170fd092d927 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ * Upgraded Django version to version 3.2.21 with a security fix [Michele Simionato] + * In case of a well known IndexError in disaggregation calculations, solved in + newer versions of the engine, a helpful message is printed * Backported fix on sanity check for avg_losses and aggrisk * Backported fix to `avg_gmf` * Backported a fix to `oq reaggregate` diff --git a/openquake/calculators/disaggregation.py b/openquake/calculators/disaggregation.py index c8ad55a669a2..c658786fde35 100644 --- a/openquake/calculators/disaggregation.py +++ b/openquake/calculators/disaggregation.py @@ -59,6 +59,8 @@ def _collapse_res(rdic): def _matrix(matrices, num_trts, num_mag_bins): # convert a dict trti, magi -> matrix into a single matrix trti, magi = next(iter(matrices)) + if trti >= num_trts: + raise IndexError('please upgrade to engine >= 3.17') mat = numpy.zeros((num_trts, num_mag_bins) + matrices[trti, magi].shape) for trti, magi in matrices: mat[trti, magi] = matrices[trti, magi]