Skip to content

Commit

Permalink
sunset the usage of seeding_ic
Browse files Browse the repository at this point in the history
  • Loading branch information
fang19911030 committed Mar 28, 2024
1 parent 281407b commit 7710987
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions flepimop/gempyor_pkg/src/gempyor/dev/dev_seir.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
out_prefix=prefix,
)

seeding_data = modinf.seedingAndIC.draw_seeding(sim_id=100, setup=modinf)
initial_conditions = modinf.seedingAndIC.draw_ic(sim_id=100, setup=modinf)
seeding_data = modinf.seeding.get_from_config(sim_id=100, setup=modinf)
initial_conditions = modinf.initial_conditions.get_from_config(sim_id=100, setup=modinf)

mobility_subpop_indices = modinf.mobility.indices
mobility_data_indices = modinf.mobility.indptr
Expand Down
6 changes: 3 additions & 3 deletions flepimop/gempyor_pkg/src/gempyor/model_info.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pandas as pd
import datetime, os, logging, pathlib
from . import seeding_ic, subpopulation_structure, parameters, compartments, file_paths
from . import seeding, subpopulation_structure, parameters, compartments, file_paths, initial_conditions
from .utils import read_df, write_df

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -115,8 +115,8 @@ def __init__(
tf=self.tf,
subpop_names=self.subpop_struct.subpop_names,
)
self.seeding = seeding_ic.SeedingFactory(config = self.seeding_config)
self.initial_conditions = seeding_ic.InitialConditionsFactory(config = self.initial_conditions_config)
self.seeding = seeding.SeedingFactory(config = self.seeding_config)
self.initial_conditions = initial_conditions.InitialConditionsFactory(config = self.initial_conditions_config)
# really ugly references to the config globally here.
if config["compartments"].exists() and self.seir_config is not None:
self.compartments = compartments.Compartments(
Expand Down
8 changes: 4 additions & 4 deletions flepimop/gempyor_pkg/tests/seir/test_ic.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
import pytest
from gempyor import seeding_ic, model_info
from gempyor import seeding, model_info, initial_conditions
from gempyor.utils import config

DATA_DIR = os.path.dirname(__file__) + "/data"
Expand All @@ -21,7 +21,7 @@ def test_IC_success(self):
outcome_modifiers_scenario=None,
write_csv=False,
)
sic = seeding_ic.InitialConditionsFactory(config=s.initial_conditions_config)
sic = initial_conditions.InitialConditionsFactory(config=s.initial_conditions_config)
assert sic.initial_conditions_config == s.initial_conditions_config

def test_IC_allow_missing_node_compartments_success(self):
Expand All @@ -40,7 +40,7 @@ def test_IC_allow_missing_node_compartments_success(self):

s.initial_conditions_config["allow_missing_nodes"] = True
s.initial_conditions_config["allow_missing_compartments"] = True
sic = seeding_ic.InitialConditionsFactory(config=s.initial_conditions_config)
sic = initial_conditions.InitialConditionsFactory(config=s.initial_conditions_config)
assert sic.initial_conditions_config == s.initial_conditions_config

initial_conditions = sic.get_from_config(sim_id=100, setup=s)
Expand All @@ -61,6 +61,6 @@ def test_IC_IC_notImplemented_fail(self):
write_csv=False,
)
s.initial_conditions_config["method"] = "unknown"
sic = seeding_ic.InitialConditionsFactory(config=s.initial_conditions_config)
sic = initial_conditions.InitialConditionsFactory(config=s.initial_conditions_config)

sic.get_from_config(sim_id=100, setup=s)
6 changes: 3 additions & 3 deletions flepimop/gempyor_pkg/tests/seir/test_seeding.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
from gempyor import seeding_ic, model_info
from gempyor import seeding, model_info
from gempyor.utils import config

DATA_DIR = os.path.dirname(__file__) + "/data"
Expand All @@ -20,7 +20,7 @@ def test_Seeding_success(self):
outcome_modifiers_scenario=None,
write_csv=False,
)
sic = seeding_ic.SeedingFactory(config=s.seeding_config)
sic = seeding.SeedingFactory(config=s.seeding_config)
assert sic.seeding_config == s.seeding_config

def test_Seeding_draw_success(self):
Expand All @@ -36,7 +36,7 @@ def test_Seeding_draw_success(self):
outcome_modifiers_scenario=None,
write_csv=False,
)
sic = seeding_ic.SeedingFactory(config=s.seeding_config)
sic = seeding.SeedingFactory(config=s.seeding_config)
s.seeding_config["method"] = "NoSeeding"

seeding = sic.get_from_config(sim_id=100, setup=s)
Expand Down

0 comments on commit 7710987

Please sign in to comment.