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

Get IBE's query_region_async function minimally working #1430

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

odysseus9672
Copy link
Contributor

This pull request gets astroquery's IBE module back into a minimally functional state. It includes the fixes in pull requests #1426 and #1428 , so addresses issues #1423 and #1427. It also addresses issue #1429. The SIA functionality is outright disabled, because it uses a different interface on IRSA's website. Data downloading is also not addressed by this pull request.

@pep8speaks
Copy link

pep8speaks commented Apr 25, 2019

Hello @odysseus9672! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2019-04-26 02:14:32 UTC

Copy link
Contributor

@keflavich keflavich left a comment

Choose a reason for hiding this comment

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

If there are big chunks of the code that don't do anything, it's better to remove them than comment that they do nothing.

astroquery/ibe/core.py Outdated Show resolved Hide resolved
astroquery/ibe/core.py Outdated Show resolved Hide resolved
Remove `dataset` everywhere, and `mission` kwargs where not relevant.
@bsipocz bsipocz added this to the v0.3.10 milestone May 2, 2019

# Raise exception, if request failed
response.raise_for_status()
HTMLtoTable = HTML()
Copy link
Member

Choose a reason for hiding this comment

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

It would be nicer to use the Table initializer directly

TABLE = conf.table
TIMEOUT = conf.timeout

def query_region(
self, coordinate=None, where=None, mission=None, dataset=None,
Copy link
Member

Choose a reason for hiding this comment

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

Removing kwargs, even if they are unused, should be done via a deprecation.
There is a decorator for doing that in astropy, and it was backported to the LTS release (2.0.12), too, but not to 3.0.x, so I suppose we shouldn't yet use it here.
@keflavich - what do you think? In astroML I worked around this very same issue by copying the decorator to astroML.utils and importing it from there when the astropy version is not the preferred one (we also do similar things in photutils to work around issues that are not available in all supported versions of astropy).

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm onboard with using those decorators, but in this case, I think these kwargs are being removed because they didn't do anything? But your point below that it's breaking the tests suggests that yes, we should use the deprecation and copy over the deprecator decorator.

@bsipocz
Copy link
Member

bsipocz commented May 2, 2019

The test failures are related to the fact of some of the kwargs got removed. This may bite back where users are using those kwargs as positional arguments, too.
So I have two suggestions:

  • deprecate them, but for that we need to figure out whether to copy over the decorator or not (I'm happy to open a separate PR for that), or without the decorator many warnings needs to be added when those kwargs got used

@bsipocz
Copy link
Member

bsipocz commented May 3, 2019

I had a quick look into this, and it seems that the issues are deeper than one could fix them with the decorators.

E.g.: some functionality are broken after this PR that are still working on master.

>>> Ibe.get_columns()
<Table masked=True length=175>
...

vs a HTTPError on this PR.

Which shows that our test suite is quite broken and incomplete. Thus I would suggest a test driven approach, e.g., add new tests run remotely for each method (similar to the ones in the local ones), and in the first approximation make sure that they keep working and return some sensible results both before and after adding changes.

@keflavich
Copy link
Contributor

I started another approach to fixing this when I was trying to get IBE to work: keflavich@c5efe04. It's redundant with this PR, and I never got it to work (IBE's structure fundamentally confuses me still), but the alternate approaches explored there may be helpful.

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

Successfully merging this pull request may close these issues.

4 participants