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

Replace list_services by list_interfaces #525

Merged
merged 5 commits into from
Feb 23, 2024

Conversation

ManonMarchand
Copy link
Member

@ManonMarchand ManonMarchand commented Feb 19, 2024

This PR addresses #521

The list_services method is removed and replaced by list_interfaces to prevent the instantiation of Service objects that wouldn't be used.

The repr of the class Interfaces (added in #505 so not impacting the released version) is now lighter/shorter.

@ManonMarchand ManonMarchand changed the title Rename list_services into list_interfaces Replace list_services by list_interfaces Feb 19, 2024
@ManonMarchand ManonMarchand force-pushed the fix-list-interface branch 2 times, most recently from 888b6a6 to 9d22eec Compare February 19, 2024 10:21
@msdemlei
Copy link
Contributor

msdemlei commented Feb 19, 2024 via email

@ManonMarchand
Copy link
Member Author

What about something like :

>>> import pyvo as vo
>>> res = vo.registry.search(ivoid="ivo://CDS.VizieR/I/239")[0]
>>> res.describe()
The Hipparcos and Tycho Catalogues
Short Name: I/239
IVOA Identifier: ivo://cds.vizier/i/239
Access modes: conesearch, tap#aux, web
- tap#aux: http://tapvizier.cds.unistra.fr/TAPVizieR/tap
- webpage: http://vizier.cds.unistra.fr/viz-bin/VizieR-2?-source=I/239
- conesearch: http://vizier.cds.unistra.fr/viz-bin/conesearch/I/239/h_dm_com?,
description: Cone search capability for table I/239/h_dm_com (Double and
Multiples: Component solutions -COMP)
- conesearch: http://vizier.cds.unistra.fr/viz-bin/conesearch/I/239/hip_main?,
description: Cone search capability for table I/239/hip_main (The Hipparcos
Main Catalogue)
- conesearch: http://vizier.cds.unistra.fr/viz-bin/conesearch/I/239/solar_ha?,
description: Cone search capability for table I/239/solar_ha (Solar System
Annex: Astrometric catalogue)
- conesearch: http://vizier.cds.unistra.fr/viz-bin/conesearch/I/239/solar_t?,
description: Cone search capability for table I/239/solar_t (Solar System
Annex: Tycho astrometry/photometry)
- conesearch: http://vizier.cds.unistra.fr/viz-bin/conesearch/I/239/tyc_main?,
description: Cone search capability for table I/239/tyc_main (The main part of
Tycho Catalogue)

The Hipparcos and Tycho Catalogues are the primary products of the European
Space Agency's astrometric mission, Hipparcos. The satellite, which operated
for four years, returned high quality scientific data from November 1989 to
...

there's nothing when there is no description. By looking into a few records, there is no description when it is a bit obvious.

I don't print vosi, datalinks and soda. Do you think I should have kept soda?

@msdemlei
Copy link
Contributor

msdemlei commented Feb 19, 2024 via email

@ManonMarchand
Copy link
Member Author

(The failure in the devdeps CI looks like something that changed in the dev version of numpy, so not related. There is also the changelog but I think that one is not up to me, looks like a missing label?)

I like the is_user_visible idea!

@msdemlei
Copy link
Contributor

msdemlei commented Feb 20, 2024 via email

@ManonMarchand
Copy link
Member Author

I did not like the "not vosi, not datalink..." approach, so I went with the keys of the "service_for_standardid" dictionary. This would need to be updated anyway if the services change. It should keep things easier to maintain.

Copy link
Contributor

@msdemlei msdemlei left a comment

Choose a reason for hiding this comment

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

I've left a few comments that boil down to matters of taste -- and I'm happy to have this merged in its current state, too.

pyvo/registry/regtap.py Show resolved Hide resolved
pyvo/registry/regtap.py Outdated Show resolved Hide resolved
pyvo/registry/regtap.py Show resolved Hide resolved
pyvo/registry/regtap.py Outdated Show resolved Hide resolved
@msdemlei
Copy link
Contributor

msdemlei commented Feb 20, 2024 via email

@ManonMarchand
Copy link
Member Author

I think I addressed all your comments 🙂

Copy link

codecov bot commented Feb 22, 2024

Codecov Report

Attention: Patch coverage is 95.23810% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 80.38%. Comparing base (cbec016) to head (c2c38ee).

Files Patch % Lines
pyvo/registry/regtap.py 95.23% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #525      +/-   ##
==========================================
+ Coverage   79.71%   80.38%   +0.66%     
==========================================
  Files          52       52              
  Lines        6178     6189      +11     
==========================================
+ Hits         4925     4975      +50     
+ Misses       1253     1214      -39     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@msdemlei
Copy link
Contributor

msdemlei commented Feb 23, 2024 via email

@msdemlei
Copy link
Contributor

msdemlei commented Feb 23, 2024 via email

@bsipocz bsipocz added this to the v1.6 milestone Feb 23, 2024
@bsipocz
Copy link
Member

bsipocz commented Feb 23, 2024

Let's go, then. @bsipocz, if you agree, would you merge? Thanks all
around!

Oh, of course, you don't need to wait for me to merge things that are reviewed and ready to go.

However, I added some changelog conflicts with the v1.5.1 release this morning, so will go ahead fix that conflict and then merge.

…aces objects rather than Services

This prevents the instantiation of service objects that won't be used. The service can be accessed with the to_service() method.
it was only printing an url when there was a single acess point before.
is user visible corresponds to services that can be instantiated in pyvo and webpages. This is called in 'describe' and in 'list_interfaces'.
@bsipocz bsipocz merged commit 4d31a06 into astropy:main Feb 23, 2024
12 checks passed
@bsipocz
Copy link
Member

bsipocz commented Feb 23, 2024

Thanks @ManonMarchand!

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.

3 participants