kyu_6.disease_spread package
Submodules
kyu_6.disease_spread.epidemic module
Solution for -> Disease Spread.
Created by Egor Kostan. GitHub: https://github.com/ikostan
- kyu_6.disease_spread.epidemic.epidemic(**kwargs) int[source]
Epidemic function.
We want to study the spread of the disease through the population of this school. The total population may be divided into three: - the infecteds (i) - those who have recovered (r), and those who are still susceptible (s) to get the disease
We will study the disease on a period of tm days.
The interval [0, tm] will be divided in n small intervals of length dt = tm/n. Initial conditions here could be : S0 = 999, I0 = 1, R0 = 0 Whatever S0 and I0, R0 (number of recovered at time 0) is always 0.
The function epidemic will return the maximum number of infecteds as an integer (truncate to integer the result of max(I)).
tm: the disease on a period of days n: small intervals of length s0: those who are still susceptible to get the disease (Initial conditions) i0: the infected (Initial conditions) b: representing a number of contacts which can spread the disease a: fraction of the infected that will recover
- Returns:
the maximum number of infected as an integer (truncate to integer the result of max(I)).
kyu_6.disease_spread.epidemic_test_data module
Epidemic Test Data Class.
Created by Egor Kostan. GitHub: https://github.com/ikostan
- class kyu_6.disease_spread.epidemic_test_data.EpidemicTestData(**kwargs)[source]
Bases:
objectEpidemic Test Data Class.
- property a
Returns a value.
- Returns:
- property b
Returns b value.
- Returns:
- property expected
Returns expected value.
- Returns:
- property i0
Returns i0 value.
- Returns:
- property n
Returns n value.
- Returns:
- property s0
Returns s0 value.
- Returns:
- property tm
Returns tm value.
- Returns:
kyu_6.disease_spread.test_epidemic module
Test for -> Disease Spread.
Created by Egor Kostan. GitHub: https://github.com/ikostan
- class kyu_6.disease_spread.test_epidemic.EpidemicTestCase(methodName='runTest')[source]
Bases:
TestCaseTesting for solution Disease Spread.
- _classSetupFailed = False
- _class_cleanups = []
- test_epidemic = None
- test_epidemic_0(**kw)
Testing epidemic function [with etd=tm: 18, n: 432, s0: 1004, i0: 1,… 0.00209, a: 0.51, expected: 420].
- Returns:
- test_epidemic_1(**kw)
Testing epidemic function [with etd=tm: 12, n: 288, s0: 1007, i0: 2,… 0.00206, a: 0.45, expected: 461].
- Returns:
- test_epidemic_2(**kw)
Testing epidemic function [with etd=tm: 13, n: 312, s0: 999, i0: 1, … 0.00221, a: 0.55, expected: 409].
- Returns:
- test_epidemic_3(**kw)
Testing epidemic function [with etd=tm: 24, n: 576, s0: 1005, i0: 1,… 0.00216, a: 0.45, expected: 474].
- Returns:
- test_epidemic_4(**kw)
Testing epidemic function [with etd=tm: 24, n: 576, s0: 982, i0: 1, … 0.00214, a: 0.44, expected: 460].
- Returns:
- test_epidemic_5(**kw)
Testing epidemic function [with etd=tm: 20, n: 480, s0: 1000, i0: 1,… 0.00199, a: 0.53, expected: 386].
- Returns:
- test_epidemic_6(**kw)
Testing epidemic function [with etd=tm: 28, n: 672, s0: 980, i0: 1, … 0.00198, a: 0.44, expected: 433].
- Returns:
- test_epidemic_7(**kw)
Testing epidemic function [with etd=tm: 14, n: 336, s0: 996, i0: 2, … 0.00206, a: 0.41, expected: 483].
- Returns:
- test_epidemic_8(**kw)
Testing epidemic function [with etd=tm: 13, n: 312, s0: 993, i0: 2, …: 0.0021, a: 0.51, expected: 414].
- Returns:
- test_epidemic_9(**kw)
Testing epidemic function [with etd=tm: 28, n: 672, s0: 999, i0: 1, … 0.00197, a: 0.55, expected: 368].
- Returns:
Module contents
Disease Spread.