You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please note that I'm not too knowledgeable with the code, so feel free to comment angry messages and close the issue if this is in error :)
For example, for ENDF-B-VII.1-neutrons n-008-O_017.endf,
sandy.sampling.run() errors because the get_perturbations() will return an empty dictionary (i.e., smps={}). This will cause the apply_perturbations() function to error with the following error message:
Traceback (most recent call last):
File "go.py", line 10, in <module>
obj.run()
File "/home/4ib/anaconda3/envs/env_neutronics/lib/python3.7/site-packages/fermi-0.1-py3.7.egg/fermi/neutronics/nuclear_data_perturbation/openmc_data_pert.py", line 40, in run
self.generate_perturbed_data()
File "/home/4ib/anaconda3/envs/env_neutronics/lib/python3.7/site-packages/fermi-0.1-py3.7.egg/fermi/neutronics/nuclear_data_perturbation/openmc_data_pert.py", line 95, in generate_perturbed_data
sandy.sampling.run(' '.join(cli))
File "/home/4ib/anaconda3/envs/env_neutronics/lib/python3.7/site-packages/sandy-1.0.37-py3.7.egg/sandy/sampling.py", line 185, in inner
foo(iargs)
File "/home/4ib/anaconda3/envs/env_neutronics/lib/python3.7/site-packages/sandy-1.0.37-py3.7.egg/sandy/sampling.py", line 305, in run
verbose=iargs.debug,
File "/home/4ib/anaconda3/envs/env_neutronics/lib/python3.7/site-packages/sandy-1.0.37-py3.7.egg/sandy/core/endf6.py", line 2204, in apply_perturbations
if not item:
UnboundLocalError: local variable 'item' referenced before assignment
Is there a way to add an argument so that if the file does not have any covariance data it will just output something helpful? Thanks!
The text was updated successfully, but these errors were encountered:
This is what I used, but I feel like it's not the most appropriate:
if not smps: # covariance data does not exist
print('Covariance data does not exist!')
pendf = endf6.get_pendf(**pendf_kws)
ace = endf6.get_ace(pendf=pendf, **ace_kws)
suffix = ace_kws.get("suffix", "." + sandy.njoy.get_temperature_suffix(temperature))
file_name = iargs.outname + suffix + 'c'
for i in range(iargs.samples):
fn = file_name.replace('{SMP}', str(i))
with open(fn, 'w') as f:
f.write(ace['ace'])
fn += '.xsd'
with open(fn, 'w') as f:
f.write(ace['xsdir'])
Please note that I'm not too knowledgeable with the code, so feel free to comment angry messages and close the issue if this is in error :)
For example, for ENDF-B-VII.1-neutrons n-008-O_017.endf,
sandy.sampling.run()
errors because theget_perturbations()
will return an empty dictionary (i.e.,smps={}
). This will cause theapply_perturbations()
function to error with the following error message:Is there a way to add an argument so that if the file does not have any covariance data it will just output something helpful? Thanks!
The text was updated successfully, but these errors were encountered: