Changes that might help with intermittent Stochastic Noise failure - #2346
Conversation
94c38d9 to
3a85788
Compare
maxwhitemet
left a comment
There was a problem hiding this comment.
Thanks Gavin. Happy with the changes you have made.
I have made some PR-hosted changes to address some sources of np.nan.
mo-jbeaver
left a comment
There was a problem hiding this comment.
All the tests ran successfully. I've commented on a few things, but potentially a second review of the code maybe beneficial.
… the function nan-resistant
a94dbee to
26873d0
Compare
maxwhitemet
left a comment
There was a problem hiding this comment.
Thanks @mo-jbeaver. I have implemented the suggested changes
mo-jbeaver
left a comment
There was a problem hiding this comment.
Happy with the change changes made and all tests ran successfully.
gavinevans
left a comment
There was a problem hiding this comment.
Thanks @maxwhitemet 👍
I've added a couple of minor suggestions.
| if not np.all(np.isfinite(result_db)): | ||
| # Repeat scaling from _to_dB to get a sub-threshold dB value for | ||
| # non-finite outputs. | ||
| sub_threshold_dB = 10.0 * np.log10(self.db_threshold) - 5 |
There was a problem hiding this comment.
Ideally, it might be good to do something like set self.arbitrary_offset = 5 in the __init__ method, and then use self.arbitrary_offset instead of 5 on this line, and also in the _to_dB method. Perhaps that would make 5 seem less like a magic number.
maxwhitemet
left a comment
There was a problem hiding this comment.
Thanks @gavinevans. I have implemented your feedback.
| if not np.all(np.isfinite(result_db)): | ||
| # Repeat scaling from _to_dB to get a sub-threshold dB value for | ||
| # non-finite outputs. | ||
| sub_threshold_dB = 10.0 * np.log10(self.db_threshold) - 5 |
maxwhitemet
left a comment
There was a problem hiding this comment.
Happy with the changes made. Approved 👍
* master: Changed implementation from clipping to masking + added Unit Tests (#2366) Adding kwarg as CLI argument & updating acceptance tests. (#2377) Refactor Pollen index for daily and hourly to single plugin (#2372) EPPT-3259 fix fsi duplicate metadata (#2370) Changes to Pollen classes for refactoring cube long names and units of concentration (#2368) Eppt 3223 lifted index investigate why the values are wrong (#2365) Cast to the original dtype of the points in `expand_bounds` (#2367) Changes that might help with intermittent Stochastic Noise failure (#2346)
* master: MOBT-1148 Add subperiod-selector tool (#2373) Revert "change ApplyDecisionTree categorical cube dtype from int32 to int16 (…" (#2382) change ApplyDecisionTree categorical cube dtype from int32 to int16 (#2371) Changed implementation from clipping to masking + added Unit Tests (#2366) Adding kwarg as CLI argument & updating acceptance tests. (#2377) Refactor Pollen index for daily and hourly to single plugin (#2372) EPPT-3259 fix fsi duplicate metadata (#2370) Changes to Pollen classes for refactoring cube long names and units of concentration (#2368) Eppt 3223 lifted index investigate why the values are wrong (#2365) Cast to the original dtype of the points in `expand_bounds` (#2367) Changes that might help with intermittent Stochastic Noise failure (#2346) # Conflicts: # improver/categorical/subperiod_selector.py
Addresses https://github.com/metoppv/mo-blue-team/issues/1114
Description
This PR makes a few changes to try to help with the intermittent Stochastic Noise failures. Although as these failures are intermittent, and we haven't replicated these failures locally, these changes are speculative.
Testing: