/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/UI/classgen.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/UI/classgen.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1122 by bh, Mon Jun 2 13:47:01 2003 UTC revision 1163 by jonathan, Thu Jun 12 12:41:31 2003 UTC
# Line 21  from Thuban.Model.range import Range Line 21  from Thuban.Model.range import Range
21  import classifier, resource  import classifier, resource
22    
23  from Thuban.Model.classgen import \  from Thuban.Model.classgen import \
24      GenUniformDistribution, GenSingletonsFromList, GenQuantiles, \      generate_uniform_distribution, generate_singletons, generate_quantiles, \
25      CustomRamp, GreyRamp, RedRamp, GreenRamp, BlueRamp, GreenToRedRamp, \      CustomRamp, GreyRamp, RedRamp, GreenRamp, BlueRamp, GreenToRedRamp, \
26      HotToColdRamp      HotToColdRamp
27    
# Line 211  class ClassGenDialog(wxDialog): Line 211  class ClassGenDialog(wxDialog):
211                      and max is not None \                      and max is not None \
212                      and numGroups is not None:                      and numGroups is not None:
213    
214                      self.clazz = GenUniformDistribution(                      self.clazz = generate_uniform_distribution(
215                                  min, max, numGroups, ramp,                                  min, max, numGroups, ramp,
216                                  self.type == FIELDTYPE_INT)                                  self.type == FIELDTYPE_INT)
217    
# Line 224  class ClassGenDialog(wxDialog): Line 224  class ClassGenDialog(wxDialog):
224                  if len(list) > 0 \                  if len(list) > 0 \
225                      and numGroups is not None:                      and numGroups is not None:
226    
227                      self.clazz = GenSingletonsFromList(                      self.clazz = generate_singletons(
228                                      list, numGroups, ramp)                                      list, numGroups, ramp)
229    
230                      self.parent._SetClassification(self.clazz)                      self.parent._SetClassification(self.clazz)
# Line 238  class ClassGenDialog(wxDialog): Line 238  class ClassGenDialog(wxDialog):
238                  delta = 1 / float(numGroups)                  delta = 1 / float(numGroups)
239                  percents = [delta * i for i in range(1, numGroups + 1)]                  percents = [delta * i for i in range(1, numGroups + 1)]
240                  adjusted, self.clazz = \                  adjusted, self.clazz = \
241                      GenQuantiles(_list, percents, ramp, _range)                      generate_quantiles(_list, percents, ramp, _range)
242    
243                  if adjusted:                  if adjusted:
244                      dlg = wxMessageDialog(self,                      dlg = wxMessageDialog(self,
# Line 554  class GenUniformPanel(wxPanel): Line 554  class GenUniformPanel(wxPanel):
554          return valid          return valid
555    
556      def __CalcStepping(self, min, max, ngroups):      def __CalcStepping(self, min, max, ngroups):
         step = (max - min) / float(ngroups)  
557          if self.fieldType == FIELDTYPE_INT:          if self.fieldType == FIELDTYPE_INT:
558              step = int(step)              step = int((max - min + 1) / float(ngroups))
559            else:
560                step = (max - min) / float(ngroups)
561    
562          return step          return step
563    

Legend:
Removed from v.1122  
changed lines
  Added in v.1163

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26