Repository: CORE-GATECH-GROUP/serpent-tools (language: python)

Issue:
ENH Support Serpent 2.2
**Is your feature request related to a problem? Please describe.**
Serpent 2.2 has been released for some time, but `serpentTools` has not formally supported it. So when you read a result file, you'll get warning messages about 2.2 not being supported even though things work.

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

- [ ] Serpent version 2.2.0 is added to the list of supported results file versions
- [ ] Any results output variables that have been added or dropped in 2.2 are incorporated into the results reader

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.



Discussion / hints:

Fix patch:
diff --git a/serpentTools/parsers/results.py b/serpentTools/parsers/results.py
index c61e8dfe..a4270f1b 100644
--- a/serpentTools/parsers/results.py
+++ b/serpentTools/parsers/results.py
@@ -48,12 +48,13 @@
         'varsUnc': ['MICRO_NG', 'MICRO_E', 'MACRO_NG', 'MACRO_E'],
     },
 }
-MapStrVersions['2.1.30'] = MapStrVersions['2.1.29']
-MapStrVersions['2.1.31'] = MapStrVersions['2.1.29']
-MapStrVersions['2.1.32'] = MapStrVersions['2.1.29']
 """
 Assigns search strings for different Serpent versions
 """
+MapStrVersions['2.1.30'] = MapStrVersions['2.1.29']
+MapStrVersions['2.1.31'] = MapStrVersions['2.1.29']
+MapStrVersions['2.1.32'] = MapStrVersions['2.1.29']
+MapStrVersions['2.2.0'] = MapStrVersions['2.1.32']
 
 METADATA_CONV = {
     int: {
diff --git a/serpentTools/settings.py b/serpentTools/settings.py
index 28a90ae3..f8bd2fe0 100644
--- a/serpentTools/settings.py
+++ b/serpentTools/settings.py
@@ -106,7 +106,7 @@
     },
     'serpentVersion': {
         'default': '2.1.31',
-        'options': ['2.1.29', '2.1.30', '2.1.31', '2.1.32'],
+        'options': ['2.1.29', '2.1.30', '2.1.31', '2.1.32', "2.2.0"],
         # When adding new version of Serpent, add / update
         # MapStrVersions with variables that indicate the start of specific
         # data blocks / time parameters like burnup


Test patch:
diff --git a/tests/test_results.py b/tests/test_results.py
index e562cc3f..f8af9aae 100644
--- a/tests/test_results.py
+++ b/tests/test_results.py
@@ -2,11 +2,14 @@
 import os
 from os.path import join as pjoin
 from tempfile import TemporaryDirectory
+from pathlib import Path
 
 import numpy
 import pytest
 import serpentTools
 
+from . import LoggerMixin
+
 
 @pytest.fixture
 def multipleGcuNoBu():
@@ -55,8 +58,8 @@ def fake2132File(tdir):
     newfile = pjoin(tdir, "InnerAssembly_2132_res.m")
     with open(newfile, "w") as ostream, open(basefile, "r") as istream:
         for line in istream:
-            if "2.1.31" in line:
-                ostream.write(line.replace("2.1.31", "2.1.32"))
+            if "2.1.30" in line:
+                ostream.write(line.replace("2.1.30", "2.1.32"))
             else:
                 ostream.write(line)
             if line.startswith("BURN_STEP"):
@@ -90,3 +93,33 @@ def test_2132_filterburnup(fake2132File):
     assert "burnDays" in reader.resdata
     assert "absKeff" in reader.resdata
     assert "pop" not in reader.metadata
+
+
+@pytest.fixture
+def fake220File(tmp_path: Path) -> str:
+    fname = "InnerAssembly_res.m"
+    originalFile = serpentTools.data.getFile(fname)
+    newFile = tmp_path / fname
+
+    with open(originalFile) as orig, newFile.open("w") as wstream:
+        for line in orig:
+            if "2.1.30" not in line:
+                wstream.write(line)
+            else:
+                wstream.write(line.replace("2.1.30", "2.2.0"))
+    yield str(newFile)
+
+
+@pytest.fixture
+def logInterceptor() -> LoggerMixin:
+    logger = LoggerMixin()
+    logger.attach()
+    yield logger
+    logger.detach()
+
+
+def test_nowarns_220(fake220File: str, logInterceptor: LoggerMixin):
+    with serpentTools.settings.rc as rc:
+        rc["serpentVersion"] = "2.2.0"
+        serpentTools.read(fake220File, "results")
+    assert not logInterceptor.handler.logMessages
diff --git a/tests/test_settings.py b/tests/test_settings.py
index 3c9cc92a..55163769 100644
--- a/tests/test_settings.py
+++ b/tests/test_settings.py
@@ -164,3 +164,8 @@ def test_loadNestedNonStrict(self):
         self._writeTestRemoveConfFile(badSettings, self.files['nested'],
                                       self.configSettings, False)
         self.assertMsgInLogs("ERROR", "bad setting", partial=True)
+
+
+def test_supports_2_2():
+    with settings.rc as rc:
+        rc["serpentVersion"] = "2.2.0"