Project

General

Profile

Bug #468

Division by zero in stats

Added by Jean-Charles ROGEZ about 12 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
High
Assignee:
Start date:
04/05/2012
Due date:
% Done:

100%

Estimated time:
4.00 h
Resolution:
fixed

Description

In the statistics view, changing the filter range to month or personnalized gives the following traceback :

Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/prewikkapro/Core.py", line 389, in process
getattr(view_object, view["handler"])()
File "/usr/lib/python2.6/site-packages/prewikkapro/views/stats.py", line 741, in render
self._renderClassesTrend(criteria)
File "/usr/lib/python2.6/site-packages/prewikkapro/views/stats.py", line 730, in _renderClassesTrend
"alert.analyzer(-1).class", criteria, limit = 10, zoom_type="analyzer_classes_trend")
File "/usr/lib/python2.6/site-packages/prewikkapro/views/stats.py", line 431, in _addTimelineChart
timeline.render(title)
File "/usr/lib/python2.6/site-packages/prewikkapro/Chart.py", line 295, in render
x_labels = self._labels, series_legend=True, series_colors=colors)
File "/usr/lib/python2.6/site-packages/prewikkapro/cairoplot.py", line 2003, in dot_line_plot
plot.render()
File "/usr/lib/python2.6/site-packages/prewikkapro/cairoplot.py", line 458, in render
self.render_grid()
File "/usr/lib/python2.6/site-packages/prewikkapro/cairoplot.py", line 495, in render_grid
vertical_step = float( self.plot_width ) / ( len( self.labels[HORZ] ) - 1 )
ZeroDivisionError: float division

History

#1 Updated by Jean-Charles ROGEZ almost 12 years ago

  • Status changed from New to Assigned
  • Assignee set to Jean-Charles ROGEZ
  • Priority changed from Normal to High
  • Target version set to 1.0.1
  • Estimated time set to 4.00 h

#2 Updated by Jean-Charles ROGEZ almost 12 years ago

  • Target version changed from 1.0.1 to 1.0.2

It's a cairoplot issue similar to https://bugs.launchpad.net/cairoplot/+bug/285029.

#3 Updated by Jean-Charles ROGEZ almost 12 years ago

  • Project changed from Prewikka Pro to Prewikka
  • Target version deleted (1.0.2)

#4 Updated by Antoine LUONG about 11 years ago

  • Assignee changed from Jean-Charles ROGEZ to Antoine LUONG
  • % Done changed from 0 to 90

This bug happens when Cairoplot receives a single value (in the x_labels variable) from Prewikka.

Because of these lines in Chart.py :

if not self._got_value and empty:
    # do not add 0 only values at the beginning of the chart
    return

when the only non-null value is at the end of the chart, the bug occurs.

#5 Updated by Jean-Charles ROGEZ over 10 years ago

  • Status changed from Assigned to Resolved
  • Target version set to 113
  • % Done changed from 90 to 100
  • Resolution set to fixed

#6 Updated by Thomas ANDREJAK over 8 years ago

  • Status changed from Resolved to Closed
  • Target version changed from 113 to Prelude OSS 1.1.0

Also available in: Atom PDF