Repository: starsimhub/starsim (language: python)

Issue:
Apis
Lots of changes, including:
- Code reorganization
- Networks moved from `People` to `Sim`
- Various classes renamed (e.g. `FusedArray` to `UIDArray` )
- Better type checking
- Added `MultiSim` (not yet functional due to https://github.com/amath-idm/starsim/issues/257)
- Added cholera, measles, and Ebola (ported from @RomeshA and team's GAVI work)
- Added vaccination
- most `pars` entries can now be specified as scalars, which will be converted to distributions according to keys in `par_dists`



Discussion / hints:

Fix patch:
diff --git a/starsim/networks/networks.py b/starsim/networks/networks.py
index cff9177d..c3183630 100644
--- a/starsim/networks/networks.py
+++ b/starsim/networks/networks.py
@@ -10,9 +10,7 @@
 import scipy.optimize as spo
 import scipy.stats as sps
 import scipy.spatial as spsp
-import pandas as pd
 from scipy.stats._distn_infrastructure import rv_frozen
-import scipy.stats as sps
 
 
 # Specify all externally visible functions this file defines
diff --git a/starsim/version.py b/starsim/version.py
index 81fe3adb..aabaf213 100644
--- a/starsim/version.py
+++ b/starsim/version.py
@@ -4,6 +4,6 @@
 
 __all__ = ['__version__', '__versiondate__', '__license__']
 
-__version__ = '0.1.8'
-__versiondate__ = '2024-01-30'
-__license__ = f'STIsim {__version__} ({__versiondate__}) — © 2024 by IDM'
+__version__ = '0.2.0'
+__versiondate__ = '2024-02-12'
+__license__ = f'Starsim {__version__} ({__versiondate__}) — © 2023-2024 by IDM'


Test patch:
diff --git a/tests/test_simple.py b/tests/test_simple.py
index 304c7bc3..f3d254bc 100644
--- a/tests/test_simple.py
+++ b/tests/test_simple.py
@@ -3,36 +3,55 @@
 """
 
 # %% Imports and settings
-import numpy as np
 import starsim as ss
-import pandas as pd
-import matplotlib.pyplot as plt
-import scipy.stats as sps
+
+n_agents = 2_000
+
+
+def test_default():
+    """ Create, run, and plot a sim with default settings """
+    sim = ss.Sim(n_agents=n_agents).run()
+    sim.plot()
+    return sim
 
 
 def test_simple():
+    """ Create, run, and plot a sim with specified parameters """
 
     pars = dict(
-            n_agents = 10_000,
+        n_agents = n_agents,
         networks = dict(
-            name= 'random',
+            name = 'random',
             n_contacts = 4,
         ),
         diseases = dict(
             name = 'sir',
             dur_inf = 10,
-            beta=0.1
+            beta = 0.1,
         )
     )
 
     sim = ss.Sim(pars)
     sim.run()
-    # sim.plot_states()
-    return  sim
+    sim.plot()
+    return sim
+
+
+def test_components():
+    """ Create, run, and plot a sim by assembling components """
+    people = ss.People(n_agents=n_agents)
+    network = ss.networks.random(n_contacts=4)
+    sir = ss.SIR(dur_inf=10, beta=0.1)
+    sim = ss.Sim(diseases=sir, people=people, networks=network)
+    sim.run()
+    sim.plot()
+    return sim
 
 
 if __name__ == '__main__':
 
-    sim = test_simple()
+    sim1 = test_default()
+    sim2 = test_simple()
+    sim3 = test_components()