From a4d20444f867d11018f2bae86ab129a97c3644be Mon Sep 17 00:00:00 2001 From: "wbinventor@gmail.com" Date: Wed, 2 Mar 2016 11:35:26 -0500 Subject: [PATCH] Fixed code per comments by @paulromano --- openmc/arithmetic.py | 4 ++-- openmc/filter.py | 4 ++-- openmc/geometry.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/openmc/arithmetic.py b/openmc/arithmetic.py index e9ba378d52..5869cad802 100644 --- a/openmc/arithmetic.py +++ b/openmc/arithmetic.py @@ -566,7 +566,7 @@ class AggregateScore(object): def name(self): # Append each score in the aggregate to the string - string = '(' + ', '.join(map(str, self.scores)) + ')' + string = '(' + ', '.join(self.scores) + ')' return string @scores.setter @@ -742,7 +742,7 @@ class AggregateFilter(object): other.aggregate_filter.type in _FILTER_TYPES: delta = _FILTER_TYPES.index(self.aggregate_filter.type) - \ _FILTER_TYPES.index(other.aggregate_filter.type) - return True if delta > 0 else False + return delta > 0 else: return False else: diff --git a/openmc/filter.py b/openmc/filter.py index 67e15605ba..2ae8eeb626 100644 --- a/openmc/filter.py +++ b/openmc/filter.py @@ -82,7 +82,7 @@ class Filter(object): if self.type in _FILTER_TYPES and other.type in _FILTER_TYPES: delta = _FILTER_TYPES.index(self.type) - \ _FILTER_TYPES.index(other.type) - return True if delta > 0 else False + return delta > 0 else: return False else: @@ -327,7 +327,7 @@ class Filter(object): # Count bins in the merged filter if 'energy' in merged_filter.type: - merged_filter.num_bins = len(merged_bins) -1 + merged_filter.num_bins = len(merged_bins) - 1 else: merged_filter.num_bins = len(merged_bins) diff --git a/openmc/geometry.py b/openmc/geometry.py index ab3af872f6..dac0bd90f1 100644 --- a/openmc/geometry.py +++ b/openmc/geometry.py @@ -99,7 +99,7 @@ class Geometry(object): all_cells = self._root_universe.get_all_cells() cells = set() - for cell_id, cell in all_cells.items(): + for cell in all_cells.values(): if cell._type == 'normal': cells.add(cell) @@ -120,7 +120,7 @@ class Geometry(object): all_universes = self._root_universe.get_all_universes() universes = set() - for universe_id, universe in all_universes.items(): + for universe in all_universes.values(): universes.add(universe) universes = list(universes)