diff --git a/montepy/input_parser/input_syntax_reader.py b/montepy/input_parser/input_syntax_reader.py index 56c7dd29..e6cf1b9e 100644 --- a/montepy/input_parser/input_syntax_reader.py +++ b/montepy/input_parser/input_syntax_reader.py @@ -188,7 +188,7 @@ def flush_input(): ): yield from flush_input() # die if it is a vertical syntax format - if "#" in line[0:BLANK_SPACE_CONTINUE]: + if "#" in line[0:BLANK_SPACE_CONTINUE] and not line_is_comment: raise errors.UnsupportedFeature("Vertical Input format is not allowed") # cut line down to allowed length old_line = line diff --git a/tests/inputs/test.imcnp b/tests/inputs/test.imcnp index 4d9b70e3..fd0d4cbe 100644 --- a/tests/inputs/test.imcnp +++ b/tests/inputs/test.imcnp @@ -4,6 +4,7 @@ foo MCNP Test Model for MOAA C cells +c # hidden vertical Do not touch c 1 1 20 -1000 $ dollar comment diff --git a/tests/test_integration.py b/tests/test_integration.py index 800c4249..7da34589 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -342,6 +342,7 @@ def test_cell_card_pass_through(self): # test input pass-through answer = [ "C cells", + "c # hidden vertical Do not touch", "c", "1 1 20", " -1000 $ dollar comment", @@ -354,20 +355,20 @@ def test_cell_card_pass_through(self): cell = new_prob.cells[1] output = cell.format_for_mcnp_input((6, 2, 0)) print(output) - self.assertEqual(int(output[3].split("$")[0]), -5) + self.assertEqual(int(output[4].split("$")[0]), -5) # test mass density printer cell.mass_density = 10.0 with self.assertWarns(LineExpansionWarning): output = cell.format_for_mcnp_input((6, 2, 0)) print(output) - self.assertAlmostEqual(float(output[2].split()[2]), -10) + self.assertAlmostEqual(float(output[3].split()[2]), -10) # ensure that surface number updated # Test material number change new_prob = copy.deepcopy(problem) new_prob.materials[1].number = 5 cell = new_prob.cells[1] output = cell.format_for_mcnp_input((6, 2, 0)) - self.assertEqual(int(output[2].split()[1]), 5) + self.assertEqual(int(output[3].split()[1]), 5) def test_thermal_scattering_pass_through(self): problem = copy.deepcopy(self.simple_problem)