fix emojies
This commit is contained in:
@@ -83,7 +83,7 @@ class HistoricalDataLoader:
|
||||
# For 1s/1m, we want to return immediately if valid
|
||||
if timeframe not in ['1s', '1m']:
|
||||
elapsed_ms = (time.time() - start_time_ms) * 1000
|
||||
logger.debug(f"⚡ Memory cache hit for {symbol} {timeframe} ({elapsed_ms:.1f}ms)")
|
||||
logger.debug(f"Memory cache hit for {symbol} {timeframe} ({elapsed_ms:.1f}ms)")
|
||||
return cached_data
|
||||
|
||||
try:
|
||||
@@ -221,7 +221,7 @@ class HistoricalDataLoader:
|
||||
timeframe=timeframe,
|
||||
df=df
|
||||
)
|
||||
logger.info(f"💾 Stored {stored_count} new candles in DuckDB")
|
||||
logger.info(f"Stored {stored_count} new candles in DuckDB")
|
||||
|
||||
# Cache in memory
|
||||
self.memory_cache[cache_key] = (df.copy(), datetime.now())
|
||||
|
||||
@@ -22,14 +22,14 @@ def test_data_loader():
|
||||
# Initialize DataProvider
|
||||
print("\n1. Initializing DataProvider...")
|
||||
data_provider = DataProvider()
|
||||
print(f" ✓ DataProvider initialized")
|
||||
print(f" DataProvider initialized")
|
||||
print(f" - Symbols: {data_provider.symbols}")
|
||||
print(f" - Timeframes: {data_provider.timeframes}")
|
||||
|
||||
# Initialize HistoricalDataLoader
|
||||
print("\n2. Initializing HistoricalDataLoader...")
|
||||
data_loader = HistoricalDataLoader(data_provider)
|
||||
print(f" ✓ HistoricalDataLoader initialized")
|
||||
print(f" HistoricalDataLoader initialized")
|
||||
|
||||
# Test loading data for ETH/USDT
|
||||
print("\n3. Testing data loading for ETH/USDT...")
|
||||
@@ -39,7 +39,7 @@ def test_data_loader():
|
||||
for timeframe in timeframes:
|
||||
df = data_loader.get_data(symbol, timeframe, limit=100)
|
||||
if df is not None and not df.empty:
|
||||
print(f" ✓ {timeframe}: Loaded {len(df)} candles")
|
||||
print(f" {timeframe}: Loaded {len(df)} candles")
|
||||
print(f" Latest: {df.index[-1]} - Close: ${df['close'].iloc[-1]:.2f}")
|
||||
else:
|
||||
print(f" ✗ {timeframe}: No data available")
|
||||
@@ -47,7 +47,7 @@ def test_data_loader():
|
||||
# Test multi-timeframe loading
|
||||
print("\n4. Testing multi-timeframe loading...")
|
||||
multi_data = data_loader.get_multi_timeframe_data(symbol, timeframes, limit=50)
|
||||
print(f" ✓ Loaded data for {len(multi_data)} timeframes")
|
||||
print(f" Loaded data for {len(multi_data)} timeframes")
|
||||
for tf, df in multi_data.items():
|
||||
print(f" {tf}: {len(df)} candles")
|
||||
|
||||
@@ -59,24 +59,24 @@ def test_data_loader():
|
||||
range_preset = '1d'
|
||||
start_time, end_time = time_manager.calculate_time_range(center_time, range_preset)
|
||||
|
||||
print(f" ✓ Time range calculated for '{range_preset}':")
|
||||
print(f" Time range calculated for '{range_preset}':")
|
||||
print(f" Start: {start_time}")
|
||||
print(f" End: {end_time}")
|
||||
|
||||
increment = time_manager.get_navigation_increment(range_preset)
|
||||
print(f" ✓ Navigation increment: {increment}")
|
||||
print(f" Navigation increment: {increment}")
|
||||
|
||||
# Test data boundaries
|
||||
print("\n6. Testing data boundaries...")
|
||||
earliest, latest = data_loader.get_data_boundaries(symbol, '1m')
|
||||
if earliest and latest:
|
||||
print(f" ✓ Data available from {earliest} to {latest}")
|
||||
print(f" Data available from {earliest} to {latest}")
|
||||
print(f" Total span: {latest - earliest}")
|
||||
else:
|
||||
print(f" ✗ Could not determine data boundaries")
|
||||
|
||||
print("\n" + "=" * 60)
|
||||
print("✓ All tests completed successfully!")
|
||||
print("All tests completed successfully!")
|
||||
print("=" * 60)
|
||||
print("\nThe data loader is ready to use with the annotation UI.")
|
||||
print("It uses the same DataProvider as training/inference systems.")
|
||||
|
||||
Reference in New Issue
Block a user