Skip to content

Commit

Permalink
Removing shortname from search_object defaults (#97)
Browse files Browse the repository at this point in the history
* Removing shortname from search_object defaults

* moving print statements under verbose option
  • Loading branch information
dr-rodriguez authored Feb 16, 2025
1 parent 05f7b5d commit 0112ab7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions astrodbkit/astrodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ def search_object(
name,
output_table=None,
resolve_simbad=False,
table_names={"Sources": ["source", "shortname"], "Names": ["other_name"]},
table_names={"Sources": ["source"], "Names": ["other_name"]},
fmt="table",
fuzzy_search=True,
verbose=True,
Expand All @@ -517,7 +517,7 @@ def search_object(
Get additional names from Simbad. Default: False
table_names : dict
Dictionary of tables to search for name information. Should be of the form table name: column name list.
Default: {'Sources': ['source', 'shortname'], 'Names': 'other_name'}
Default: {'Sources': ['source'], 'Names': 'other_name'}
fmt : str
Format to return results in (pandas, astropy/table, default). Default is astropy table
fuzzy_search : bool
Expand Down Expand Up @@ -553,6 +553,8 @@ def search_object(

# Verify provided tables exist in database
for k in table_names.keys():
if verbose:
print(f"Using table '{k}' with columns {table_names[k]} for matching object names")
if k not in self.metadata.tables:
raise RuntimeError(f"Table {k} is not in the database")

Expand Down

0 comments on commit 0112ab7

Please sign in to comment.