From b4def66e6c52a46f63c0f3e4db25bd357b8c7ab1 Mon Sep 17 00:00:00 2001 From: MARCHAND MANON Date: Fri, 12 Jul 2024 09:45:44 +0200 Subject: [PATCH 1/2] docs: Freetext does not expect a tuple of strings, but multiple string arguments --- pyvo/registry/rtcons.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pyvo/registry/rtcons.py b/pyvo/registry/rtcons.py index 914fde9d..2980752c 100644 --- a/pyvo/registry/rtcons.py +++ b/pyvo/registry/rtcons.py @@ -251,11 +251,16 @@ def __init__(self, *words: str): Parameters ---------- - *words : tuple of str + *words : str It is recommended to pass multiple words in multiple strings arguments. You can pass in phrases (i.e., multiple words separated by space), but behaviour might then vary quite significantly between different registries. + + Examples + -------- + >>> from pyvo import registry + >>> registry.Freetext("Gamma", "Ray", "Burst") # doctest: +IGNORE_OUTPUT """ self.words = words From 1c85510ee3b6f0c71e918236785158d9ac5a8f10 Mon Sep 17 00:00:00 2001 From: MARCHAND MANON Date: Fri, 12 Jul 2024 09:59:22 +0200 Subject: [PATCH 2/2] docs: remove tuple from types when the classes don't expect tuples --- pyvo/registry/rtcons.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pyvo/registry/rtcons.py b/pyvo/registry/rtcons.py index 2980752c..301a18b0 100644 --- a/pyvo/registry/rtcons.py +++ b/pyvo/registry/rtcons.py @@ -241,7 +241,7 @@ def get_search_condition(self, service): class Freetext(Constraint): """ - A contraint using plain text to match against title, description, + A constraint using plain text to match against title, description, subjects, and person names. """ _keyword = "keywords" @@ -252,6 +252,7 @@ def __init__(self, *words: str): Parameters ---------- *words : str + One or more string arguments. It is recommended to pass multiple words in multiple strings arguments. You can pass in phrases (i.e., multiple words separated by space), but behaviour might then vary quite @@ -392,7 +393,7 @@ def __init__(self, *stds): Parameters ---------- - *stds : tuple of str + *stds : str one or more standards identifiers. The constraint will match records that have any of them. """ @@ -467,7 +468,7 @@ def __init__(self, *bands): Parameters ---------- - *bands : tuple of strings + *bands : strings One or more of the terms given in http://www.ivoa.net/rdf/messenger. The constraint matches when a resource declares at least one of the messengers listed. @@ -564,6 +565,7 @@ def __init__(self, ivoid, *more_ivoids): ---------- ivoid : string + One or more string arguments. The IVOA identifier of the resource to match. As RegTAP requires lowercasing ivoids on ingestion, the constraint lowercases the ivoid passed in, too. @@ -593,7 +595,7 @@ def __init__(self, *patterns): Parameters ---------- - patterns : tuple of strings + patterns : strings SQL patterns (i.e., ``%`` is 0 or more characters) for UCDs. The constraint will match when a resource has at least one column matching one of the patterns.