-
Notifications
You must be signed in to change notification settings - Fork 18
1351 pymio interface for sde sir type models #1371
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
base: main
Are you sure you want to change the base?
Conversation
…interface-for-sde-sir-type-models
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1371 +/- ##
==========================================
- Coverage 97.28% 97.24% -0.05%
==========================================
Files 174 174
Lines 15153 15153
==========================================
- Hits 14742 14735 -7
- Misses 411 418 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
||
|
||
def run_sde_sir_simulation(): | ||
"""Runs the c++ SDE SIR model""" |
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.
"""Runs the c++ SDE SIR model""" | |
"""Runs SDE SIR model""" |
def run_sde_sir_simulation(): | ||
"""Runs the c++ SDE SIR model""" | ||
|
||
# Define population of age groups |
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 don't understand the comment. This is the total population, right? Does the SDE model even have age groups?
# Define population of age groups | ||
population = 10000 | ||
|
||
days = 5. # number of days to simulate |
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.
days = 5. # number of days to simulate | |
tmax = 5. # simulation time frame |
days = 5. # number of days to simulate | ||
dt = 0.1 | ||
|
||
# Initialize Parameters |
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.
# Initialize Parameters | |
# Initialize model |
# Initialize Parameters | ||
model = Model() | ||
|
||
# Compartment transition duration |
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.
# Compartment transition duration | |
# Mean time in Infected compartment |
|
||
def test_check_constraints_parameters(self): | ||
model = Model() | ||
# valid |
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.
This is not a very well-formulated comment
vals = result[i] | ||
self.assertEqual(len(vals), 3) | ||
# Non-negativity | ||
self.assertTrue(np.all(np.array(vals) >= -1e-10)) |
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.
Shouldn't >= 0 work here?
############################################################################# | ||
# Copyright (C) 2020-2025 MEmilio | ||
# | ||
# Authors: |
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.
Author missing
def setUp(self): | ||
# Initialize model similar to the sde_sirs_simple example | ||
self.population = 10000 | ||
self.days = 5.0 |
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.
self.days = 5.0 | |
self.tmax = 5.0 |
vals = result[i] | ||
self.assertEqual(len(vals), 3) | ||
# Non-negativity | ||
self.assertTrue(np.all(np.array(vals) >= -1e-8)) |
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.
Is there a reason you use e-8 here and e-10 for the SSIR example?
Changes and Information
Please briefly list the changes (main added features, changed items, or corrected bugs) made:
If need be, add additional information and what the reviewer should look out for in particular:
Merge Request - Guideline Checklist
Please check our git workflow. Use the draft feature if the Pull Request is not yet ready to review.
Checks by code author
Checks by code reviewer(s)
Closes #1351