-
-
Notifications
You must be signed in to change notification settings - Fork 54
Description
Consider this script:
import pyvo
svc = pyvo.dal.tap.TAPService("http://dc.g-vo.org/tap")
for rec in svc.run_sync(
"SELECT TOP 1 califaid, obs_publisher_did, em_min"
" FROM califadr3.cubes"):
em_min = rec["em_min"]
with open("proc.fits", "wb") as f:
f.write(rec.processed(band=(em_min, em_min+1e-10)))
This fails with:
pyvo.dal.exceptions.DALServiceError: No SODA Resouces available and no dataformat in record. Maybe you forgot to include it into the TAP Query?
It wouldn't need to, since a smart datalink client could retrieve a links document (there is a datalink service block on the response) that in this case contains a SODA service.
I'm quite sure we should make pyVO do this; I actually think it used to do that before commit 382b50b. Thinking for a while about how that broke previous behaviour might be a good idea, but since the previous behaviour was broken in its own way, I'd say we should rather write some new code in dal.adhoc, _get_soda_resource. When the first two attempts fail, it should then use a datalink service block, fetch a links document and then run get_adhocservice_by_ivoid(SODA_SYNC_IVOID) on that; if that doesn't raise a DALServiceError, we'd have a SODA block that ought to work with our id.