diff --git a/astroquery/jplspec/lookup_table.py b/astroquery/jplspec/lookup_table.py index 27a2501690..40bdd2a091 100644 --- a/astroquery/jplspec/lookup_table.py +++ b/astroquery/jplspec/lookup_table.py @@ -22,10 +22,13 @@ def find(self, s, flags): Returns ------- - The list of values corresponding to the matches + The dictionary containing only values whose keys match the regex """ + if s in self: + return {s: self[s]} + R = re.compile(s, flags) out = {} diff --git a/astroquery/linelists/cdms/core.py b/astroquery/linelists/cdms/core.py index 8ebe9496ab..1b892609dd 100644 --- a/astroquery/linelists/cdms/core.py +++ b/astroquery/linelists/cdms/core.py @@ -375,10 +375,13 @@ def find(self, st, flags): Returns ------- - The list of values corresponding to the matches + The dictionary containing only values whose keys match the regex """ + if st in self: + return {st: self[st]} + out = {} for kk, vv in self.items():