From 764ab84f0136484adbc94b75bc2e29373991e5e7 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 16 Apr 2015 12:28:04 -0500 Subject: [PATCH] Remove #! from Python files in Python API since they don't have __main__ --- src/utils/openmc/__init__.py | 2 -- src/utils/openmc/checkvalue.py | 3 --- src/utils/openmc/clean_xml.py | 4 +--- src/utils/openmc/cmfd.py | 4 +--- src/utils/openmc/constants.py | 2 -- src/utils/openmc/element.py | 2 -- src/utils/openmc/executor.py | 4 +--- src/utils/openmc/geometry.py | 4 +--- src/utils/openmc/material.py | 4 +--- src/utils/openmc/nuclide.py | 4 +--- src/utils/openmc/opencg_compatible.py | 2 -- src/utils/openmc/plots.py | 2 -- src/utils/openmc/statepoint.py | 4 +--- src/utils/openmc/summary.py | 4 +--- src/utils/openmc/surface.py | 4 +--- src/utils/openmc/tallies.py | 2 -- src/utils/openmc/universe.py | 2 -- 17 files changed, 9 insertions(+), 44 deletions(-) diff --git a/src/utils/openmc/__init__.py b/src/utils/openmc/__init__.py index 2f3a9b6de4..42ee1eebfa 100644 --- a/src/utils/openmc/__init__.py +++ b/src/utils/openmc/__init__.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - from openmc.element import * from openmc.geometry import * from openmc.nuclide import * diff --git a/src/utils/openmc/checkvalue.py b/src/utils/openmc/checkvalue.py index 679b5c2e42..503e7e24d5 100644 --- a/src/utils/openmc/checkvalue.py +++ b/src/utils/openmc/checkvalue.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - import numpy as np @@ -13,4 +11,3 @@ def is_float(val): def is_string(val): return isinstance(val, (str, np.str)) - diff --git a/src/utils/openmc/clean_xml.py b/src/utils/openmc/clean_xml.py index cac5833dc3..d67c01d549 100644 --- a/src/utils/openmc/clean_xml.py +++ b/src/utils/openmc/clean_xml.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - def sort_xml_elements(tree): # Retrieve all children of the root XML node in the tree @@ -92,4 +90,4 @@ def clean_xml_indentation(element, level=0): else: if level and (not element.tail or not element.tail.strip()): - element.tail = i \ No newline at end of file + element.tail = i diff --git a/src/utils/openmc/cmfd.py b/src/utils/openmc/cmfd.py index 4b7802ba3d..443867284a 100644 --- a/src/utils/openmc/cmfd.py +++ b/src/utils/openmc/cmfd.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - from openmc.checkvalue import * from openmc.clean_xml import * from xml.etree import ElementTree as ET @@ -583,4 +581,4 @@ class CMFDFile(object): # Write the XML Tree to the cmfd.xml file tree = ET.ElementTree(self._cmfd_file) tree.write("cmfd.xml", xml_declaration=True, - encoding='utf-8', method="xml") \ No newline at end of file + encoding='utf-8', method="xml") diff --git a/src/utils/openmc/constants.py b/src/utils/openmc/constants.py index ef55d2f8f2..7c4a7aed41 100644 --- a/src/utils/openmc/constants.py +++ b/src/utils/openmc/constants.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - """Dictionaries of integer-to-string mappings from openmc/src/constants.F90""" SURFACE_TYPES = {1: 'x-plane', diff --git a/src/utils/openmc/element.py b/src/utils/openmc/element.py index 745e2ad6bc..4a6a189dc5 100644 --- a/src/utils/openmc/element.py +++ b/src/utils/openmc/element.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - from openmc.checkvalue import * class Element(object): diff --git a/src/utils/openmc/executor.py b/src/utils/openmc/executor.py index cb09ea8515..f2d26de9b6 100644 --- a/src/utils/openmc/executor.py +++ b/src/utils/openmc/executor.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - from openmc.checkvalue import * import subprocess import os @@ -72,4 +70,4 @@ class Executor(object): cwd=self._working_directory) else: subprocess.check_call(command, shell=True, stdout=FNULL, - cwd=self._working_directory) \ No newline at end of file + cwd=self._working_directory) diff --git a/src/utils/openmc/geometry.py b/src/utils/openmc/geometry.py index 59fb158ee2..d30da1db51 100644 --- a/src/utils/openmc/geometry.py +++ b/src/utils/openmc/geometry.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - import openmc from openmc.clean_xml import * from xml.etree import ElementTree as ET @@ -159,4 +157,4 @@ class GeometryFile(object): # Write the XML Tree to the materials.xml file tree = ET.ElementTree(self._geometry_file) tree.write("geometry.xml", xml_declaration=True, - encoding='utf-8', method="xml") \ No newline at end of file + encoding='utf-8', method="xml") diff --git a/src/utils/openmc/material.py b/src/utils/openmc/material.py index 914cb154a1..2f501d0763 100644 --- a/src/utils/openmc/material.py +++ b/src/utils/openmc/material.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - import warnings import openmc @@ -365,7 +363,7 @@ class Material(object): else: subelement = ET.SubElement(element, "compositions") - + comps = [] allnucs = self._nuclides.values() + self._elements.values() dist_per_type = allnucs[0][2] diff --git a/src/utils/openmc/nuclide.py b/src/utils/openmc/nuclide.py index 8603c833b8..c351e18081 100644 --- a/src/utils/openmc/nuclide.py +++ b/src/utils/openmc/nuclide.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - from openmc.checkvalue import * @@ -80,4 +78,4 @@ class Nuclide(object): string += '{0: <16}{1}{2}\n'.format('\tXS', '=\t', self._xs) if self._zaid is not None: string += '{0: <16}{1}{2}\n'.format('\tZAID', '=\t', self._zaid) - return string \ No newline at end of file + return string diff --git a/src/utils/openmc/opencg_compatible.py b/src/utils/openmc/opencg_compatible.py index 2b2323a849..3a45f45005 100644 --- a/src/utils/openmc/opencg_compatible.py +++ b/src/utils/openmc/opencg_compatible.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - import openmc import opencg import copy diff --git a/src/utils/openmc/plots.py b/src/utils/openmc/plots.py index 551b2e76f4..dcb74c8adc 100644 --- a/src/utils/openmc/plots.py +++ b/src/utils/openmc/plots.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - from openmc.checkvalue import * from openmc.clean_xml import * from xml.etree import ElementTree as ET diff --git a/src/utils/openmc/statepoint.py b/src/utils/openmc/statepoint.py index 7c4f90ae38..dad2f4d268 100644 --- a/src/utils/openmc/statepoint.py +++ b/src/utils/openmc/statepoint.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - import struct, copy import numpy as np import scipy.stats @@ -383,7 +381,7 @@ class StatePoint(object): # Extract the moment order string for each score for k in range(len(scores)): - moment = self._get_string(8, + moment = self._get_string(8, path='{0}order{1}'.format(subbase, k+1)) moment = moment.lstrip('[\'') moment = moment.rstrip('\']') diff --git a/src/utils/openmc/summary.py b/src/utils/openmc/summary.py index 81e0b3bf5d..14c06f0460 100644 --- a/src/utils/openmc/summary.py +++ b/src/utils/openmc/summary.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - import openmc from openmc.opencg_compatible import get_opencg_geometry import numpy as np @@ -354,7 +352,7 @@ class Summary(object): if lattice_type == 'rectangular': dimension = self._f['geometry/lattices'][key]['n_cells'][...] lower_left = \ - self._f['geometry/lattices'][key]['lower_left'][...] + self._f['geometry/lattices'][key]['lower_left'][...] pitch = self._f['geometry/lattices'][key]['pitch'][...] outer = self._f['geometry/lattices'][key]['outer'][0] diff --git a/src/utils/openmc/surface.py b/src/utils/openmc/surface.py index 269bfd1c70..087d3981b3 100644 --- a/src/utils/openmc/surface.py +++ b/src/utils/openmc/surface.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - from openmc.checkvalue import * from openmc.constants import BC_TYPES from xml.etree import ElementTree as ET @@ -592,4 +590,4 @@ class ZCone(Cone): # Initialize ZCone class attributes super(ZCone, self).__init__(surface_id, bc_type, x0, y0, z0, R2, name=name) - self._type = 'z-cone' \ No newline at end of file + self._type = 'z-cone' diff --git a/src/utils/openmc/tallies.py b/src/utils/openmc/tallies.py index 063198ea1d..36880236cf 100644 --- a/src/utils/openmc/tallies.py +++ b/src/utils/openmc/tallies.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - from openmc import Nuclide from openmc.clean_xml import * from openmc.checkvalue import * diff --git a/src/utils/openmc/universe.py b/src/utils/openmc/universe.py index d48c6e9ca4..4c5b688b0a 100644 --- a/src/utils/openmc/universe.py +++ b/src/utils/openmc/universe.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - import openmc from openmc.checkvalue import * from xml.etree import ElementTree as ET