Changeset 7616:c392c6b940c3 in orange


Ignore:
Timestamp:
02/07/11 11:18:51 (3 years ago)
Author:
ales_erjavec <ales.erjavec@…>
Branch:
default
Convert:
7fc397fc7afe172764112bce351747f8736143df
Message:
  • fixed some old style exceptions
Location:
orange/Orange
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orange/Orange/classification/wrappers.py

    r7199 r7616  
    1515 
    1616    if self.removeThreshold < self.addThreshold: 
    17         raise "'removeThreshold' should be larger or equal to 'addThreshold'" 
     17        raise ValueError("'removeThreshold' should be larger or equal to 'addThreshold'") 
    1818 
    1919    classVar = examples.domain.classVar 
  • orange/Orange/evaluation/testing.py

    r7609 r7616  
    732732 
    733733    if not examples: 
    734         raise SystemError, "Test data set with no examples" 
     734        raise ValueError("Test data set with no examples") 
    735735    if not examples.domain.classVar: 
    736         raise "Test data set without class attribute" 
     736        raise ValueError("Test data set without class attribute") 
    737737     
    738738##    for pp in pps: 
  • orange/Orange/optimization/__init__.py

    r7592 r7616  
    431431    def __call__(self, examples, weightID = 0): 
    432432        if not hasattr(self, "learner"): 
    433             raise "learner not set" 
     433            raise AttributeError("learner not set") 
    434434         
    435435        classifier = self.learner(examples, weightID) 
     
    524524    def __call__(self, examples, weightID = 0): 
    525525        if not hasattr(self, "learner"): 
    526             raise "learner not set" 
     526            raise AttributeError("learner not set") 
    527527        if not hasattr(self, "threshold"): 
    528             raise "threshold not set" 
     528            raise AttributeError("threshold not set") 
    529529        if len(examples.domain.classVar.values)!=2: 
    530             raise "ThresholdLearner handles binary classes only" 
     530            raise ValueError("ThresholdLearner handles binary classes only") 
    531531         
    532532        return ThresholdClassifier(self.learner(examples, weightID),  
Note: See TracChangeset for help on using the changeset viewer.