-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing thKernel setting data type (#1855)
The thKernel setting is meant to store the name of the primary thermal hydraulics solver for a run. The default value was False, causing the data type of thKernel to be bool. When a user set the value of thKernel to anything in the settings file, it would only be set to True. Changing the default value to an empty string changes its data type to str, allowing the setting to work as originally intended.
- Loading branch information
Showing
4 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright 2024 TerraPower, LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. |
41 changes: 41 additions & 0 deletions
41
armi/physics/thermalHydraulics/tests/test_thermalHydraulicsPlugin.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Copyright 2024 TerraPower, LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
"""Unit tests for the thermal hydraulics plugin.""" | ||
from armi.physics import thermalHydraulics | ||
from armi.physics.thermalHydraulics.settings import CONF_DO_TH, CONF_TH_KERNEL | ||
from armi.settings import caseSettings | ||
from armi.tests.test_plugins import TestPlugin | ||
|
||
|
||
class TestThermalHydraulicsPlugin(TestPlugin): | ||
plugin = thermalHydraulics.ThermalHydraulicsPlugin | ||
|
||
def test_thermalHydraulicsSettingsLoaded(self): | ||
"""Test that the thermal hydraulics case settings are loaded.""" | ||
cs = caseSettings.Settings() | ||
|
||
self.assertIn(CONF_DO_TH, cs) | ||
self.assertIn(CONF_TH_KERNEL, cs) | ||
|
||
def test_thermalHydraulicsSettingsSet(self): | ||
"""Test that the thermal hydraulics case settings are applied correctly.""" | ||
cs = caseSettings.Settings() | ||
thKernelName = "testKernel" | ||
|
||
cs[CONF_DO_TH] = True | ||
cs[CONF_TH_KERNEL] = thKernelName | ||
|
||
self.assertTrue(cs[CONF_DO_TH]) | ||
self.assertEqual(cs[CONF_TH_KERNEL], thKernelName) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters