mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Merge pull request #762 from wbinventor/hotfix-filter-type
[HOTFIX] Removed use of Filter.type property
This commit is contained in:
commit
1c44351383
1 changed files with 7 additions and 6 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue