-
-
Notifications
You must be signed in to change notification settings - Fork 52
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 source_value to the describe function in regtap #492
Conversation
Codecov Report
@@ Coverage Diff @@
## main #492 +/- ##
==========================================
+ Coverage 80.01% 80.07% +0.06%
==========================================
Files 52 52
Lines 6039 6059 +20
==========================================
+ Hits 4832 4852 +20
Misses 1207 1207
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
51c74a6
to
c78d909
Compare
@gilleslandais proposed that we also add the DOI in this function. That'd require me to add (here) I'll add that if no one is against the idea. Switching to draft cause I won't have time over the weekend. |
d055bb9
to
33e0a61
Compare
The latest version here adds from pyvo import registry
catalogue_ivoid = f"ivo://CDS.VizieR/J/AJ/157/229"
voresource = registry.search(ivoid=catalogue_ivoid)[0]
voresource.describe(verbose=True)
|
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.
Thanks for fixing all the documentation typos!
Also, including alt_identifier in our resource records as such is good idea, and the source should always have been in the description.
So, from my point of view, this is mergeable, except that perhaps the commit messages could be just a bit less terse. With commit messages you'd like to see in the main history, we could merge the PR by rebasing, I think.
But on the question of how to merge, I'd like to defer to @bsipocz.
Adaptations in the tests include the new datalink version number and the variable length of the pulsar example along time.
33e0a61
to
6178077
Compare
This implied joining the table to the result of the registry search.
6178077
to
93d264d
Compare
Thank you Manon, I propose to add a subart of this list :
in option :
gilles |
Thanks for the review, I accepted the two suggestions (about I switched back to draft because @gilleslandais wanted to comment before merging this |
Is there a way to know which of the persons with If not, there is the
We could have created and updated here. Would be useful for people who'd like to know if they have the latest version of a resource.
This one is given by the
Voting in favor.
I think we can leave this one with the
Don't know. Most of the entries don't have a |
about creation date/update date. |
For the authors order, got it: |
On Mon, Oct 02, 2023 at 05:36:22AM -0700, Manon Marchand wrote:
Is there a way to know which of the persons with `role_name =
creator` is the first author?
No-ish. From rr.res_role you cannot because of SQL semantics (and
because RegTAP doesn't add something like an element_index column).
For display purposes, however, there's the rr.resource.creator_seq
you discovered as RegistryResource.creators. That preserves the
authors in sequence and tries to present them in a reasonable format.
I'd say that if you want to show creator information, that's where
you'd look, perhaps cutting off at 80 characters or something with an
ellipsis if you're worried about endless author lists. RegTAP
requires "; " as a separator here, so you could try and get more
fancy as in
> Other authors could be addedd too if the list is not too long (or could be truncated with « et al. »?)
But really: I wouldn't. Publishers dump all kinds of horrors into
creator, so trying to parse creator_seq is going to be a world of
pain at this point.
> * contact : (in reg. : res_role.contact)
I think we can leave this one with the `get_contact` method. It's
well documented.
Agreed; and it would make the normal discovery query significantly
more complicated. I'd say we can leave the more exotic use cases for
extra methods like these (that then may incur extra queries, too).
> * rights : do we have to propose right in VO context ? (in
> reg. : resource.right or resource.right_uri) -
Don't know. Most of the entries don't have a `rights` value.
At this point, I'd argue rights information is too inhomogeneous to
be widely useful. But if we show something, it should be the
contents of resource.rights -- that's where human-readable
information on usage restrictions and the like should be kept.
rights_uri is intended to be machine-readable; I don't think it has a
place in .describe().
|
This fix was added due to @msdemlei comment in astropy#492
This fix was added due to @msdemlei comment in astropy#492
I just saw that short name is printed twice (after |
64980f1
to
598fc43
Compare
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.
TL,DR: this can be merged whenever is ready and moved out from draft status and Markus, or the other maintainers are still happy with it. (There have been a couple of commits and a discussion since the approval, so I would not like to be the one overriding or deciding. From the plumbing POV, it all looks good to me).
The commits look reasonable to me, multi-lines are all good. Maybe it could have been better to submit the typo fixes separately, e.g. that way they could have landed in 1.4.3, in case a bugfix will be released before 1.5. But it's no big deal either way.
As for the commit messages, I really like that you use prefixes, too. I personally like the more standard acronyms that e.g. numpy documents here (https://numpy.org/devdocs/dev/development_workflow.html#writing-the-commit-message), but honestly it's really a tiny nuance, and I don't see we will ever require to follow one way or the other.
Hi all, TL; D:R If the approval still stands, you can merge 🙂 Comments: Following the comments, I added PS: for the commit messages, my resolution for the university new year was to try and follow https://www.conventionalcommits.org/en/v1.0.0/ when repos have no guidelines. This PR was my first time experimenting with that, sorry for the stir it caused |
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.
Here are a few additional comments -- but feel free to discard them and merge as-is.
3fb2dec
to
1953790
Compare
On Wed, Oct 04, 2023 at 04:40:01AM -0700, Manon Marchand wrote:
@ManonMarchand commented on this pull request.
+ @Property
+ def rights(self):
+ """Rights information about the content of the resource.
+
+ This information is often incomplete in the registry, you
+ might get more information with the ``reference_url``.
I don't get what you mean here
Sorry, I was typing sed commands :-). I just suggested to write
"more information at ``reference_url``" instead of the construct with
"with the". But that's purely stylistic, and not being a native
speaker myself I might even be wrong.
|
this should not happen very often for people's names, but it is common that publishers give list on names in creator_seq with the incorrect separator, resulting in very long strings
1953790
to
62efe9d
Compare
Ah sure! I asked a native speaker and he advised 'at the reference_url', the change is now applied 🙂 |
Thank you @ManonMarchand for the PR and @msdemlei for the review! |
Hello pyvo,
Why the PR
I'd really like if we could add the
source_value
to the describe output for regtap if that's ok with you. For now, I added it to the non-verbose output, but we could also limit that to verbose.What's done here
It's a bit messy:
multiinterface.xml
in the tests data becausesource_value
was not there. This required to adapt the datalink standard new version numberThanks!