[GRASS-dev] [GRASS GIS] #2824: g.gui.timeline throws exception when trying to display temporal dataset.

GRASS GIS trac at osgeo.org
Tue Dec 22 06:13:15 PST 2015


#2824: g.gui.timeline throws exception when trying to display temporal dataset.
--------------------------+----------------------------
  Reporter:  pmav99       |      Owner:  grass-dev@…
      Type:  defect       |     Status:  new
  Priority:  normal       |  Milestone:  7.0.3
 Component:  wxGUI        |    Version:  7.0.1
Resolution:               |   Keywords:  g.gui.timeline
       CPU:  Unspecified  |   Platform:  Unspecified
--------------------------+----------------------------

Comment (by neteler):

 Replying to [comment:7 annakrat]:
 > There is already try except, do you want to hide the traceback?

 Yes.

 > But this is unrelated to the problem, is it working if you specify a
 correct dataset?

 Ok, if the dataset was created but is yet empty (simulating a new user or
 so here):

 {{{
 GRASS 7.1.svn (NC_spm_temporal_workshop):~ > g.gui.timeline tempmean
 Traceback (most recent call last):
   File "/home/neteler/software/grass71/dist.x86_64-pc-linux-
 gnu/scripts/g.gui.timeline", line 64, in <module>
     main()
   File "/home/neteler/software/grass71/dist.x86_64-pc-linux-
 gnu/scripts/g.gui.timeline", line 57, in main
     frame.SetDatasets(datasets)
   File "/home/neteler/software/grass71/dist.x86_64-pc-linux-
 gnu/gui/wxpython/timeline/frame.py", line 452, in SetDatasets
     self._redraw()
   File "/home/neteler/software/grass71/dist.x86_64-pc-linux-
 gnu/gui/wxpython/timeline/frame.py", line 366, in _redraw
     self._draw2dFigure()
   File "/home/neteler/software/grass71/dist.x86_64-pc-linux-
 gnu/gui/wxpython/timeline/frame.py", line 322, in _draw2dFigure
     self.fig.autofmt_xdate()
   File "/usr/lib64/python2.7/site-packages/matplotlib/figure.py", line
 447, in autofmt_xdate
     for label in self.axes[0].get_xticklabels():
   File "/usr/lib64/python2.7/site-packages/matplotlib/axes/_base.py", line
 2661, in get_xticklabels
     which=which))
   File "/usr/lib64/python2.7/site-packages/matplotlib/axis.py", line 1214,
 in get_ticklabels
     return self.get_majorticklabels()
   File "/usr/lib64/python2.7/site-packages/matplotlib/axis.py", line 1168,
 in get_majorticklabels
     ticks = self.get_major_ticks()
   File "/usr/lib64/python2.7/site-packages/matplotlib/axis.py", line 1297,
 in get_major_ticks
     numticks = len(self.get_major_locator()())
   File "/usr/lib64/python2.7/site-packages/matplotlib/dates.py", line 866,
 in __call__
     self.refresh()
   File "/usr/lib64/python2.7/site-packages/matplotlib/dates.py", line 883,
 in refresh
     dmin, dmax = self.viewlim_to_dt()
   File "/usr/lib64/python2.7/site-packages/matplotlib/dates.py", line 627,
 in viewlim_to_dt
     return num2date(vmin, self.tz), num2date(vmax, self.tz)
   File "/usr/lib64/python2.7/site-packages/matplotlib/dates.py", line 345,
 in num2date
     return _from_ordinalf(x, tz)
   File "/usr/lib64/python2.7/site-packages/matplotlib/dates.py", line 225,
 in _from_ordinalf
     dt = datetime.datetime.fromordinal(ix)
 ValueError: ordinal must be >= 1
 }}}

 ... sure, a user error but perhaps worthwhile catching it, too.

 Then I filled "tempmean" with content, i.e. I used t.register. Now

  g.gui.timeline tempmean

 works fine.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2824#comment:8>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list