Repository navigation
Exoplanet catalog queries - #771
Conversation
|
(1) seems fine |
|
I've moved the data to I think the astropy How do you think I should I approach this – should we mark the exoplanets tests only for astropy > 1.2? cc @bsipocz |
|
@bmorris3 yes, have the tests that rely on that check the astropy version. Maybe also add a check in the module itself to raise a |
|
The last remaining build failure is a sphinx warning about references: Do you know if I am using url references incorrectly? |
|
|
||
| from .exoplanet_archive import * | ||
| from .exoplanets_org import * | ||
| from .planet_params import * |
There was a problem hiding this comment.
Could you use explicit imports here? Especially since there is no core.py, it is helpful to be able to look at __init__.py to determine what's in the exoplanets namespace.
| """ | ||
| Dictionary of exoplanet parameters and their associated units. | ||
| """ | ||
| global PARAM_UNITS |
There was a problem hiding this comment.
Seeing global here is scary. I see why you're doing it, and I think it's safe enough. Generally, the "better" approach is to make a class that will load & cache the data the first time it is called.
There was a problem hiding this comment.
I agree that it's scary – it's a bad habit. I'll reimplement in a class format.
There was a problem hiding this comment.
What would that look like in this example? Would I make an ExoplanetTable class which gets initialized within the module, but not queried until you explicitly trigger it?
There was a problem hiding this comment.
Yes, that's about right. Something like:
class ExoplanetTable(object)
@property
def PARAM_UNITS(self):
if hasattr(self, '_param_units'):
return self._param_units
else:
# populate self._param_units
is a common pattern I use. I don't like the all-caps function name in this specific case, but something along these lines should work...
|
|
||
| References | ||
| ---------- | ||
| .. [1] http://exoplanetarchive.ipac.caltech.edu/index.html |
There was a problem hiding this comment.
Actually, maybe it should be more like this:
Download (and optionally cache) the `exoplanets.org planets table`_.
References
----------
.. _exoplanets.org planets table: http://www.exoplanets.org
|
|
||
|
|
||
| @remote_data | ||
| @pytest.mark.skipif('APY_LT12') |
There was a problem hiding this comment.
It would be good to have one tests that runs these non-astropy<1.2-valid queries and checks that the appropriate exception is raised.
|
I think the errors remaining at this point are raised by another part of astroquery due to the dev version of astropy. |
|
Looks good. Are you ready for it to be merged? I've seen those failures on other builds too. I think @mhvk mentioned this on astropy-dev. This thread is supposed to answer appveyor fails, but we're seeing travis fails, not appveyor... |
I think so, but I'd love your comments on the docs. Are there sufficient examples? I wanted to show some more outputs, but there are tons of columns in these tables. |
|
The failures look real, though would seem |
|
Ahh, sorry, the errors are different than last time I looked; previously it was an install error affecting these two versions. I suspect it's related to this: astropy/astropy#5411 but I'll investigate more. |
|
@bmorris3 if you rebase, it should fix the build. More examples are always good, but I can't suggest what to add. |
|
@bmorris3 - would you mind rebasing again? It seems that quite a few unrelated commits are picked up during the last one. |
|
@bsipocz What could I have done wrong? I did: Now when I do that command a second time I get tons of merge conflicts which are just previous commits. |
|
@bmorris3 - I'm heading home, but will definitely look at it later tonight. |
|
|
I haven't realized when making that PR that it imposes another restriction. Could you raise an issue in astropy and cc me? |
|
Hi @bmorris3, thanks a lot for working on this! 👏 Simplifying access to these two exoplanet archives is a valuable thing to do. I believe this would be a hot 🔥 feature that would get a lot of use. I found time to play with Issues:
Finally, some minor suggestions that are trivial:
I hope this is useful feedback. Thanks again for working on this. |
|
@barentsen Good points, especially about splitting into two modules. I think we could retain |
|
@bmorris3 - Re to the rebase (sorry it took so long to get back to this): For some reason the commits are doubled in this branch. I'm not sure what went wrong and where, but the fix is easy:
Simply keep only the first 12, delete the rest as they are pure repeats. I've checked, the commits are the same as the ones above them. Once doing that, there will be no conflicts, etc, and you will only need to force push it back here. If you want, you can check my copy of this branch, rebased here: https://github.com/bsipocz/astroquery/tree/bmorris3_exoplanets |
|
@bmorris3 - any chance you find time to finish this up? I would love to use it :) |
|
@bsipocz It's probably going to be a while – I'm slammed until after AAS 😢 |
|
Hi there @bmorris3 👋 - thanks for the pull request! I'm just a friendly 🤖 that checks for issues related to the changelog and making sure that this pull request is milestoned and labelled correctly. This is mainly intended for the maintainers, so if you are not a maintainer you can ignore this, and a maintainer will let you know if any action is required on your part 😃. I see this is a work in progress pull request. I'll report back on the checks once the PR is ready for review. |
|
Hello @bmorris3! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on October 02, 2017 at 16:07 Hours UTC |
|
Thanks @bmorris3 to pickig this up again. I have a few minor comments now, but will do a full review once you're ready.
|
|
Hey @barentsen and @keflavich, I'm finally following up on Geert's awesome code review. I'm going to write up some notes on what I've done:
@barentsen / @keflavich Do you think you'll have a chance to review the changes sometime soon? I'd like to make a major update to astroplan at some point in the near future which will depend on this update to astroquery. Thanks again! |
|
@bsipocz Haha! I think I got it. |
|
Looks good, though we still have 2 doc warnings: |
|
@keflavich All fixed. |
|
I added a tiny changelog entry for this in 79397ec |
|
Thanks again for the extensive reviews, @barentsen! |


This PR is an API proposal in response to #764. Here I develop the
PlanetParamsobject, which contains parameters of exoplanets, parsed from either exoplanets.org or NExScI's Exoplanet Archive.Here's the docs page that I've drafted for the module, which demonstrates the API:

Here are some potential details to discuss:
exoplanetsmodule I'm proposing here. Should I find a way to incorporate that within this module?astroquery/datadirectory which contain the units for each unitful table column in the exoplanet tables. Do you have any objections to including these "data" in that directory?cc @bsipocz @barentsen @lkreidberg @jlustigy