-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fix YLL/Y:D/DALY and death #455
Conversation
Don't they do CI on these Ubuntu builder images? 😕
|
I don't really understand the codes for calculating standard deviation. |
Hi @jzhu20, this was done in a prior PR -- see lines 402-434. |
Any thoughts @alexdewar? |
Sorry for the slow reply! I'll take a look at this today |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've eyeballed the code and it looks like it's doing the right thing. I've made some comments, none of which are actually about this PR 🙃
That said, the calculate_population_statistics()
method is a bit overcomplicated (we have to suppress a clang-tidy
warning about this), so trying to keep track of everything that's going on made my head hurt. We should probably factor out some of the logic into separate functions at some point. Maybe we need a new issue for this?
if (!entity.is_active()) { | ||
if (!entity.is_alive() && entity.time_of_death() == current_time) { | ||
if (!person.is_active()) { | ||
if (!person.is_alive() && person.time_of_death() == current_time) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not relevant for this PR, but I feel like a has_died()
method would be clearer than an is_alive()
one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then you'd have is_alive
and has_died = !is_alive
functions?
Unless you mean like:
bool Person::has_just_died(unsigned int current_time) {
return !is_alive() && time_of_death() == current_time;
}
@@ -487,9 +502,6 @@ void AnalysisModule::initialise_output_channels(RuntimeContext &context) { | |||
channels_.emplace_back("incidence_" + disease.code.to_string()); | |||
} | |||
|
|||
channels_.emplace_back("disability_weight"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need disability_weight
anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One can just divide YLD by 100000 to get it if they still want. I understand YLD is the actually useful one.
if (series.size() > 0) { | ||
throw std::logic_error("This should be a new object!"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would make more sense to return a new DataSeries
object rather than modify an input argument.
But that's not something we need to do now.
Agree in principle, but I'm hesitant to invest any more time in this whilst knowing it will eventually be replaced by @TinyMarsh's work. Let's wait for the result of that before making any decisions. |
Fixes #442.
The loops for mean and std have been tidied up, and are now 'opt-in', so no unwanted surprises in other columns that don't opt in.
YLL/YLD/DALY are now correctly computed by dividing by active PLUS deceased population.
Everything that should be an integer, such as deaths, migrations, weight classifications, is now an integer. Update your scripts accordingly.