Skip to content

Commit 45632ed

Browse files
committed
set chamber loss function params in test_loss_rate
1 parent 4aba622 commit 45632ed

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

tests/test_scenario.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import pytest
1111
import numpy as np
1212
import PyPartMC as ppmc
13+
from PyPartMC import si
1314

1415
from .test_gas_data import GAS_DATA_CTOR_ARG_MINIMAL
1516
from .test_aero_data import AERO_DATA_CTOR_ARG_MINIMAL
@@ -121,20 +122,26 @@ def test_str():
121122
assert json_actual == SCENARIO_CTOR_ARG_MINIMAL
122123

123124
@staticmethod
124-
@pytest.mark.parametrize("loss_function_param", (
125-
'invalid',
126-
'none',
127-
'constant',
128-
'volume',
129-
'drydep',
130-
'chamber'))
131-
def test_loss_rate(loss_function_param:str):
125+
@pytest.mark.parametrize("loss_function_params", (
126+
{'loss_function': 'none'},
127+
{'loss_function': 'constant'},
128+
{'loss_function': 'volume'},
129+
{'loss_function': 'drydep'},
130+
{
131+
'loss_function': 'chamber',
132+
'chamber_vol': 84.3 * si.m**3,
133+
'area_diffuse': 103 * si.m**2,
134+
'area_sedi': 12.6 * si.m**2,
135+
'prefactor_BL': 0.005 * si.m,
136+
'exponent_BL': 0.274
137+
}
138+
))
139+
def test_loss_rate(loss_function_params:str):
132140
# arrange
133141
aero_data = ppmc.AeroData(AERO_DATA_CTOR_ARG_MINIMAL)
134142
env_state = ppmc.EnvState(ENV_STATE_CTOR_ARG_MINIMAL)
135143
gas_data = ppmc.GasData(GAS_DATA_CTOR_ARG_MINIMAL)
136-
scenario_ctor_arg = SCENARIO_CTOR_ARG_MINIMAL
137-
scenario_ctor_arg["loss_function"] = loss_function_param
144+
scenario_ctor_arg = {**SCENARIO_CTOR_ARG_MINIMAL, **loss_function_params}
138145
scenario = ppmc.Scenario(gas_data, aero_data, scenario_ctor_arg)
139146
vol = (4/3)*np.pi*(1e-6)**3
140147
density = 1

0 commit comments

Comments
 (0)