Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tardis/plasma/standard_plasmas.py: old database files warning #799

Merged
merged 7 commits into from
Nov 4, 2017
9 changes: 6 additions & 3 deletions tardis/plasma/standard_plasmas.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,12 @@ def assemble_plasma(config, model, atom_data=None):

try:
atom_data = atomic.AtomData.from_hdf(atom_data_fname)
except TypeError:
raise ValueError('Error might be from the use of an old-format of the atomic database,\n please see '+ \
'https://github.com/tardis-sn/tardis-refdata/tree/master/atom_data for the most recent version.')
except TypeError as e:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and no \ 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, I'll have another go.. so catch the error, access the message and display it with the helpful suggestion or possible reason

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh..now I see

print (e, 'Error might be from the use of an old-format of the atomic database, \n' +\
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need the plus. every string in parenthesis is automatically concatenated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see, noted, thanks!

'please see https://github.com/tardis-sn/tardis-refdata/tree/master/atom_data' +\
',for the most recent version.')
raise


atom_data.prepare_atom_data(
model.abundance.index,
Expand Down