voly 0.0.150__py3-none-any.whl → 0.0.152__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- voly/core/hd.py +15 -1
- {voly-0.0.150.dist-info → voly-0.0.152.dist-info}/METADATA +1 -1
- {voly-0.0.150.dist-info → voly-0.0.152.dist-info}/RECORD +6 -6
- {voly-0.0.150.dist-info → voly-0.0.152.dist-info}/WHEEL +1 -1
- {voly-0.0.150.dist-info → voly-0.0.152.dist-info}/licenses/LICENSE +0 -0
- {voly-0.0.150.dist-info → voly-0.0.152.dist-info}/top_level.txt +0 -0
voly/core/hd.py
CHANGED
|
@@ -76,6 +76,7 @@ def get_historical_data(currency: str,
|
|
|
76
76
|
df_hist['date'] = pd.to_datetime(df_hist['date'], unit='ms')
|
|
77
77
|
df_hist.set_index('date', inplace=True)
|
|
78
78
|
df_hist = df_hist.sort_index(ascending=True)
|
|
79
|
+
df_hist = df_hist[~df_hist.index.duplicated(keep='last')].sort_index()
|
|
79
80
|
|
|
80
81
|
logger.info(f"Data fetched successfully: {len(df_hist)} rows from {df_hist.index[0]} to {df_hist.index[-1]}")
|
|
81
82
|
|
|
@@ -538,7 +539,20 @@ def calculate_basic_density(df_hist: pd.DataFrame,
|
|
|
538
539
|
|
|
539
540
|
# Better diagnostics for debugging
|
|
540
541
|
if len(maturity_hist) < 2:
|
|
541
|
-
|
|
542
|
+
n_available = len(df_hist)
|
|
543
|
+
earliest = df_hist.index[0] if n_available > 0 else "N/A"
|
|
544
|
+
latest = df_hist.index[-1] if n_available > 0 else "N/A"
|
|
545
|
+
|
|
546
|
+
logger.warning(f"Insufficient data for t={t:.4f} years ({lookback_days:.2f} days lookback)")
|
|
547
|
+
logger.warning(f"Available data: {n_available} points from {earliest} to {latest}")
|
|
548
|
+
logger.warning(f"Required start date: {start_date}")
|
|
549
|
+
|
|
550
|
+
# Try using all available data as fallback
|
|
551
|
+
if n_available >= 2:
|
|
552
|
+
logger.warning(f"Using all available {n_available} data points as fallback")
|
|
553
|
+
maturity_hist = df_hist.copy()
|
|
554
|
+
else:
|
|
555
|
+
raise VolyError(f"Not enough historical data for maturity (t={t:.4f})")
|
|
542
556
|
|
|
543
557
|
# Calculate scaled returns
|
|
544
558
|
maturity_hist['log_returns'] = np.log(maturity_hist['close'] / maturity_hist['close'].shift(1)) * np.sqrt(n_periods)
|
|
@@ -7,13 +7,13 @@ voly/core/__init__.py,sha256=bu6fS2I1Pj9fPPnl-zY3L7NqrZSY5Zy6NY2uMUvdhKs,183
|
|
|
7
7
|
voly/core/charts.py,sha256=E21OZB5lTY4YL2flgaFJ6s5g3_ExtAQT2zryZZxLPyM,12735
|
|
8
8
|
voly/core/data.py,sha256=pDeuYhP0GX4RbtlqByvsE3rfHcIkix0BU5MLW8sKIeI,8935
|
|
9
9
|
voly/core/fit.py,sha256=Tb9eeG7e_2dQTcqt6aqEwFrZdy6jR9rSNqe6tzOdVhQ,9245
|
|
10
|
-
voly/core/hd.py,sha256=
|
|
10
|
+
voly/core/hd.py,sha256=inw1AfGKgOfFsuiYELxcCrnRs8fM0JIKlO4L2MQBBC8,30431
|
|
11
11
|
voly/core/interpolate.py,sha256=JkK172-FXyhesW3hY4pEeuJWG3Bugq7QZXbeKoRpLuo,5305
|
|
12
12
|
voly/core/rnd.py,sha256=AvGsITB52-Ti9AOA2lj2N4UAyJUtD-Bs37HRwLbzRsA,16043
|
|
13
13
|
voly/utils/__init__.py,sha256=E05mWatyC-PDOsCxQV1p5Xi1IgpOomxrNURyCx_gB-w,200
|
|
14
14
|
voly/utils/logger.py,sha256=4-_2bVJmq17Q0d7Rd2mPg1AeR8gxv6EPvcmBDMFWcSM,1744
|
|
15
|
-
voly-0.0.
|
|
16
|
-
voly-0.0.
|
|
17
|
-
voly-0.0.
|
|
18
|
-
voly-0.0.
|
|
19
|
-
voly-0.0.
|
|
15
|
+
voly-0.0.152.dist-info/licenses/LICENSE,sha256=wcHIVbE12jfcBOai_wqBKY6xvNQU5E909xL1zZNq_2Q,1065
|
|
16
|
+
voly-0.0.152.dist-info/METADATA,sha256=ojr_D--Jhv-Ldsfql3-PGcx0TAFaxMADg37TaYsKyNI,4115
|
|
17
|
+
voly-0.0.152.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
18
|
+
voly-0.0.152.dist-info/top_level.txt,sha256=ZfLw2sSxF-LrKAkgGjOmeTcw6_gD-30zvtdEY5W4B7c,5
|
|
19
|
+
voly-0.0.152.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|