Skip to content

Conversation

@bolliger32
Copy link
Member

@bolliger32 bolliger32 commented Jan 5, 2025

Not sure when it happened, but presumably due to some xarray updates, we now sometimes return missing values when pulling the surge impacts lookup for the no-climate-change scenario b/c we are at the lower bound of LSLR and sometimes due to some floating point issues are slightly below the lower bound. However, we do have real cases where interpolation targets are meaningfully below the lower bound of the matrix, in which case we want to assign 0s (which we are doing incorrectly at the moment). This PR updates the surge lookup creation to bump the lower and upper bounds of lslr by 2*epsilon so that we don't erroneously return 0s at the bounds of lslr lookup. It also improves our ability to catch other cases of unintentional surge lookup table interpolation targets falling outside the bounds of the table.

I also realized that the dask.distributed.wait function was not catching errored futures but instead was just releasing when all futures were either finished or errored. Not sure if this was always the case or a change in functionality of recent Dask versions, but now we use client.gather for futures that return None (so they are negligible in local memory impact) instead of wait

get_refA now also handles the potential edge case where it is run on a single segment, which previously would throw an error

@bolliger32 bolliger32 changed the title Draft: Better handle edges of surge lookup matrix Better handle edges of surge lookup matrix Jan 7, 2025
@bolliger32 bolliger32 merged commit b9b6349 into main Jan 7, 2025
1 check passed
@bolliger32 bolliger32 deleted the bugfix/surge-edgecase branch January 7, 2025 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants