fixed issue in exporting mgxs to excel

This commit is contained in:
Sam Shaner 2016-07-30 16:51:21 -04:00
parent 3a6d2b1aee
commit 19b5faa449
2 changed files with 8 additions and 4 deletions

View file

@ -279,8 +279,9 @@ class Library(object):
elif self.domain_type == 'mesh':
cv.check_iterable_type('domain', domains, openmc.Mesh)
# The mesh and geometry are independent, so just return
return
# The mesh and geometry are independent, so set all_domains
# to the input domains
all_domains = domains
else:
raise ValueError('Unable to set domains with domain '
'type "{}"'.format(self.domain_type))

View file

@ -1192,7 +1192,7 @@ class MGXS(object):
# Loop over all subdomains
for subdomain in subdomains:
if self.domain_type == 'distribcell':
if self.domain_type == 'distribcell' or self.domain_type == 'mesh':
string += '{0: <16}=\t{1}\n'.format('\tSubdomain', subdomain)
# Loop over all Nuclides
@ -1407,7 +1407,10 @@ class MGXS(object):
if format == 'csv':
df.to_csv(filename + '.csv', index=False)
elif format == 'excel':
df.to_excel(filename + '.xls', index=False)
if self.domain_type == 'mesh':
df.to_excel(filename + '.xls')
else:
df.to_excel(filename + '.xls', index=False)
elif format == 'pickle':
df.to_pickle(filename + '.pkl')
elif format == 'latex':