Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion astrodbkit/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_datetime_json_parser():

@mock.patch('astrodbkit.utils.Simbad.query_objectids')
def test_get_simbad_names(mock_simbad):
mock_simbad.return_value = Table({'ID': ['name 1', 'name 2', 'V* name 3', 'HIDDEN name']})
mock_simbad.return_value = Table({'id': ['name 1', 'name 2', 'V* name 3', 'HIDDEN name']})
t = get_simbad_names('twa 27')
assert len(t) == 3
assert t[2] == 'name 3'
Expand All @@ -63,3 +63,9 @@ def test_get_simbad_names(mock_simbad):
t = get_simbad_names('WISEU J005559.88+594745.0')
assert len(t) == 1
assert t[0] == 'WISEU J005559.88+594745.0'


def test_get_simbad_names_live():
"""Unmocked version of the call to Simbad to catch API changes"""
t = get_simbad_names("TWA 27")
assert "TIC 102076870" in t
2 changes: 1 addition & 1 deletion astrodbkit/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def get_simbad_names(name, verbose=False):

t = Simbad.query_objectids(name)
if t is not None and len(t) > 0:
temp = [_name_formatter(s) for s in t["ID"].tolist()]
temp = [_name_formatter(s) for s in t["id"].tolist()]
return [s for s in temp if s is not None and s != ""]
else:
if verbose:
Expand Down
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ authors = [
]
requires-python = ">= 3.11"
dependencies = [
"astropy",
"astroquery",
"astropy>7.0",
"astroquery>=0.4.9",
"sqlalchemy>=2.0.38",
"pandas>=1.0.4",
"packaging",
Expand All @@ -34,10 +34,10 @@ test = [
"pytest",
"pytest-cov",
"pytest-astropy",
"darker==1.7.2",
"black==23.9.1",
"pre-commit==3.4.0",
"ruff==0.3.7",
"darker>=1.7.2",
"black>=23.9.1",
"pre-commit>=3.4.0",
"ruff>=0.3.7",
]
docs = [
"sphinx-astropy"
Expand Down