Commit 6b7e0f56 authored by Patrick Shriwise's avatar Patrick Shriwise
Browse files

Some more tweaks to run

parent c9dfc0e2
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -8,10 +8,10 @@ def parse_isoxml(isoxml_file):

    # find all "Isotope" elements
    isotopes = list(root.iter('Isotope'))
    return [f'{isotope.attrib["Name"]}' for isotope in isotopes]
    return [isotope.attrib["Name"] for isotope in isotopes]

if __name__ == '__main__':
    print(f'Parsing XML file {sys.argv[1]}...')
    print('Parsing XML file {}...'.foramt(sys.argv[1]))
    isoxml_materials = parse_isoxml(sys.argv[1])
    print(f'Found {len(isoxml_materials)} isotopes in the ISOXML:')
    print(''.join(f'\t{m}\n' for m in isoxml_materials))
    print('Found {} isotopes in the ISOXML:'.format(len(isoxml_materials)))
    print(''.join('\t{}\n'.format(m) for m in isoxml_materials))
+5 −5
Original line number Diff line number Diff line
@@ -7,7 +7,6 @@ import warnings

from . import checkvalue as cv
from .config import PyGriffinConfig
from .exodus_reader import parse_exodus
from .isoxml_reader import parse_isoxml
from .util import run_in_tmpdir

@@ -120,11 +119,11 @@ class PyGriffin:

        exodus_materials = self.get_exodus_materials()
        print("Materials applied in the Griffin mesh:")
        print(''.join(f'\t{m}\n' for m in exodus_materials))
        print(''.join('\t{}\n'.format(m) for m in exodus_materials))

        isoxml_materials = parse_isoxml(self.process_xs())
        print("Materials available in the ISOXML library:")
        print(''.join(f'\t{m}\n' for m in isoxml_materials))
        print(''.join('\t{}\n'.format(m) for m in isoxml_materials))

        isoxml_set = set(isoxml_materials)
        exodus_set = set(exodus_materials)
@@ -198,7 +197,7 @@ class PyGriffin:

        # run isoxml executable on the current xs file
        cmd = [str(self.config.isoxml_exec), p_flag, str(self.xs)]
        p = subprocess.Popen(cmd, universal_newlines=True, cwd=str(cwd))
        p = subprocess.Popen(cmd, universal_newlines=True, cwd=str(cwd), stdout=subprocess.PIPE)
        p.wait()

        # construct the name of the new xs file and return it
@@ -281,6 +280,8 @@ class PyGriffin:
    def from_son(cls, son_input, sonvalidxml_path=None):
        # generate an XML from the SON input
        import subprocess
        from wasppy import xml2obj

        schema = Path(__file__).parent / "../etc/pygriffin.sch"
        # if explicit path to the sonvalidxml executable is
        # provided, assume it is in the environment's PATH
@@ -290,7 +291,6 @@ class PyGriffin:
        xml_file = subprocess.check_output(cmd, shell=True)

        # generate a Python object from the XML file
        from wasppy import xml2obj
        xml_obj = xml2obj.xml2obj(xml_file)

        def _wasp_attr_to_str(attr):