Update Labour to get specific properties when getting person#1829
Open
Update Labour to get specific properties when getting person#1829
Conversation
tbhallett
approved these changes
Feb 26, 2026
Collaborator
tbhallett
left a comment
There was a problem hiding this comment.
This makes good sense to me.
- the decorator allows us to list none or more properties needed to evaluate the function - does not change the logic inside the function, but is a bit of metadata that can be used by callers
Collaborator
Author
|
Trying a different approach to speed this up further. This is has reduced runtime of A decorator The labour module uses this metadata to grab only those specified properties from the population dataframe. Sometimes the required modules are not available and we have to remove their properties from the list. Sorry, @tbhallett @joehcollins, do you mind looking at this again. |
… then new simulations in the same process may fail.
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.
Profiling finds that repeated
df.loc[[person_id]], where all properties are retrieved, is a bottleneck in the Labour module. This PR updates the module to only retrieve those properties necessary.Joe - although each labour linear model only uses a few of these properties, grabbing everything necessary for all of them is an easy change for now.
I'm running profiling again to see if further improvements can be made.