nomenclature icon indicating copy to clipboard operation
nomenclature copied to clipboard

Common region completeness check

Open phackstock opened this issue 2 years ago • 6 comments

When writing tests for #99 I accidentally discovered a possible bug (or at the very least unexpected behavior) in the current implementation of region aggregation.

Issue outline

The bug occurs as follows:

Suppose we have a model mapping:

model: m_a
common_regions:
  - common_region_A:
    - region_A
    - region_B

If we now upload data that only contains region_A and run the aggregation, it will happily spit out an aggregated value for common_region_A. As region_B is missing from the input, however, the values for common_region_A will be identical to the ones for region_A.

Proposed fix

As we perform region aggregation we could check that for every common region we have data for all constituent regions. One open question would be what to do if we are missing a constituent region as in the example above, should we raise an error or write a warning to the log? My preference would be for error as the result described above is unexpected and could lead to wrong conclusions.

phackstock avatar Mar 07 '22 09:03 phackstock