Skip to content

Bugfix: ALMA enhanced tables don't need qtable #3395

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions astroquery/alma/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def get_enhanced_table(result):
"Please refer to https://astropy-regions.readthedocs.io/en/latest/installation.html for how to install it.")
raise

def _parse_stcs_string(input):
def s_region_parser(input):
Copy link
Member

Choose a reason for hiding this comment

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

I would leave this as a private method

csys = 'icrs'

def _get_region(tokens):
Expand Down Expand Up @@ -293,19 +293,10 @@ def _get_region(tokens):
return result
else:
return _get_region(s_region.split())
prep_table = result.to_qtable()
Copy link
Member

Choose a reason for hiding this comment

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

I'm not at all sure why this stopped working, we haven't really switch the API (as we haven't really switched out the TAP results to return Tables rather than DAL result tables as suggested #3244)

s_region_parser = None
for field in result.resultstable.fields:
if ('s_region' == field.ID) and \
('obscore:Char.SpatialAxis.Coverage.Support.Area' == field.utype):
if 'adql:REGION' == field.xtype:
s_region_parser = _parse_stcs_string
# this is where to add other xtype parsers such as shape
break
if (s_region_parser):
for row in prep_table:
row['s_region'] = s_region_parser(row['s_region'])
return prep_table

for row in result:
row['s_region'] = s_region_parser(row['s_region'])
Copy link
Member

Choose a reason for hiding this comment

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

don't reuse/call the method inside its body

return result


class AlmaAuth(BaseVOQuery, BaseQuery):
Expand Down
Loading