-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add a UAT registry constraint #649
Open
msdemlei
wants to merge
4
commits into
astropy:main
Choose a base branch
from
msdemlei:add-uat-constraint
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,8 @@ keyword arguments. The following constraints are available: | |
* :py:class:`~pyvo.registry.UCD` (``ucd``): constrain by one or more UCD | ||
patterns; resources match when they serve columns having a matching | ||
UCD (e.g., ``phot.mag;em.ir.%`` for “any infrared magnitude”). | ||
* :py:class:`~pyvo.registry.UAT` (``uat``): constrain by concepts | ||
from the IVOA Unified Astronomy Thesaurus http://www.ivoa.net/rdf/uat. | ||
* :py:class:`~pyvo.registry.Waveband` (``waveband``): one or more terms | ||
from the vocabulary at http://www.ivoa.net/rdf/messenger giving the rough | ||
spectral location of the resource. | ||
|
@@ -97,9 +99,22 @@ or: | |
... registry.Waveband("UV")) | ||
|
||
or a mixture between the two. Constructing using explicit | ||
constraints is generally preferable with more complex queries. Where | ||
the constraints accept multiple arguments, you can pass in sequences to | ||
the keyword arguments; for instance: | ||
constraints is generally preferable with more complex queries. | ||
An advantage of using explicit constraints is that you can pass | ||
additional parameters to the constraints. For instance, the UAT | ||
constraint can optionally expand your keyword to narrower or wider | ||
concepts. When looking for resources talking about Cepheids of all | ||
kinds, you can thus say: | ||
|
||
.. doctest-remote-data:: | ||
|
||
>>> resources = registry.search( | ||
... registry.UAT("cepheid-variable-stars", expand_down=3)) | ||
|
||
There is no way to express this using keyword arguments. | ||
|
||
However, where the constraints accept multiple equivalent arguments, you | ||
can pass in sequences to the keyword arguments; for instance: | ||
|
||
.. doctest-remote-data:: | ||
|
||
|
@@ -113,6 +128,7 @@ is equivalent to: | |
>>> resources = registry.search(waveband=["Radio", "Millimeter"], | ||
... author='%Miller%') | ||
|
||
|
||
There is also :py:meth:`~pyvo.registry.get_RegTAP_query`, accepting the | ||
same arguments as :py:meth:`pyvo.registry.search`. This function simply | ||
returns the ADQL query that search would execute. This is may be useful | ||
|
@@ -154,7 +170,7 @@ interactive data discovery, however, it is usually preferable to use the | |
|
||
And to look for tap resources *in* a specific cone, you would do | ||
|
||
.. doctest-remote-data:: | ||
.. doctest-remote-data:: # doctest: +IGNORE_OUTPUT | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This won't work, the #doctest commands should be added at the end of the lines (each one of them) that are affected. But this example already has it. |
||
|
||
>>> from astropy.coordinates import SkyCoord | ||
>>> registry.search(registry.Freetext("Wolf-Rayet"), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somehow this throws an error, even though
cepheid-variable-stars
are in the list on the referred website