Skip to content

Commit 9a87456

Browse files
authored
Pinning astroquery and updating code to handle astroquery 0.4.8 changes (#92)
* Pinning astroquery and updating code to handle astroquery 0.4.8 changes * revising pinned versions
1 parent 6fde6fe commit 9a87456

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

astrodbkit/tests/test_utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def test_datetime_json_parser():
5353

5454
@mock.patch('astrodbkit.utils.Simbad.query_objectids')
5555
def test_get_simbad_names(mock_simbad):
56-
mock_simbad.return_value = Table({'ID': ['name 1', 'name 2', 'V* name 3', 'HIDDEN name']})
56+
mock_simbad.return_value = Table({'id': ['name 1', 'name 2', 'V* name 3', 'HIDDEN name']})
5757
t = get_simbad_names('twa 27')
5858
assert len(t) == 3
5959
assert t[2] == 'name 3'
@@ -63,3 +63,9 @@ def test_get_simbad_names(mock_simbad):
6363
t = get_simbad_names('WISEU J005559.88+594745.0')
6464
assert len(t) == 1
6565
assert t[0] == 'WISEU J005559.88+594745.0'
66+
67+
68+
def test_get_simbad_names_live():
69+
"""Unmocked version of the call to Simbad to catch API changes"""
70+
t = get_simbad_names("TWA 27")
71+
assert "TIC 102076870" in t

astrodbkit/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def get_simbad_names(name, verbose=False):
122122

123123
t = Simbad.query_objectids(name)
124124
if t is not None and len(t) > 0:
125-
temp = [_name_formatter(s) for s in t["ID"].tolist()]
125+
temp = [_name_formatter(s) for s in t["id"].tolist()]
126126
return [s for s in temp if s is not None and s != ""]
127127
else:
128128
if verbose:

pyproject.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ authors = [
2020
]
2121
requires-python = ">= 3.11"
2222
dependencies = [
23-
"astropy",
24-
"astroquery",
23+
"astropy>7.0",
24+
"astroquery>=0.4.9",
2525
"sqlalchemy>=2.0.38",
2626
"pandas>=1.0.4",
2727
"packaging",
@@ -34,10 +34,10 @@ test = [
3434
"pytest",
3535
"pytest-cov",
3636
"pytest-astropy",
37-
"darker==1.7.2",
38-
"black==23.9.1",
39-
"pre-commit==3.4.0",
40-
"ruff==0.3.7",
37+
"darker>=1.7.2",
38+
"black>=23.9.1",
39+
"pre-commit>=3.4.0",
40+
"ruff>=0.3.7",
4141
]
4242
docs = [
4343
"sphinx-astropy"

0 commit comments

Comments
 (0)