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

If Radex.datapath is not set explicitly, an OSError occurs #11

Open
tomr-stargazer opened this issue Oct 21, 2016 · 2 comments
Open

If Radex.datapath is not set explicitly, an OSError occurs #11

tomr-stargazer opened this issue Oct 21, 2016 · 2 comments

Comments

@tomr-stargazer
Copy link
Contributor

tomr-stargazer commented Oct 21, 2016

Hey,
I just started using pyradex, and wanted to log the following unhandled error. I was following the example hosted here:
http://nbviewer.jupyter.org/github/keflavich/pyradex/blob/master/examples/FittingTheGrid.ipynb

and when I ran the following line:

R = pyradex.Radex(species='oh2co-h2', abundance=1e-8, column=1e14, temperature=20)

I got this error:
https://gist.github.com/tomr-stargazer/9f6448b4bfc5e93011f463bfe6980003

It looks like the code somehow mishandles the fact that self.datapath is set to None, so I wonder if there is a more elegant way to handle this (at least to throw a more sensible error).

I'd be happy to attempt to solve this myself as I get more comfortable and familiar with pyradex!

@tomr-stargazer
Copy link
Contributor Author

tomr-stargazer commented Oct 21, 2016

The error doesn't come up when I have $RADEX_DATAPATH (in my shell) set to something sensible, as expected.

@keflavich
Copy link
Owner

Right, probably the best solution is to raise a descriptive exception earlier if the path is not set, since I think we need the path set in order to stash & retrieve collisional data files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants