5 |
# This program is free software under the GPL (>=v2) |
# This program is free software under the GPL (>=v2) |
6 |
# Read the file COPYING coming with Thuban for details. |
# Read the file COPYING coming with Thuban for details. |
7 |
|
|
8 |
|
""" |
9 |
|
ClassGenerator |
10 |
|
""" |
11 |
|
|
12 |
|
__version__ = "$Revision$" |
13 |
|
# $Source$ |
14 |
|
# $Id$ |
15 |
|
|
16 |
import operator |
import operator |
17 |
|
|
18 |
from color import Color |
from color import Color |
103 |
|
|
104 |
# this check guards against rounding issues |
# this check guards against rounding issues |
105 |
if cur_min != cur_max: |
if cur_min != cur_max: |
106 |
range = Range("[" + str(float(cur_min)) + ";" + |
range = Range(("[", cur_min, cur_max, end)) |
|
str(float(cur_max)) + end) |
|
107 |
clazz.AppendGroup(ClassGroupRange(range, None, prop)) |
clazz.AppendGroup(ClassGroupRange(range, None, prop)) |
108 |
|
|
109 |
cur_min = cur_max |
cur_min = cur_max |
148 |
|
|
149 |
start, min, endMax, right = _range.GetRange() |
start, min, endMax, right = _range.GetRange() |
150 |
|
|
|
if str(min) == '-inf': |
|
|
min = "-oo" |
|
|
elif str(min) == 'inf': |
|
|
min = "oo" |
|
|
|
|
|
if str(endMax) == '-inf': |
|
|
endMax = "-oo" |
|
|
elif str(endMax) == 'inf': |
|
|
endMax = "oo" |
|
|
|
|
151 |
oldp = 0 |
oldp = 0 |
152 |
i = 1 |
i = 1 |
153 |
end = "]" |
end = "]" |
159 |
else: |
else: |
160 |
max = _list[q] |
max = _list[q] |
161 |
|
|
162 |
group = ClassGroupRange(Range(start + str(min) + ";" + |
group = ClassGroupRange(Range((start, min, max, end)), |
|
str(max) + end), |
|
163 |
None, prop) |
None, prop) |
164 |
|
|
165 |
group.SetLabel("%s%% - %s%%" % (round(oldp*100, 2), |
group.SetLabel("%s%% - %s%%" % (round(oldp*100, 2), |