diff --git a/openmc/_xml.py b/openmc/_xml.py index 6d298638da..aeaeb45b52 100644 --- a/openmc/_xml.py +++ b/openmc/_xml.py @@ -16,7 +16,7 @@ def clean_indentation(element, level=0, spaces_per_level=2, trailing_indent=True """ i = "\n" + level*spaces_per_level*" " - # ensure there's awlays some tail for the element passed in + # ensure there's always some tail for the element passed in if not element.tail: element.tail = "" diff --git a/openmc/executor.py b/openmc/executor.py index 9267366e89..38421ecc2c 100644 --- a/openmc/executor.py +++ b/openmc/executor.py @@ -95,7 +95,6 @@ def _run(args, output, cwd): p = subprocess.Popen(args, cwd=cwd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True) - print(args) # Capture and re-print OpenMC output in real-time lines = [] while True: @@ -146,7 +145,7 @@ def plot_geometry(output=True, openmc_exec='openmc', cwd='.', path_input=None): """ args = [openmc_exec, '-p'] if path_input is not None: - args += ['-i', path_input] + args += [path_input] _run([openmc_exec, '-p'], output, cwd) diff --git a/openmc/material.py b/openmc/material.py index 332f8c9659..aa778cab64 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -1548,7 +1548,6 @@ class Materials(cv.CheckedList): return materials - @classmethod def from_xml(cls, path: PathLike = 'materials.xml'): """Generate materials collection from XML file diff --git a/openmc/model/model.py b/openmc/model/model.py index a54cd60763..9983d5c60c 100644 --- a/openmc/model/model.py +++ b/openmc/model/model.py @@ -259,7 +259,7 @@ class Model: materials = {str(m.id): m for m in model.materials} model.geometry = openmc.Geometry.from_xml_element(root.find('geometry'), materials) - # gather meshses from other classes before reading the tally node + # gather meshes from other classes before reading the tally node meshes = {} if model.settings.entropy_mesh is not None: meshes[model.settings.entropy_mesh.id] = model.settings.entropy_mesh diff --git a/src/initialize.cpp b/src/initialize.cpp index 3b332c3b27..0c137795bb 100644 --- a/src/initialize.cpp +++ b/src/initialize.cpp @@ -352,7 +352,7 @@ bool read_model_xml() { auto other_inputs = {"materials.xml", "geometry.xml", "settings.xml", "tallies.xml", "plots.xml"}; for (const auto& input : other_inputs) { if (file_exists(settings::path_input + input)) { - warning((fmt::format("Other XML file input(s) are present. These file " + warning((fmt::format("Other XML file input(s) are present. These files " "will be ignored in favor of the {} file.", model_filename))); break; @@ -371,7 +371,7 @@ bool read_model_xml() { // Read geometry if (!check_for_node(root, "geometry")) { fatal_error(fmt::format( - "No node present in the model.xml_file.", model_filename)); + "No node present in the {} file.", model_filename)); } read_geometry_xml(root.child("geometry")); diff --git a/tests/regression_tests/model_xml/test.py b/tests/regression_tests/model_xml/test.py index d040f4649f..fbff02357f 100644 --- a/tests/regression_tests/model_xml/test.py +++ b/tests/regression_tests/model_xml/test.py @@ -81,7 +81,8 @@ def test_input_arg(run_in_tmpdir): openmc.run() # make sure the executable isn't falling back on the separate XMLs - [os.remove(f) for f in glob.glob('*.xml')] + for f in glob.glob('*.xml'): + os.remove(f) # now export to a single XML file with a custom name pincell.export_to_xml(path='pincell.xml', separate_xmls=False) assert Path('pincell.xml').exists()