Skip to content

Commit

Permalink
Update & deprecate mpl_toolkits.{gtk,excel}tools.
Browse files Browse the repository at this point in the history
- On Py2, np.rec.fromarrays cannot take a unicode string as names (but
this module __future__-imports unicode_strings).

- CallbackRegistry ctor signature has changed.
  • Loading branch information
anntzer committed Jun 8, 2016
1 parent 2303df6 commit 04217ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions lib/mpl_toolkits/exceltools.py
Expand Up @@ -33,6 +33,9 @@
import matplotlib.mlab as mlab


cbook.warn_deprecated("2.0", name="mpl_toolkits.exceltools", obj_type="module")


def xlformat_factory(format):
"""
copy the format, perform any overrides, and attach an xlstyle instance
Expand Down
8 changes: 6 additions & 2 deletions lib/mpl_toolkits/gtktools.py
Expand Up @@ -36,6 +36,7 @@

from matplotlib.externals import six
from matplotlib.externals.six.moves import xrange, zip
from matplotlib.cbook import warn_deprecated

import copy
import gtk, gobject
Expand All @@ -44,6 +45,9 @@
import matplotlib.mlab as mlab


warn_deprecated("2.0", name="mpl_toolkits.gtktools", obj_type="module")


def error_message(msg, parent=None, title=None):
"""
create an error message dialog with string msg. Optionally set
Expand Down Expand Up @@ -387,7 +391,7 @@ def __init__(self, r, formatd=None, stringd=None):
formatd = mlab.get_formatd(r)

self.stringd = stringd
self.callbacks = cbook.CallbackRegistry(['cell_changed'])
self.callbacks = cbook.CallbackRegistry()

self.r = r

Expand Down Expand Up @@ -599,7 +603,7 @@ def edit_recarray(r, formatd=None, stringd=None, constant=None, autowin=True):
clientid = list(xrange(N)) # ints

r = np.rec.fromarrays([clientid, dates, weekdays, gains, prices, up],
names='clientid,date,weekdays,gains,prices,up')
names=str('clientid,date,weekdays,gains,prices,up'))

# some custom formatters
formatd = mlab.get_formatd(r)
Expand Down

0 comments on commit 04217ce

Please sign in to comment.