Skip to content

Commit 72e7537

Browse files
committed
fix: Use lowercase 'h' freq alias for pandas compatibility
Pandas 3.0+ removed uppercase frequency aliases. Replace freq='H' with freq='h' in test fixtures to fix CI failures.
1 parent f8d96ef commit 72e7537

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

test_patterns.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def setUp(self):
1818
self.enhanced_detector = EnhancedPatternDetector()
1919

2020
# Create synthetic price data for testing
21-
dates = pd.date_range(start='2024-01-01', periods=100, freq='H')
21+
dates = pd.date_range(start='2024-01-01', periods=100, freq='h')
2222
self.test_prices = pd.DataFrame({
2323
't': dates,
2424
'o': np.random.randn(100).cumsum() + 100,
@@ -61,7 +61,7 @@ def test_max_min_detection(self):
6161
def test_pattern_detection(self):
6262
"""Test basic pattern detection"""
6363
# Create synthetic data with known pattern
64-
dates = pd.date_range(start='2024-01-01', periods=50, freq='H')
64+
dates = pd.date_range(start='2024-01-01', periods=50, freq='h')
6565

6666
# Create inverse head and shoulders pattern
6767
values = []
@@ -100,7 +100,7 @@ def test_pattern_detection(self):
100100
def test_triangle_pattern_detection(self):
101101
"""Test triangle pattern detection"""
102102
# Create synthetic triangle pattern
103-
dates = pd.date_range(start='2024-01-01', periods=30, freq='H')
103+
dates = pd.date_range(start='2024-01-01', periods=30, freq='h')
104104

105105
# Ascending triangle: flat top, rising bottom
106106
highs = [100] * 30 # Flat resistance
@@ -133,7 +133,7 @@ def test_triangle_pattern_detection(self):
133133
def test_wedge_pattern_detection(self):
134134
"""Test wedge pattern detection"""
135135
# Create synthetic wedge pattern
136-
dates = pd.date_range(start='2024-01-01', periods=25, freq='H')
136+
dates = pd.date_range(start='2024-01-01', periods=25, freq='h')
137137

138138
# Rising wedge: converging upward
139139
values = []
@@ -152,7 +152,7 @@ def test_wedge_pattern_detection(self):
152152
def test_flag_pattern_detection(self):
153153
"""Test flag pattern detection"""
154154
# Create synthetic flag pattern
155-
dates = pd.date_range(start='2024-01-01', periods=30, freq='H')
155+
dates = pd.date_range(start='2024-01-01', periods=30, freq='h')
156156

157157
# Bull flag: strong upward move followed by slight consolidation
158158
values = []
@@ -182,7 +182,7 @@ def test_flag_pattern_detection(self):
182182
def test_channel_pattern_detection(self):
183183
"""Test channel pattern detection"""
184184
# Create synthetic channel pattern
185-
dates = pd.date_range(start='2024-01-01', periods=40, freq='H')
185+
dates = pd.date_range(start='2024-01-01', periods=40, freq='h')
186186

187187
# Ascending channel
188188
values = []
@@ -210,7 +210,7 @@ def test_channel_pattern_detection(self):
210210
def test_cup_and_handle_detection(self):
211211
"""Test cup and handle pattern detection"""
212212
# Create synthetic cup and handle pattern
213-
dates = pd.date_range(start='2024-01-01', periods=45, freq='H')
213+
dates = pd.date_range(start='2024-01-01', periods=45, freq='h')
214214

215215
# Cup and handle: U-shape followed by small consolidation
216216
values = []

0 commit comments

Comments
 (0)