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

TJ's implementation for issue 212: TAP examples #220

Merged
merged 1 commit into from
Jun 26, 2020
Merged

TJ's implementation for issue 212: TAP examples #220

merged 1 commit into from
Jun 26, 2020

Conversation

trjaffe
Copy link
Contributor

@trjaffe trjaffe commented Mar 5, 2020

This appears to work for all the services I tried, which included those using XHTML or HTML. Either way, it's just using the xml.etree.ElementTree parser, which is a standard library not a new dependency. So I think this should be OK, right?

Second question: the response to /examples is optional. This implementation returns a simple list of TAPService objects. In the case that the response is 404 (allowed), it returns an empty list rather than None. Is this what we want?

(Sorry about the diffs in the notebook. The format of the whole thing apparently had to be updated according to my Jupyter.)

@cbanek cbanek added this to the v1.1 milestone Mar 5, 2020
@cbanek
Copy link
Contributor

cbanek commented Mar 5, 2020

Assigning milestone 1.1. I think this looks good! I'm going to ask if @funbaker has any thoughts on the XML parts, since I'm pretty clueless in that regard, I just follow the pattern. I'm also not sure what the test failure is, but it doesn't look related?

@stargaser
Copy link
Contributor

I think the test failure is due to astropy/astropy#9505 which might be pushed to astropy release 4.1, based on the discussion in the Astropy Slack astroquery channel.

@funbaker
Copy link
Contributor

funbaker commented Mar 5, 2020

The XML Parser Stuff is fine.

I suspect that astropy PR for making the test fail as well.
Which needs to be fixed in the test itself i think (removing the b)

@tomdonaldson
Copy link
Contributor

The test updates should be compatible with new and old versions of astropy. Once the dust settles, Astropy 4.1+ will not put bytes objects in the results. See this astroquery PR for an example of handling the versions: astropy/astroquery#1669

@funbaker
Copy link
Contributor

funbaker commented Mar 5, 2020

@tomdonaldson pyvo's tests test explicit for a byte string. hence i said it needs to be fixed in the pyvo tests.

@tomdonaldson
Copy link
Contributor

@funbaker Yes, I totally agree. My point was that the pyvo tests should be written to pass whether the Astropy version is <4.1 or >=4.1.

@trjaffe
Copy link
Contributor Author

trjaffe commented Mar 5, 2020

At my level of experience, I don't want to mess with other people's tests, so I guess I'll rebase when somebody else fixes that.

@funbaker
Copy link
Contributor

funbaker commented Mar 5, 2020

@trjaffe no worries, thats what code reviews are for.

@bsipocz
Copy link
Member

bsipocz commented Mar 5, 2020

Unrelated comment, but I saw the notebook for the diff here: Do you test the notebooks? If not then consider (not just here, but for the other notebooks as well) massaging the examples into code snippet into the narrative docs, so the doctesting is actually picking them up, rather than having notebooks.
Having potentially outdated examples is a very painful situation, so try to avoid it as much as you can.

@andamian
Copy link
Contributor

andamian commented Mar 6, 2020

I've already fixed the tests astropy related tests in my PR - #218. Just need review and approval to merge and then @trjaffe can rebase.

@cbanek
Copy link
Contributor

cbanek commented Mar 18, 2020

Sorry this one fell off my radar, can we rebase and I think that should get the build to work?

@trjaffe
Copy link
Contributor Author

trjaffe commented Mar 18, 2020

Sorry this one fell off my radar, can we rebase and I think that should get the build to work?

Don't I have to wait for PR #218 to be approved and merged? I had understood that it has some fixes to the tests in it.

@andamian
Copy link
Contributor

@trjaffe - #218 merged into master and master is now passing. Please pull it and see if you can turn this green.

@codecov
Copy link

codecov bot commented Apr 23, 2020

Codecov Report

Merging #220 into master will increase coverage by 0.01%.
The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #220      +/-   ##
==========================================
+ Coverage   72.19%   72.20%   +0.01%     
==========================================
  Files          42       42              
  Lines        4478     4498      +20     
==========================================
+ Hits         3233     3248      +15     
- Misses       1245     1250       +5     
Impacted Files Coverage Δ
pyvo/dal/tap.py 71.42% <75.00%> (+0.23%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9d527e1...7a94382. Read the comment docs.

@@ -138,6 +141,33 @@ def tables(self):
vosi.parse_tables(response.raw.read), tables_url)
return self._tables

@property
def examples(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry to chime in here so late in the game, but the examples end point is not part of the standard, is it? If it's not ,shouldn't it be available under a new submodule (extensions)? I know of a few other TAP features that are not yet part of the standard but used by at least a couple of service providers but I was reluctant to add them to the core library.

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like it's in 1.1 but not in 1.0? (I usually only look at the 1.1) from the new DALI? http://www.ivoa.net/documents/TAP/20190927/REC-TAP-1.1.html section 2

Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed, I must have looked at 1.0. What probably confused me was that I haven't seen the capabilities standard ID for examples (ivo://ivoa.net/std/DALI#examples). My read of the standard is that unlike the /tables end point, one for examples is actually specified in the capabilities of the service and could end up being different from baseURL/examples

@msdemlei
Copy link
Contributor

msdemlei commented May 6, 2020 via email

@cbanek
Copy link
Contributor

cbanek commented Jun 26, 2020

Okay this is green and has been approved and #218 got merged in, so I'm going to take this as part of 1.1

@cbanek cbanek merged commit cb916e9 into astropy:master Jun 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants