diff --git a/openmc/mgxs/mgxs.py b/openmc/mgxs/mgxs.py index 8d60e521a5..ad55f9a241 100644 --- a/openmc/mgxs/mgxs.py +++ b/openmc/mgxs/mgxs.py @@ -694,7 +694,7 @@ class MGXS(object): # NOTE: This is important if tally merging was used if self.domain_type == 'mesh': filters = [self.domain_type] - xyz = map(lambda x: np.arange(1, x+1), self.domain.dimension) + xyz = [np.arange(1, x+1) for x in self.domain.dimension] filter_bins = [tuple(itertools.product(*xyz))] elif self.domain_type != 'distribcell': filters = [self.domain_type] @@ -1157,7 +1157,7 @@ class MGXS(object): elif self.domain_type == 'distribcell': subdomains = np.arange(self.num_subdomains, dtype=np.int) elif self.domain_type == 'mesh': - xyz = map(lambda x: np.arange(1, x+1), self.domain.dimension) + xyz = [np.arange(1, x+1) for x in self.domain.dimension] subdomains = list(itertools.product(*xyz)) else: subdomains = [self.domain.id] @@ -1295,7 +1295,7 @@ class MGXS(object): domain_filter = self.xs_tally.find_filter('avg(distribcell)') subdomains = domain_filter.bins elif self.domain_type == 'mesh': - xyz = map(lambda x: np.arange(1, x+1), self.domain.dimension) + xyz = [np.arange(1, x+1) for x in self.domain.dimension] subdomains = list(itertools.product(*xyz)) else: subdomains = [self.domain.id] @@ -1924,7 +1924,7 @@ class MatrixMGXS(MGXS): elif self.domain_type == 'distribcell': subdomains = np.arange(self.num_subdomains, dtype=np.int) elif self.domain_type == 'mesh': - xyz = map(lambda x: np.arange(1, x+1), self.domain.dimension) + xyz = [np.arange(1, x+1) for x in self.domain.dimension] subdomains = list(itertools.product(*xyz)) else: subdomains = [self.domain.id] @@ -3773,7 +3773,7 @@ class ScatterMatrixXS(MatrixMGXS): elif self.domain_type == 'distribcell': subdomains = np.arange(self.num_subdomains, dtype=np.int) elif self.domain_type == 'mesh': - xyz = map(lambda x: np.arange(1, x+1), self.domain.dimension) + xyz = [np.arange(1, x+1) for x in self.domain.dimension] subdomains = list(itertools.product(*xyz)) else: subdomains = [self.domain.id] diff --git a/openmc/tallies.py b/openmc/tallies.py index 79e7c56bcb..45bc496388 100644 --- a/openmc/tallies.py +++ b/openmc/tallies.py @@ -1293,7 +1293,7 @@ class Tally(object): # Create list of 2- or 3-tuples tuples for mesh cell bins if self_filter.type == 'mesh': dimension = self_filter.mesh.dimension - xyz = map(lambda x: np.arange(1, x+1), dimension) + xyz = [np.arange(1, x+1) for x in dimension] bins = list(itertools.product(*xyz)) # Create list of 2-tuples for energy boundary bins