kyu_6.disease_spread package

Submodules

kyu_6.disease_spread.epidemic module

kyu_6.disease_spread.epidemic.epidemic(tm: int, n: int, s0: int, i0: int, b: float, a: float) → int[source]

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)).

Parameters
  • 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

class kyu_6.disease_spread.epidemic_test_data.EpidemicTestData(**kwargs)[source]

Bases: object

Epidemic 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

class kyu_6.disease_spread.test_epidemic.EpidemicTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_epidemic()[source]

Module contents