From ba659b3f0cd1634e54362fc2c672d410ea239d31 Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Mon, 14 Sep 2015 20:45:21 -0400 Subject: [PATCH] Fix PyAPI filter for numpy isinstance bug --- openmc/filter.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openmc/filter.py b/openmc/filter.py index 5a81906762..b9b6df36b5 100644 --- a/openmc/filter.py +++ b/openmc/filter.py @@ -7,7 +7,7 @@ import numpy as np from openmc import Mesh from openmc.constants import * from openmc.checkvalue import check_type, check_iterable_type, \ - check_greater_than + check_greater_than, _isinstance class Filter(object): """A filter used to constrain a tally to a specific criterion, e.g. only tally @@ -126,7 +126,7 @@ class Filter(object): raise ValueError(msg) # If the bin edge is a single value, it is a Cell, Material, etc. ID - if not isinstance(bins, Iterable): + if not _isinstance(bins, Iterable): bins = [bins] # If the bins are in a collection, convert it to a list @@ -141,7 +141,7 @@ class Filter(object): elif self._type in ['energy', 'energyout']: for edge in bins: - if not isinstance(edge, Real): + if not _isinstance(edge, Real): msg = 'Unable to add bin edge "{0}" to a "{1}" Filter ' \ 'since it is a non-integer or floating point ' \ 'value'.format(edge, self.type) @@ -165,7 +165,7 @@ class Filter(object): msg = 'Unable to add bins "{0}" to a mesh Filter since ' \ 'only a single mesh can be used per tally'.format(bins) raise ValueError(msg) - elif not isinstance(bins[0], Integral): + elif not _isinstance(bins[0], Integral): msg = 'Unable to add bin "{0}" to mesh Filter since it ' \ 'is a non-integer'.format(bins[0]) raise ValueError(msg)