Skip to content

Commit

Permalink
update seeding- and initial_conditions- related tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fang19911030 committed Apr 12, 2024
1 parent 7710987 commit 1d07afc
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 747 deletions.
2 changes: 1 addition & 1 deletion flepimop/gempyor_pkg/src/gempyor/initial_conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from numba.typed import Dict
import confuse
import logging
from simulation_component import SimulationComponent
from .simulation_component import SimulationComponent
from . import utils
from .utils import read_df

Expand Down
2 changes: 1 addition & 1 deletion flepimop/gempyor_pkg/src/gempyor/seeding.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pandas as pd
import confuse
import logging
from simulation_component import SimulationComponent
from .simulation_component import SimulationComponent
from . import utils
import numba as nb

Expand Down
634 changes: 0 additions & 634 deletions flepimop/gempyor_pkg/src/gempyor/seeding_ic.py

This file was deleted.

4 changes: 4 additions & 0 deletions flepimop/gempyor_pkg/src/gempyor/simulation_component.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import confuse
import numpy as np


class SimulationComponent:
def __init__(self, config: confuse.ConfigView):
raise NotImplementedError("This method should be overridden in subclasses.")
Expand Down
4 changes: 1 addition & 3 deletions flepimop/gempyor_pkg/tests/seir/test_ic.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ 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 = initial_conditions.InitialConditionsFactory(config=s.initial_conditions_config)
assert sic.initial_conditions_config == s.initial_conditions_config
sic.get_from_config(sim_id=100, setup=s)

initial_conditions = sic.get_from_config(sim_id=100, setup=s)
print(initial_conditions)

def test_IC_IC_notImplemented_fail(self):
with pytest.raises(NotImplementedError, match=r".*unknown.*initial.*conditions.*"):
Expand Down
4 changes: 2 additions & 2 deletions flepimop/gempyor_pkg/tests/seir/test_seeding.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ def test_Seeding_draw_success(self):
sic = seeding.SeedingFactory(config=s.seeding_config)
s.seeding_config["method"] = "NoSeeding"

seeding = sic.get_from_config(sim_id=100, setup=s)
print(seeding)
seeding_result = sic.get_from_config(sim_id=100, setup=s)
print(seeding_result)
106 changes: 0 additions & 106 deletions flepimop/gempyor_pkg/tests/seir/test_seeding_ic.py

This file was deleted.

0 comments on commit 1d07afc

Please sign in to comment.