Skip to content

BUG: Blending fails with 0 weight for passed data #2054

Open

Description

@SamGriffithsMO

When calling improver weighted-blending via the CLI, it is possible to pass multiple cubes that all have weights of 0 (as the graph has no knowledge of the blending weights). e.g. tempmax12h, for a 24 hour leadtime being passed engluk and ecukx only.

Currently this results in blending.weights.WeightsUtilities raising ValueError("Sum of weights must be > 0.0"). It is desirable for this to be a warning so that suites can continue to cycle.

Acceptance criteria:

  1. No change when presented with a full data set
  2. If there is no weight to any input, raise a warning and return None

Activity

  1. cpelley commented on Mar 18, 2025

    @cpelley
    Contributor

    Do we know if plugins that typically run after the blend support being passed None (currently that is).

    In future, it could be that a plugin determines whether the blend actually occurs at all, based not only on the presence of a new field to blend but perhaps also whether it has a non-zero weight to one or more of these fields:

    ---
    title: blend
    ---
    graph TD
    
    subgraph pressure_at_mean_sea_level[pressure_at_mean_sea_level]
    0(["0<br>operation: blend_trigger"])
    click 0 callback "leadtime: [0, 3600, 7200, 10800, 14400, 18000, 21600, 25200, 28800, 32400, 36000, 39600, 43200, 46800, 50400, 54000, 57600, 61200, 64800, 68400, 72000, 75600, 79200, 82800, 86400, 90000, 93600, 97200, 100800, 104400, 108000, 111600, 115200, 118800, 122400, 126000, 129600, 133200, 136800, 140400, 144000, 147600, 151200, 154800, 158400, 162000, 165600, 169200, 172800, 176400, 180000, 183600, 187200, 190800, 194400, 198000, 201600, 205200, 208800, 212400, 216000, 219600, 223200, 226800, 230400, 234000, 237600, 241200, 244800, 248400, 252000, 255600, 259200, 262800, 266400, 270000, 273600, 277200, 280800, 284400, 288000, 291600, 295200, 298800, 302400, 306000, 309600, 313200, 316800, 320400, 324000, 327600, 331200, 334800, 338400, 342000, 345600, 349200, 352800, 356400, 360000, 363600, 367200, 370800, 374400, 378000, 381600, 385200, 388800, 392400, 396000, 399600, 403200, 406800, 410400, 414000, 417600, 421200, 424800, 428400, 432000, 435600, 439200, 442800, 446400, 450000, 453600]<br>cycle_offset: [None]"
    style pressure_at_mean_sea_level_blend fill:#D4A76A
    subgraph pressure_at_mean_sea_level_blend[blend]
    1(["1<br>step: blendgrids"])
    click 1 callback "leadtime: [0, 3600, 7200, 10800, 14400, 18000, 21600, 25200, 28800, 32400, 36000, 39600, 43200, 46800, 50400, 54000, 57600, 61200, 64800, 68400, 72000, 75600, 79200, 82800, 86400, 90000, 93600, 97200, 100800, 104400, 108000, 111600, 115200, 118800, 122400, 126000, 129600, 133200, 136800, 140400, 144000, 147600, 151200, 154800, 158400, 162000, 165600, 169200, 172800, 176400, 180000, 183600, 187200, 190800, 194400, 198000, 201600, 205200, 208800, 212400, 216000, 219600, 223200, 226800, 230400, 234000, 237600, 241200, 244800, 248400, 252000, 255600, 259200, 262800, 266400, 270000, 273600, 277200, 280800, 284400, 288000, 291600, 295200, 298800, 302400, 306000, 309600, 313200, 316800, 320400, 324000, 327600, 331200, 334800, 338400, 342000, 345600, 349200, 352800, 356400, 360000, 363600, 367200, 370800, 374400, 378000, 381600, 385200, 388800, 392400, 396000, 399600, 403200, 406800, 410400, 414000, 417600, 421200, 424800, 428400, 432000, 435600, 439200, 442800, 446400, 450000, 453600]<br>cycle_offset: [None]"
    2(["2<br>operation: save"])
    click 2 callback "leadtime: [0, 3600, 7200, 10800, 14400, 18000, 21600, 25200, 28800, 32400, 36000, 39600, 43200, 46800, 50400, 54000, 57600, 61200, 64800, 68400, 72000, 75600, 79200, 82800, 86400, 90000, 93600, 97200, 100800, 104400, 108000, 111600, 115200, 118800, 122400, 126000, 129600, 133200, 136800, 140400, 144000, 147600, 151200, 154800, 158400, 162000, 165600, 169200, 172800, 176400, 180000, 183600, 187200, 190800, 194400, 198000, 201600, 205200, 208800, 212400, 216000, 219600, 223200, 226800, 230400, 234000, 237600, 241200, 244800, 248400, 252000, 255600, 259200, 262800, 266400, 270000, 273600, 277200, 280800, 284400, 288000, 291600, 295200, 298800, 302400, 306000, 309600, 313200, 316800, 320400, 324000, 327600, 331200, 334800, 338400, 342000, 345600, 349200, 352800, 356400, 360000, 363600, 367200, 370800, 374400, 378000, 381600, 385200, 388800, 392400, 396000, 399600, 403200, 406800, 410400, 414000, 417600, 421200, 424800, 428400, 432000, 435600, 439200, 442800, 446400, 450000, 453600]<br>cycle_offset: [None]"
    end
    style pressure_at_mean_sea_level_enukx fill:#D4A76A
    subgraph pressure_at_mean_sea_level_enukx[enukx]
    3(["3<br>operation: input"])
    click 3 callback "leadtime: [3600, 7200, 10800, 14400, 18000, 21600, 25200, 28800, 32400, 36000, 39600, 43200, 46800, 50400, 54000, 57600, 61200, 64800, 68400, 72000, 75600, 79200, 82800, 86400, 90000, 93600, 97200, 100800, 104400, 108000, 111600, 115200, 118800, 122400, 126000, 129600, 133200, 136800, 140400, 144000, 147600, 151200, 154800, 158400, 162000, 165600, 169200, 172800, 176400, 180000, 183600, 187200, 190800, 194400, 198000, 201600, 205200, 208800, 212400, 216000, 219600, 223200, 226800, 230400, 234000, 237600, 241200, 244800, 248400, 252000, 255600, 259200, 262800, 266400, 270000, 273600, 277200, 280800, 284400, 288000, 291600, 295200, 298800, 302400, 306000, 309600, 313200, 316800, 320400, 324000, 327600, 331200, 334800, 338400, 342000, 345600, 349200, 352800, 356400, 360000, 363600, 367200, 370800, 374400, 378000, 381600, 385200, 388800, 392400, 396000, 399600, 403200, 406800, 410400, 414000, 417600, 421200, 424800, 428400, 432000, 435600, 439200, 442800, 446400, 450000, 453600]<br>cycle_offset: [None]"
    4(["4<br>operation: load"])
    click 4 callback "leadtime: [3600, 7200, 10800, 14400, 18000, 21600, 25200, 28800, 32400, 36000, 39600, 43200, 46800, 50400, 54000, 57600, 61200, 64800, 68400, 72000, 75600, 79200, 82800, 86400, 90000, 93600, 97200, 100800, 104400, 108000, 111600, 115200, 118800, 122400, 126000, 129600, 133200, 136800, 140400, 144000, 147600, 151200, 154800, 158400, 162000, 165600, 169200, 172800, 176400, 180000, 183600, 187200, 190800, 194400, 198000, 201600, 205200, 208800, 212400, 216000, 219600, 223200, 226800, 230400, 234000, 237600, 241200, 244800, 248400, 252000, 255600, 259200, 262800, 266400, 270000, 273600, 277200, 280800, 284400, 288000, 291600, 295200, 298800, 302400, 306000, 309600, 313200, 316800, 320400, 324000, 327600, 331200, 334800, 338400, 342000, 345600, 349200, 352800, 356400, 360000, 363600, 367200, 370800, 374400, 378000, 381600, 385200, 388800, 392400, 396000, 399600, 403200, 406800, 410400, 414000, 417600, 421200, 424800, 428400, 432000, 435600, 439200, 442800, 446400, 450000, 453600]<br>cycle_offset: [None]"
    end
    style pressure_at_mean_sea_level_ukvx fill:#D4A76A
    subgraph pressure_at_mean_sea_level_ukvx[ukvx]
    5(["5<br>operation: input"])
    click 5 callback "leadtime: [0, 3600, 7200, 10800, 14400, 18000, 21600, 25200, 28800, 32400, 36000, 39600, 43200]<br>cycle_offset: [None]"
    6(["6<br>operation: load"])
    click 6 callback "leadtime: [0, 3600, 7200, 10800, 14400, 18000, 21600, 25200, 28800, 32400, 36000, 39600, 43200]<br>cycle_offset: [None]"
    end
    end
    3 --> 0
    5 --> 0
    4 --> 1
    6 --> 1
    1 --> 2
    3 --> 4
    0 --> 4
    0 --> 6
    5 --> 6
    
    Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions