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

Adding dynamic interventions to simulate #106

Conversation

Tom-Szendrey
Copy link
Contributor

@Tom-Szendrey Tom-Szendrey commented Jul 23, 2024

Description

Adding dynamic intervention converter and utilizing this for the simulate call.

Failed

When setting two identical dynamic parameters we will fail as the key is a callable that is being redefined every loop.
With the function call evaluating to the same thing but being at a different location in memory we can send what is essentially duplicates

{... 
'dynamic_parameter_interventions': 
defaultdict(<class 'dict'>, {
  <function make_var_threshold.<locals>.var_threshold at 0xffff985fe170>: {'β': tensor(1.)},
  <function make_var_threshold.<locals>.var_threshold at 0xffff4c5e4280>: {'β': tensor(1.)}}
 ... }
image

Testing

image image

@Tom-Szendrey Tom-Szendrey linked an issue Jul 23, 2024 that may be closed by this pull request
@Tom-Szendrey Tom-Szendrey marked this pull request as ready for review July 23, 2024 15:29
Copy link
Member

@YohannParis YohannParis left a comment

Choose a reason for hiding this comment

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

LGTM


return var_threshold


Copy link
Member

Choose a reason for hiding this comment

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

A function comment like for convert_static_interventions would be nice.

@Tom-Szendrey Tom-Szendrey merged commit 1cb85a1 into main Jul 23, 2024
2 checks passed
@Tom-Szendrey Tom-Szendrey deleted the TS/105-pyciemss-service-dynamic-interventions-for-simulatecalibrate branch August 15, 2024 13:09
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.

pyciemss-service dynamic interventions for simulate/calibrate
2 participants