Skip to content

Commit

Permalink
tickets/SP-1675: accommodate new shape of seq_num in the consdb (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
ehneilsen authored Oct 23, 2024
2 parents e27d29c + e664345 commit 725e2e8
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion rubin_scheduler/utils/consdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,22 @@ def eff_time_m5(self) -> pd.Series:
"""
return self.consdb_visits["eff_time_m5"]

@cached_property
def seq_num(self) -> pd.Series:
"""The sequences number.
Returns
-------
seq_num : `pd.Series`
The sequence number.
"""
if len(self.consdb_visits["seq_num"]) == 1:
seq_num = self.consdb_visits["seq_num"]
else:
seq_num = pd.Series(self.consdb_visits["seq_num"].values[:, 0], index=self.consdb_visits.index)

return seq_num

@cached_property
def opsim(self) -> pd.DataFrame:
"""The table of visits, in a format replicating opsim output.
Expand Down Expand Up @@ -858,7 +874,7 @@ def opsim(self) -> pd.DataFrame:
# "scripted_id": None,
"start_date": self.consdb_visits["obs_start"],
"t_eff": self.consdb_visits["eff_time_median"],
"seq_num": self.consdb_visits["seq_num"],
"seq_num": self.seq_num,
}
)

Expand Down

0 comments on commit 725e2e8

Please sign in to comment.