Update the correct column if HIV HSI event didn't run#1835
Merged
Conversation
- Don't use `property`, which is a Python built-in keyword
tbhallett
approved these changes
Feb 26, 2026
Collaborator
|
Wow, did not expect that to happen. Thanks for finding and fixing. |
Collaborator
|
Thanks Asif for spotting and fixing that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This was a nasty bug to track down!
While profiling, I noticed the population dataframe had grown from 494 to 567 columns during the simulation. New columns were being added as the simulation ran. The column names were
property, which is a built-in Python keyword. No hint as to where it was coming from. Each of these columns contained a singleFalsefor one person, all the restnan. After a lot of laborious stepping through code, traced issue to changes introduced in #1616propertyis a Python keyword (most commonly used as the@propertydecorator). The variablepropertyset inapply()is not included innever_ran(). As a result, each timenever_ran()is called, a new column is created.I've made following changes:
prep_columnto avoid shadowing the built-inpropertyapply()andnever_ran()