Astroquery: Dev: What controls the verbosity of _parse_result?

Created on 7 Mar 2017  路  14Comments  路  Source: astropy/astroquery

In your template:

def _parse_result(self, response, verbose=False):
    blahblah

How do I change the value of verbose from user-facing API? Cone Search already has its own verbose keyword, which I would like to pass in here to be consistent.

All 14 comments

Just have the query_X accept a verbose keyword and pass that on to the parser. Or pass it any way you like; this part of the API doesn't need to be particularly strict (though if we see an issue once there's some code in place, we can try to fix it).

Sorry I'm being so vague with these responses, but because there is so much variation between modules, we have tried to avoid 'overdesigning' the API / template.

That kind of defeats the purpose of http://astroquery.readthedocs.io/en/latest/template.html where I don't have to write query_region myself, but rather just query_region_async that does not call _parse_result.

oh, oh I see your point. query_* actually accepts and passes on the verbose keyword:
https://github.com/astropy/astroquery/blob/master/astroquery/utils/process_asyncs.py#L29
so it should "just work"

Ah, I see. In that case, the template's query_X_async() should include a verbose keyword and some doc explaining how it will be passed into _parse_result(). Thanks!

Also, for the async case, does verbose somehow magically get passed into get_data() as well?

I think get_data is not automatically async-to-sync'd.

Then do I do get_data(verbose=True) then? :thinking: I can't find the code for that method in astroquery.

I don't think we've ever actually implemented a literal get_data method. The best example might be ukidss.get_images/ukidss.get_images_async.... that's the one more commonly implemented (see also sdss, nvas, skyview, ned, magpis, esa_sky). Probably we should change the template to get_images for consistency, though in principle it could be more general

Now I am confused. Are you saying that the get_data() in http://astroquery.readthedocs.io/en/latest/api.html?highlight=get_data#asynchronous-queries does not actually exist? Then how do I actually download and parse the response from my async method?

OH, I had not read that specific line in the api docs for...ever. No, that does not exist. I think that was a proposed API that we never implemented. Sorry! We really need to delete that section.

The way we actually do it is just pass the response to _parse_result.

You mean, I actually need to make the user call a hidden method, like this?

response = QC.query_region_async(coordinates, radius)
table = QC._parse_result(response, verbose=True)

:scream:

Well, that's definitely not the intent... ah, there's an issue about this:
https://github.com/astropy/astroquery/issues/225
see the second item.

As you can probably tell, we have actually had very little use of the async methods. They seemed like a good idea in principle, and in practice... well, we designed flexibly and didn't have to.

Okay. That's fine. Cone Search already has a somewhat working async thingy. Its API is not what you advertised but it will do for now. Thanks for all the response!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

StuartLittlefair picture StuartLittlefair  路  9Comments

pllim picture pllim  路  6Comments

gandalfsaxe picture gandalfsaxe  路  10Comments

saimn picture saimn  路  4Comments

Venustiano picture Venustiano  路  10Comments