Skip to content

Commit

Permalink
Merge pull request #571 from DanielGoldfarb/master
Browse files Browse the repository at this point in the history
Fix a few deprecation warnings
  • Loading branch information
DanielGoldfarb authored Nov 22, 2022
2 parents 120ded9 + 162fa89 commit ca994ab
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
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

0 comments on commit ca994ab

Please sign in to comment.