Skip to content

Commit ff37b32

Browse files
committed
K2 campaign back to string
1 parent e2ab102 commit ff37b32

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/lksearch/K2Search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def _fix_K2_sequence(self):
134134
if f"c{row['sequence_number']}{half}" in row["productFilename"]:
135135
seq_num[index] = f"{int(row['sequence_number']):02d}{letter}"
136136

137-
self.table["campaign"] = seq_num.astype(int)
137+
self.table["campaign"] = seq_num
138138

139139
def _sort_K2(self):
140140
# No specific preference for K2 HLSPs

tests/test_missionsearch.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ def test_properties():
235235
result = K2Search("EPIC 205998445", search_radius=900, campaign=3).cubedata
236236
assert len(result) == 4
237237
assert len(result.cloud_uri) == 4
238-
assert (result.campaign == 3).all()
238+
# Campaign is a string, as campaigns can have 'a' and 'b' components
239+
assert (result.campaign == "3").all()
239240

240241
result = KeplerSearch("KIC 11904151", exptime="short", quarter=[2, 3, 4]).cubedata
241242
assert len(result) == 5
@@ -251,7 +252,7 @@ def test_properties():
251252
assert (result.pipeline == "SPOC").all()
252253

253254
with pytest.raises(AttributeError, match="no attibute"):
254-
result = MASTSearch("EPIC 205998445", search_radius=900).cubedata
255+
MASTSearch("EPIC 205998445", mission='TESS', search_radius=900).cubedata.sector
255256

256257

257258
def test_source_confusion():

0 commit comments

Comments
 (0)