Remove unused nonzero method and added docstring for shape property to Tally Python API class

This commit is contained in:
wbinventor@gmail.com 2015-12-14 09:32:10 -05:00
parent beb3189d8d
commit 16fcc9300c

View file

@ -70,6 +70,9 @@ class Tally(object):
Total number of filter bins accounting for all filters
num_bins : Integral
Total number of bins for the tally
shape : 3-tuple of Integral
The shape of the tally data array ordered as the number of filter bins,
nuclide bins and score bins
num_realizations : Integral
Total number of realizations
with_summary : bool
@ -251,10 +254,6 @@ class Tally(object):
def scores(self):
return self._scores
@property
def shape(self):
return (self.num_filter_bins, self.num_nuclides, self.num_score_bins)
@property
def num_scores(self):
return len(self._scores)
@ -279,6 +278,10 @@ class Tally(object):
num_bins *= self.num_score_bins
return num_bins
@property
def shape(self):
return (self.num_filter_bins, self.num_nuclides, self.num_score_bins)
@property
def estimator(self):
return self._estimator
@ -312,10 +315,6 @@ class Tally(object):
sum = data['sum']
sum_sq = data['sum_sq']
# Define a routine to convert 0 to 1
def nonzero(val):
return 1 if not val else val
# Reshape the results arrays
sum = np.reshape(sum, self.shape)
sum_sq = np.reshape(sum_sq, self.shape)