def test_to_spc_import_only(self): od = OD([('import', IMPORT)]) assert od_to_spc(od, 1) == dedent('''\ import: { from: "model/diffusion_2D4.andl" }''')
def test_to_spc_simulation_with_interval(self): simulation = OD([('type', 'stochastic'), ('interval', INTERVAL)]) od = OD(configuration=OD(simulation=simulation)) assert od_to_spc(od, 1) == dedent('''\ configuration: { simulation: { type: stochastic interval: 0:0.1:10 } }''')
def test_to_spc_simulation_with_no_exports_or_interval(self): simulation = OD([('name', 'Diffusion'), ('type', 'stochastic'), ('solver', 'direct'), ('threads', 0), ('runs', 100)]) od = OD(configuration=OD(simulation=simulation)) assert od_to_spc(od, 1) == dedent('''\ configuration: { simulation: { name: "Diffusion" type: stochastic solver: direct threads: 0 runs: 100 } }''')
def test_to_spc_simulation_with_exports(self): simulation = OD([('type', 'stochastic'), ('export', [EXPORT1, EXPORT2])]) od = OD(configuration=OD(simulation=simulation)) assert od_to_spc(od, 1) == dedent('''\ configuration: { simulation: { type: stochastic export: { places: [] to: "output/places.csv" } export: { transitions: [] to: "output/transitions.csv" } } }''')
def test_to_spc_integration(self): print('---') print(od_to_spc(INTEGRATION, 1)) print('---') assert od_to_spc(INTEGRATION, 1) == INTEGRATION_SPC