Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only call truncate if truncation is modelled #304

Merged
merged 2 commits into from
Aug 31, 2022
Merged

Conversation

sbfnk
Copy link
Contributor

@sbfnk sbfnk commented Jul 21, 2022

This simplifies the call to truncate in estimate_infections, only calling it when truncation is actually required. This seems more intuitive as the call to truncate was previously required even if no truncation was applied, but only to create an obs_report variable not containing the forecasts. This now follows the same logic as e.g. only applying scaling if obs_scale is set to 1, such that the decision of whether truncation is applied is now happening outside the truncate function, which now always truncates.

As a (positive, in my opinion) side effect this does away with having to pass vectors to the truncate function requiring declarations of vectors of size 1 in estimate_truncation.

@sbfnk sbfnk requested a review from seabbs July 21, 2022 10:58
Copy link
Contributor

@seabbs seabbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. The downside is more if/else shenanigans in the main model code potentially making it harder to track what is happening. Note should really have a news note or other indication of code changes.

@seabbs seabbs merged commit 987b317 into master Aug 31, 2022
@seabbs seabbs deleted the clearer-truncation branch August 31, 2022 09:35
sbfnk added a commit that referenced this pull request May 3, 2024
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