zztin / ctimer

This is a python implementation of a famous time management technique. CTimer helps you keep track of your productivity during the day, and help you set realistic goals for your day.
Apache License 2.0
0 stars 1 forks source link

[ctimer--overall] QuadMesh object has no property 'fig_suptitle' #38

Open zztin opened 3 years ago

zztin commented 3 years ago

Description

Describe the bug code breaks while given ctimer --overall

Steps to Reproduce

Steps to reproduce the behavior: ctimer --overall

Trackback:
/Users/lchen/miniconda/envs/ctimer-dev/lib/python3.8/site-packages/calmap-0.0.8-py3.8.egg/calmap/__init__.py:181: FutureWarning: weekofyear and week have been deprecated, please use DatetimeIndex.isocalendar().week instead, which returns a Series.  To exactly reproduce the behavior of week and weekofyear and return an Index, you may call pd.Int64Index(idx.isocalendar().week)
  "week": by_day.index.week,
Traceback (most recent call last):
  File "/Users/lchen/miniconda/envs/ctimer-dev/bin/ctimer", line 33, in <module>
    sys.exit(load_entry_point('pomodoro-ctimer', 'console_scripts', 'ctimer')())
  File "/Users/lchen/current_projects/ctimer/ctimer/cli.py", line 125, in main
    ss.plot_calmap(events=events)
  File "/Users/lchen/current_projects/ctimer/ctimer/visual/show_stats.py", line 25, in plot_calmap
    calmap.calendarplot(events, monthticks=True, daylabels='MTWTFSS',
  File "/Users/lchen/miniconda/envs/ctimer-dev/lib/python3.8/site-packages/calmap-0.0.8-py3.8.egg/calmap/__init__.py", line 348, in calendarplot
    yearplot(by_day, year=year, how=None, ax=ax, **kwargs)
  File "/Users/lchen/miniconda/envs/ctimer-dev/lib/python3.8/site-packages/calmap-0.0.8-py3.8.egg/calmap/__init__.py", line 207, in yearplot
    ax.pcolormesh(plot_data, vmin=vmin, vmax=vmax, cmap=cmap, **kwargs)
  File "/Users/lchen/miniconda/envs/ctimer-dev/lib/python3.8/site-packages/matplotlib-3.3.1-py3.8-macosx-10.9-x86_64.egg/matplotlib/__init__.py", line 1438, in inner
    return func(ax, *map(sanitize_sequence, args), **kwargs)
  File "/Users/lchen/miniconda/envs/ctimer-dev/lib/python3.8/site-packages/matplotlib-3.3.1-py3.8-macosx-10.9-x86_64.egg/matplotlib/axes/_axes.py", line 6098, in pcolormesh
    collection = mcoll.QuadMesh(Nx - 1, Ny - 1, coords,
  File "/Users/lchen/miniconda/envs/ctimer-dev/lib/python3.8/site-packages/matplotlib-3.3.1-py3.8-macosx-10.9-x86_64.egg/matplotlib/collections.py", line 1919, in __init__
    Collection.__init__(self, **kwargs)
  File "/Users/lchen/miniconda/envs/ctimer-dev/lib/python3.8/site-packages/matplotlib-3.3.1-py3.8-macosx-10.9-x86_64.egg/matplotlib/cbook/deprecation.py", line 411, in wrapper
    return func(*inner_args, **inner_kwargs)
  File "/Users/lchen/miniconda/envs/ctimer-dev/lib/python3.8/site-packages/matplotlib-3.3.1-py3.8-macosx-10.9-x86_64.egg/matplotlib/collections.py", line 213, in __init__
    self.update(kwargs)
  File "/Users/lchen/miniconda/envs/ctimer-dev/lib/python3.8/site-packages/matplotlib-3.3.1-py3.8-macosx-10.9-x86_64.egg/matplotlib/artist.py", line 996, in update
    raise AttributeError(f"{type(self).__name__!r} object "
AttributeError: 'QuadMesh' object has no property 'fig_suptitle'
tai271828 commented 3 years ago

tl;dr use the updated calmap modified by you https://github.com/zztin/calmap

The issue seems to be introduced by pandas version bump a few months ago, and the corresponding python package calmap should be updated along with the pandas version bump. The updated calmap is in your repository by forking the original calmap. : ) So, we may close this issue.