Skip to content

Commit 9c2df22

Browse files
committed
Update dependencies
Includes all necessary revisions to support pandas 3.0.0.
1 parent ce551ec commit 9c2df22

8 files changed

Lines changed: 348 additions & 285 deletions

File tree

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.10
1+
3.13

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ dependencies = [
5656
"market-prices",
5757
"matplotlib",
5858
"numpy",
59-
"pandas",
59+
"pandas",
6060
"traitlets",
6161
"tzdata",
6262
"ipyvuetify",

requirements.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ decorator==5.2.1
3232
# via ipython
3333
exceptiongroup==1.3.1 ; python_full_version < '3.11'
3434
# via ipython
35-
exchange-calendars==4.12
35+
exchange-calendars==4.13.1
3636
# via
3737
# market-analy
3838
# market-prices
@@ -44,7 +44,7 @@ idna==3.11
4444
# via requests
4545
ipython==8.38.0 ; python_full_version < '3.11'
4646
# via ipywidgets
47-
ipython==9.9.0 ; python_full_version >= '3.11'
47+
ipython==9.10.0 ; python_full_version >= '3.11'
4848
# via ipywidgets
4949
ipython-pygments-lexers==1.1.1 ; python_full_version >= '3.11'
5050
# via ipython
@@ -69,7 +69,7 @@ korean-lunar-calendar==0.3.1
6969
# via exchange-calendars
7070
lxml==6.0.2
7171
# via yahooquery
72-
market-prices==0.12.11
72+
market-prices==0.12.12
7373
# via market-analy
7474
markupsafe==3.0.3
7575
# via jinja2
@@ -86,7 +86,7 @@ numpy==2.2.6 ; python_full_version < '3.11'
8686
# market-prices
8787
# matplotlib
8888
# pandas
89-
numpy==2.4.1 ; python_full_version >= '3.11'
89+
numpy==2.4.2 ; python_full_version >= '3.11'
9090
# via
9191
# bqplot
9292
# contourpy
@@ -95,7 +95,7 @@ numpy==2.4.1 ; python_full_version >= '3.11'
9595
# market-prices
9696
# matplotlib
9797
# pandas
98-
packaging==25.0
98+
packaging==26.0
9999
# via matplotlib
100100
pandas==2.3.3
101101
# via
@@ -116,15 +116,15 @@ ptyprocess==0.7.0 ; sys_platform != 'emscripten' and sys_platform != 'win32'
116116
# via pexpect
117117
pure-eval==0.2.3
118118
# via stack-data
119-
pycparser==2.23 ; implementation_name != 'PyPy'
119+
pycparser==3.0 ; implementation_name != 'PyPy'
120120
# via cffi
121121
pygments==2.19.2
122122
# via
123123
# ipython
124124
# ipython-pygments-lexers
125125
pyluach==2.3.0
126126
# via exchange-calendars
127-
pyparsing==3.3.1
127+
pyparsing==3.3.2
128128
# via matplotlib
129129
python-dateutil==2.9.0.post0
130130
# via
@@ -138,13 +138,13 @@ requests-futures==1.0.2
138138
# via yahooquery
139139
six==1.17.0
140140
# via python-dateutil
141-
soupsieve==2.8.1
141+
soupsieve==2.8.3
142142
# via beautifulsoup4
143143
stack-data==0.6.3
144144
# via ipython
145145
toolz==1.1.0
146146
# via exchange-calendars
147-
tqdm==4.67.1
147+
tqdm==4.67.3
148148
# via yahooquery
149149
traitlets==5.14.3
150150
# via
@@ -171,7 +171,7 @@ urllib3==2.6.3
171171
# via requests
172172
valimp==0.4
173173
# via market-prices
174-
wcwidth==0.2.14
174+
wcwidth==0.5.3
175175
# via prompt-toolkit
176176
widgetsnbextension==4.0.15
177177
# via ipywidgets

tests/conftest.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,17 @@ def _mock_now(*args, **kwargs) -> pd.Timestamp:
103103
for bi in prices.bis:
104104
data = prices._pdata[bi]
105105
data._ranges, data._ll, data._rl, data._table = pickle.load(file)
106+
if data._table is not None:
107+
# Requried as pickled with previous version of pandas when Index was
108+
# inferred as having 'object' dtype. NB if test suit run with pandas
109+
# 2.3.3 then columns will be inferred as 'object' regardless of
110+
# astype("str") here
111+
df = data._table
112+
arrays = [
113+
df.columns.get_level_values(i).astype("str")
114+
for i in range(df.columns.nlevels)
115+
]
116+
data._table.columns = pd.MultiIndex.from_arrays(arrays)
106117

107118
return prices
108119

tests/test_analysis.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import numpy as np
1717
import pandas as pd
1818
import pytest
19-
from pandas import Timestamp as T # noqa: N817
2019
from pandas.testing import assert_frame_equal, assert_index_equal, assert_series_equal
2120

2221
from market_analy import analysis, charts, guis
@@ -30,6 +29,10 @@
3029
# ruff: noqa: E501 # line-too-long
3130

3231

32+
def T(arg: str, **kwargs) -> pd.Timestamp:
33+
return pd.Timestamp(arg, **kwargs).as_unit("ns")
34+
35+
3336
def verify_app(f, cls, *args, **kwargs):
3437
"""Verify `f` returns instance of `cls` and displays a `ipyvuetify.App`."""
3538
stdout = io.StringIO()
@@ -334,7 +337,7 @@ def test_daily_prices(self, analy, daily_pp, intraday_pp):
334337
T("2023-01-09 00:00:00"): 1989665.0,
335338
T("2023-01-10 00:00:00"): 3318361.0,
336339
},
337-
}
340+
},
338341
)
339342

340343
expected.columns.name = ""

tests/test_trends.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ def assert_moves_as_saved(path: pathlib.Path, moves: list[Movement]):
5959
loaded = pickle.load(file)
6060
except EOFError:
6161
break
62+
63+
if pd.__version__ >= "3.0.0":
64+
loaded.line_break.index = loaded.line_break.index.as_unit("us")
65+
loaded.line_limit.index = loaded.line_limit.index.as_unit("us")
66+
6267
assert m == loaded
6368
file.close()
6469

tests/test_trends_alt.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,21 @@ def test_dji_1D(path_res, data_dji_1D_alt):
6464
loaded = pickle.load(file)
6565
except EOFError:
6666
break
67+
68+
if pd.__version__ >= "3.0.0":
69+
loaded.sel.index = loaded.sel.index.as_unit("us")
70+
loaded.start_conf_line.index = loaded.start_conf_line.index.as_unit(
71+
"us"
72+
)
73+
loaded.end_line_consol.index = loaded.end_line_consol.index.as_unit(
74+
"us"
75+
)
76+
loaded.end_line_rvr.index = loaded.end_line_rvr.index.as_unit("us")
77+
if loaded.end_line_rvr_opp is not None:
78+
loaded.end_line_rvr_opp.index = (
79+
loaded.end_line_rvr_opp.index.as_unit("us")
80+
)
81+
if loaded.eel is not None:
82+
loaded.eel.index = loaded.eel.index.as_unit("us")
83+
6784
assert move == loaded

0 commit comments

Comments
 (0)