diff --git a/openmc/filter.py b/openmc/filter.py index 88a88f99d3..bf59e8238b 100644 --- a/openmc/filter.py +++ b/openmc/filter.py @@ -1,8 +1,7 @@ -from abc import ABCMeta, abstractproperty +from abc import ABCMeta from collections import Iterable, OrderedDict import copy from numbers import Real, Integral -import sys from xml.etree import ElementTree as ET from six import add_metaclass @@ -829,7 +828,7 @@ class EnergyFilter(Filter): if bins[index] < bins[index-1]: msg = 'Unable to add bin edges "{0}" to a "{1}" Filter ' \ 'since they are not monotonically ' \ - 'increasing'.format(bins, self.type) + 'increasing'.format(bins, type(self)) raise ValueError(msg) def can_merge(self, other): @@ -848,7 +847,7 @@ class EnergyFilter(Filter): def merge(self, other): if not self.can_merge(other): msg = 'Unable to merge "{0}" with "{1}" ' \ - 'filters'.format(self.type, other.type) + 'filters'.format(type(self), other.type) raise ValueError(msg) # Merge unique filter bins @@ -1330,7 +1329,8 @@ class PolarFilter(Filter): hi_bins = np.tile(hi_bins, tile_factor) # Add the new angle columns to the DataFrame. - df.loc[:, self.type + ' low'] = lo_bins + df.loc[:, 'polar low'] = lo_bins + df.loc[:, 'polar high'] = hi_bins return df @@ -1408,7 +1408,8 @@ class AzimuthalFilter(Filter): hi_bins = np.tile(hi_bins, tile_factor) # Add the new angle columns to the DataFrame. - df.loc[:, self.type + ' low'] = lo_bins + df.loc[:, 'azimuthal low'] = lo_bins + df.loc[:, 'azimuthal high'] = hi_bins return df