it's an error not to provide halving dates

This commit is contained in:
sam
2024-11-17 15:53:14 -08:00
parent 41c62e1af2
commit ca69495071
+3
View File
@@ -28,6 +28,9 @@ def get_cycle_position(date, halving_dates):
Calculate position in halving cycle (0 to 1) for a given date.
0 represents a halving event, 1 represents just before the next halving.
"""
if len(halving_dates) == 0:
raise Exception("halving dates cannot be empty")
# Convert date to datetime if it's not already
date = pd.to_datetime(date)