Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a few deprecation warnings #571

Merged
merged 5 commits into from
Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/mplfinance/_kwarg_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def kwarg_help( func_name=None, kwarg_names=None, sort=False ):
dfd.columns = df.columns
dfd.index = pd.Index(['---'])

df = dfd.append(df)
df = pd.concat([dfd,df])

formatters = { 'Kwarg' : make_left_formatter( klen ),
'Default' : make_left_formatter( dlen ),
Expand Down
9 changes: 8 additions & 1 deletion src/mplfinance/_styles.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ def _apply_mpfstyle(style):

plt.style.use('default')

if style['base_mpl_style'] is not None:
if style['base_mpl_style'] == 'seaborn-darkgrid':
# deal with deprecation of old seaborn-darkgrid:
try:
plt.style.use('seaborn-v0_8-darkgrid')
style['base_mpl_style'] = 'seaborn-v0_8-darkgrid'
except:
plt.style.use(style['base_mpl_style'])
elif style['base_mpl_style'] is not None:
plt.style.use(style['base_mpl_style'])

if style['rc'] is not None:
Expand Down
2 changes: 1 addition & 1 deletion src/mplfinance/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ def _construct_renko_collections(dates, highs, lows, volumes, config_renko_param


def _construct_pointnfig_collections(dates, highs, lows, volumes, config_pointnfig_params, closes, marketcolors=None):
"""Represent the price change with Xs and Os
r"""Represent the price change with Xs and Os

NOTE: this code assumes if any value open, low, high, close is
missing they all are missing
Expand Down
2 changes: 1 addition & 1 deletion src/mplfinance/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version_info = (0, 12, 9, 'beta', 5)
version_info = (0, 12, 9, 'beta', 6)

_specifier_ = {'alpha': 'a','beta': 'b','candidate': 'rc','final': ''}

Expand Down
4 changes: 2 additions & 2 deletions tests/test_addplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def percentB_aboveone(percentB,price):
import numpy as np
signal = []
previous = 2
for date,value in percentB.iteritems():
for date,value in percentB.items():
if value > 1 and previous <= 1:
signal.append(price[date]*1.01)
else:
Expand All @@ -82,7 +82,7 @@ def percentB_belowzero(percentB,price):
import numpy as np
signal = []
previous = -1.0
for date,value in percentB.iteritems():
for date,value in percentB.items():
if value < 0 and previous >= 0:
signal.append(price[date]*0.99)
else:
Expand Down