From e335f07375eecf33f49a7de1d41cfc8a7b4a4826 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 20 Sep 2024 16:54:58 -0700 Subject: [PATCH] Add docs for ParameterCollectionWhere tests --- armi/reactor/tests/test_parameters.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/armi/reactor/tests/test_parameters.py b/armi/reactor/tests/test_parameters.py index 1e1953fe6..5116cde41 100644 --- a/armi/reactor/tests/test_parameters.py +++ b/armi/reactor/tests/test_parameters.py @@ -514,6 +514,8 @@ class MockPCChild(MockPC): class ParamCollectionWhere(unittest.TestCase): + """Tests for ParameterCollection.where.""" + class ScopeParamCollection(parameters.ParameterCollection): pDefs = parameters.ParameterDefinitionCollection() with pDefs.createBuilder() as pb: @@ -556,6 +558,7 @@ def setUpClass(cls) -> None: cls.pc = cls.ScopeParamCollection() def test_onCategory(self): + """Test the use of Parameter.hasCategory on filtering.""" names = {"keff", "cornerFlux"} for p in self.pc.where( lambda pd: pd.hasCategory(parameters.Category.neutronics) @@ -565,6 +568,7 @@ def test_onCategory(self): self.assertFalse(names, msg=f"{names=} should be empty!") def test_onLocation(self): + """Test the use of Parameter.atLocation in filtering.""" names = { "edgeTemperature", } @@ -576,6 +580,7 @@ def test_onLocation(self): self.assertFalse(names, msg=f"{names=} should be empty!") def test_complicated(self): + """Test a multi-condition filter.""" names = { "cornerFlux", }