powderday
powderday copied to clipboard
dust grid choice exceptions
when choosing a dust grid choice outside of the allowed values, one ought to get a valueerror per grid_construction.py
:
dust_grid_type_list = ['dtm', 'rr', 'manual','li_bestfit']
try:
dust_choice = dust_grid_type_list.index(cfg.par.dust_grid_type)
except ValueError as e:
print('You chose a dust_choice that isnt a valid selection within the list: ' +
dust_grid_type_list+'....crashing now!')
sys.exit()
but instead it errors with something like:
Smallest Cell Edge: 0.01220703125000022 kpc
Smallest Cell Volume: 1.8189894035459552e-06 kpc**3
Biggest Cell Edge: 12.500000000000226 kpc
Biggest Cell Volume: 1953.125000000106 kpc**3
Left Edge: 40183.377386093845 kpc
Right Edge: 40383.377386093845 kpc
Bottom Edge: 31824.019815372692 kpc
Top Edge: 32024.019815372696 kpc
Nearest Edge: 40834.63570342197 kpc
Farthest Edge: 32024.019815372696 kpc
Traceback (most recent call last):
File "/home/desika.narayanan/miniconda3/envs/mypy2env/bin/pd_front_end.py", line 4, in <module>
__import__('pkg_resources').run_script('powderday==0.1.0', 'pd_front_end.py')
File "/home/desika.narayanan/miniconda3/envs/mypy2env/lib/python2.7/site-packages/pkg_resources/__init__.py", line 666, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/home/desika.narayanan/miniconda3/envs/mypy2env/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1460, in run_script
exec(script_code, namespace, namespace)
File "/home/desika.narayanan/miniconda3/envs/mypy2env/lib/python2.7/site-packages/powderday-0.1.0-py2.7.egg/EGG-INFO/scripts/pd_front_end.py", line 70, in <module>
File "build/bdist.linux-x86_64/egg/powderday/sph_tributary.py", line 23, in sph_m_gen
File "build/bdist.linux-x86_64/egg/powderday/grid_construction.py", line 94, in yt_octree_generate
TypeError: cannot concatenate 'str' and 'list' objects