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

Fermi docs example broken #181

Merged
merged 1 commit into from
Sep 14, 2013
Merged

Fermi docs example broken #181

merged 1 commit into from
Sep 14, 2013

Conversation

keflavich
Copy link
Contributor

The example in the Fermi tutorial doesn't work:

In [22]: from astroquery import fermi

In [23]: query = fermi.FermiLAT_Query()
ERROR: TypeError: __call__() takes at least 2 arguments (1 given) [IPython.core.interactiveshell]
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-23-6470dbf3fa96> in <module>()
----> 1 query = fermi.FermiLAT_Query()

TypeError: __call__() takes at least 2 arguments (1 given)

@jdnc Can you re-factor Fermi soon (see #112)?
If not I might have time to do it next week.

@keflavich
Copy link
Contributor

@cdeil: @jdnc has started a new grad program, so she will be unable to work on this prior to the release, I suspect.

However, I've started on it; if you want to add some work, could you issue PRs on this PR:
#182

@kialio
Copy link

kialio commented Sep 13, 2013

I just posted this on an enrico thread but putting it here since it might be useful information. We're (as in the Fermi SSC) are happy this is here but one thing to note: We've had a few cases in the past year of users not thinking through the scripting process and submitting 100's (and one time 1000's) of queries in less than a minute. This pretty much looks like a dds attack and overwhelms our servers. We've implemented checks for this and block IPs that do it. I'm not sure if you can implement something in astroquery that prohibits this kind of behavior but if you can, that would be good. Not sure if the over zealous users are using astroquery or not. Probably just using homegrown tools.

In the end, if a user wants to submit 1000's of queries, it would be more efficient for the user to grab the weekly files instead. These are updated as fast as the data in the data server. ie. the most recent weekly file might not be a full week, it just includes the most recent data.

@keflavich
Copy link
Contributor

@kialio Thanks for letting me know! This raises an issue I just keep forgetting about: we should have all requests posted to any server explicitly identify astroquery as the source of the query, that way server managers know to come to us.

Anyway, we shouldn't be pinging your servers directly much - our tests no longer require communications with external servers. We can put warnings in place to try to prevent users from submitting excessive queries, but for better or worse, the queries actually are incredibly simple, so there's nothing to prevent a user from submitting a request in a for loop or something stupid like that.

That said, the Astroquery FERMI code was basically totally nonfunctional prior to a few weeks ago, so we weren't at fault for those other silly users.

@cdeil
Copy link
Member Author

cdeil commented Sep 13, 2013

@kialio If you have a suggestion what restriction would make sense to put in astroquery.fermi to make it hard for users to accidentally query too much (or intentionally make many queries, but get IP-banned as a resut) please let us know or make a PR.

keflavich added a commit that referenced this pull request Sep 14, 2013
@keflavich keflavich merged commit 4149a9b into astropy:master Sep 14, 2013
@keflavich keflavich deleted the fermidocs branch September 14, 2013 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants