Changeset 7631:6b6ff7657b10 in orange


Ignore:
Timestamp:
02/10/11 10:15:09 (3 years ago)
Author:
ales_erjavec <ales.erjavec@…>
Branch:
default
Convert:
96226b9d384787cecd281e0808eda72955deef63
Message:
  • added fix_orange_imports_aggressive
  • added modules / changed names mapping
Location:
orange/fixes
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • orange/fixes/fix_changed_names.py

    r7617 r7631  
    3636           "orange.PythonVariable": "Orange.data.feature.Python", 
    3737           "orange.VarList": "Orange.data.feature.Features", 
    38            
    39            "orange.MeasureAttribute": "Orange.feature.scoring.Measure",  
     38            
     39           "orange.Distribution": "Orange.statistics.distributions.Distribution", 
     40           "orange.DiscDistribution": "Orange.statistics.distributions.DiscDistribution", 
     41           "orange.ContDistribution": "Orange.statistics.distributions.ContDistribution", 
     42           "orange.GaussianDistribution": "Orange.statistics.distributions.GaussianDistribution", 
     43           "orange.DomainDistributions": "Orange.statistics.distributions.DomainDistributions", 
     44            
    4045           "orange.BasicAttrStat": "Orange.statistics.distributions.BasicStatistics", 
    4146           "orange.DomainBasicAttrStat": "Orange.statistics.distributions.DomainBasicStatistics", 
     
    4449           "orange.ContingencyAttrClass": "Orange.statistics.distributions.ContingencyVarClass", 
    4550           "orange.ContingencyClassAttr": "Orange.statistics.distributions.ContingencyClassVar", 
    46             
     51           "orange.DomainContingency": "Orange.statistics.distributions.DomainContingency", 
     52           
     53           "orange.MeasureAttribute": "Orange.feature.scoring.Measure",  
    4754           "orange.MeasureAttribute_gainRatio": "Orange.feature.scoring.GainRatio", 
    4855           "orange.MeasureAttribute_relief": "Orange.feature.scoring.Relief", 
     
    6976           "orngFSS.FilteredLearner_Class": "Orange.feature.selection.FilteredLearner_Class", 
    7077           "orngFSS.FilteredClassifier": "Orange.feature.selection.FilteredClassifier", 
    71            "orngFSS.StepwiseLearner_Class": "Orange.classification.wrappers.StepwiseLearner_Class", 
     78           "orngFSS.StepwiseLearner_Class": "Orange.classification.wrappers.StepwiseLearner", 
    7279           "orngFSS.StepwiseLearner": "Orange.classification.wrappers.StepwiseLearner", 
    7380            
     
    8087           "orange.ImputerConstructor_average": "Orange.feature.imputation.ImputerConstructor_average", 
    8188  
    82            "orange.ExamplesDistance_Hamming": "Orange.distances.ExamplesDistance_Hamming", 
    8389           "orange.ExamplesDistance_Normalized": "Orange.distances.ExamplesDistance_Normalized", 
    84            "orange.ExamplesDistance_DTW": "Orange.distances.ExamplesDistance_DTW",  
    85            "orange.ExamplesDistance_Euclidean": "Orange.distances.ExamplesDistance_Euclidean",  
    86            "orange.ExamplesDistance_Manhattan": "Orange.distances.ExamplesDistance_Manhattan",  
    87            "orange.ExamplesDistance_Maximal": "Orange.distances.ExamplesDistance_Maximal",  
    88            "orange.ExamplesDistance_Relief": "Orange.distances.ExamplesDistance_Relief",  
    8990           "orange.ExamplesDistanceConstructor": "Orange.distances.ExamplesDistanceConstructor", 
    90            "orange.ExamplesDistanceConstructor_DTW": "Orange.distances.ExamplesDistanceConstructor_DTW",  
    91            "orange.ExamplesDistanceConstructor_Euclidean": "Orange.distances.ExamplesDistanceConstructor_Euclidean",  
    92            "orange.ExamplesDistanceConstructor_Hamming": "Orange.distances.ExamplesDistanceConstructor_Hamming", 
    93            "orange.ExamplesDistanceConstructor_Manhattan": "Orange.distances.ExamplesDistanceConstructor_Manhattan", 
    94            "orange.ExamplesDistanceConstructor_Maximal": "Orange.distances.ExamplesDistanceConstructor_Maximal", 
    95            "orange.ExamplesDistanceConstructor_Relief": "Orange.distances.ExamplesDistanceConstructor_Relief", 
     91           "orange.ExamplesDistance_Hamming": "Orange.distances.Hamming", 
     92           "orange.ExamplesDistance_DTW": "Orange.distances.DTW",  
     93           "orange.ExamplesDistance_Euclidean": "Orange.distances.Euclidean",  
     94           "orange.ExamplesDistance_Manhattan": "Orange.distances.Manhattan",  
     95           "orange.ExamplesDistance_Maximal": "Orange.distances.Maximal",  
     96           "orange.ExamplesDistance_Relief": "Orange.distances.Relief",  
     97            
     98           "orange.ExamplesDistanceConstructor_DTW": "Orange.distances.DTWConstructor",  
     99           "orange.ExamplesDistanceConstructor_Euclidean": "Orange.distances.EuclideanConstructor",  
     100           "orange.ExamplesDistanceConstructor_Hamming": "Orange.distances.HammingConstructor", 
     101           "orange.ExamplesDistanceConstructor_Manhattan": "Orange.distances.ManhattanConstructor", 
     102           "orange.ExamplesDistanceConstructor_Maximal": "Orange.distances.MaximalConstructor", 
     103           "orange.ExamplesDistanceConstructor_Relief": "Orange.distances.ReliefConstructor", 
     104            
     105           "orngClustering.ExamplesDistanceConstructor_PearsonR": "Orange.distances.PearsonRConstructor", 
     106           "orngClustering.ExamplesDistance_PearsonR": "Orange.distances.PearsonR", 
     107           "orngClustering.ExamplesDistanceConstructor_SpearmanR": "Orange.distances.SpearmanRConstructor", 
     108           "orngClustering.ExamplesDistance_SpearmanR": "Orange.distances.SpearmanR", 
     109            
     110           "orngClustering.KMeans": "Orange.clustering.kmeans.Clustering", 
     111           "orngClustering.kmeans_init_random": "Orange.clustering.kmeans.init_random", 
     112           "orngClustering.kmeans_init_diversity": "Orange.clustering.kmeans.init_diversity", 
     113           "orngClustering.KMeans_init_hierarchicalClustering": "Orange.clustering.kmeans.init_hclustering", 
     114           "orngClustering.data_center": "Orange.clustering.kmeans.data_center", 
     115           "orngClustering.plot_silhouette": "Orange.clustering.kmeans.plot_silhouette", 
     116           "orngClustering.score_distance_to_centroids": "Orange.clustering.kmeans.score_distance_to_centroids", 
     117           "orngClustering.score_silhouette": "Orange.clustering.kmeans.score_silhouette", 
     118            
     119           "orange.HierarchicalClustering": "Orange.clustering.hierarchical.HierarchicalClustering", 
     120           "orngClustering.hierarchicalClustering": "Orange.clustering.hierarchical.clustering", 
     121           "orngClustering.hierarchicalClustering_attributes": "Orange.clustering.hierarchical.clustering_features", 
     122           "orngClustering.hierarchicalClustering_clusterList": "Orange.clustering.hierarchical.cluster_to_list", 
     123           "orngClustering.hierarchicalClustering_topClusters": "Orange.clustering.hierarchical.top_clusters", 
     124           "orngClustering.hierarhicalClustering_topClustersMembership": "Orange.clustering.hierarchical.top_cluster_membership", 
     125           "orngClustering.orderLeaves": "Orange.clustering.hierarchical.order_leaves", 
    96126            
    97127           "orngSVM.RBFKernelWrapper": "Orange.classification.svm.kernels.RBFKernelWrapper", 
     
    205235           "orngCN2.ruleSt_setRules": "Orange.classification.rules.RuleStopping_SetRules", 
    206236           "orngCN2.CN2SDUnorderedLearner": "Orange.classification.rules.CN2SDUnorderedLearner", 
    207            "orngCN2.avg": "Orange.classification.rules.avg", 
    208            "orngCN2.var": "Orange.classification.rules.var", 
    209            "orngCN2.median": "Orange.classification.rules.median", 
    210            "orngCN2.perc": "Orange.classification.rules.perc", 
     237#           "orngCN2.avg": "Orange.classification.rules.avg", 
     238#           "orngCN2.var": "Orange.classification.rules.var", 
     239#           "orngCN2.median": "Orange.classification.rules.median", 
     240#           "orngCN2.perc": "Orange.classification.rules.perc", 
    211241           "orngCN2.createRandomDataSet": "Orange.classification.rules.createRandomDataSet", 
    212242           "orngCN2.compParameters": "Orange.classification.rules.compParameters", 
     
    275305           "orngStat.Wilcoxon" : "Orange.evaluation.scoring.Wilcoxon", 
    276306           "orngStat.WilcoxonPairs" : "Orange.evaluation.scoring.WilcoxonPairs", 
    277            "orngStat.add" : "Orange.evaluation.scoring.add", 
    278            "orngStat.checkArgkw" : "Orange.evaluation.scoring.checkArgkw", 
    279            "orngStat.checkNonZero" : "Orange.evaluation.scoring.checkNonZero", 
     307#           "orngStat.add" : "Orange.evaluation.scoring.add", 
     308#           "orngStat.checkArgkw" : "Orange.evaluation.scoring.checkArgkw", 
     309#           "orngStat.checkNonZero" : "Orange.evaluation.scoring.checkNonZero", 
    280310           "orngStat.classProbabilitiesFromRes" : "Orange.evaluation.scoring.classProbabilitiesFromRes", 
    281311           "orngStat.compare2AROCs" : "Orange.evaluation.scoring.compare2AROCs", 
     
    292322           "orngStat.defaultLineTypes" : "Orange.evaluation.scoring.defaultLineTypes", 
    293323           "orngStat.defaultPointTypes" : "Orange.evaluation.scoring.defaultPointTypes", 
    294            "orngStat.frange" : "Orange.evaluation.scoring.frange", 
    295            "orngStat.gettotsize" : "Orange.evaluation.scoring.gettotsize", 
    296            "orngStat.gettotweight" : "Orange.evaluation.scoring.gettotweight", 
     324#           "orngStat.frange" : "Orange.evaluation.scoring.frange", 
     325#           "orngStat.gettotsize" : "Orange.evaluation.scoring.gettotsize", 
     326#           "orngStat.gettotweight" : "Orange.evaluation.scoring.gettotweight", 
    297327           "orngStat.graph_ranks" : "Orange.evaluation.scoring.graph_ranks", 
    298328           "orngStat.isCDTEmpty" : "Orange.evaluation.scoring.isCDTEmpty", 
     
    301331           "orngStat.legend2PiCTeX" : "Orange.evaluation.scoring.legend2PiCTeX", 
    302332           "orngStat.legendLearners2PiCTeX" : "Orange.evaluation.scoring.legendLearners2PiCTeX", 
    303            "orngStat.log2" : "Orange.evaluation.scoring.log2", 
    304            "orngStat.math" : "Orange.evaluation.scoring.math", 
    305            "orngStat.numpy" : "Orange.evaluation.scoring.numpy", 
    306            "orngStat.operator" : "Orange.evaluation.scoring.operator", 
     333#           "orngStat.log2" : "Orange.evaluation.scoring.log2", 
     334#           "orngStat.math" : "Orange.evaluation.scoring.math", 
     335#           "orngStat.numpy" : "Orange.evaluation.scoring.numpy", 
     336#           "orngStat.operator" : "Orange.evaluation.scoring.operator", 
    307337           "orngStat.plotLearningCurve" : "Orange.evaluation.scoring.plotLearningCurve", 
    308338           "orngStat.plotLearningCurveLearners" : "Orange.evaluation.scoring.plotLearningCurveLearners", 
     
    320350           "orngStat.spec" : "Orange.evaluation.scoring.spec", 
    321351           "orngStat.splitByIterations" : "Orange.evaluation.scoring.splitByIterations", 
    322            "orngStat.statc" : "Orange.evaluation.scoring.statc", 
     352#           "orngStat.statc" : "Orange.evaluation.scoring.statc", 
    323353           "orngStat.statisticsByFolds" : "Orange.evaluation.scoring.statisticsByFolds", 
    324            "orngStat.x" : "Orange.evaluation.scoring.x", 
     354#           "orngStat.x" : "Orange.evaluation.scoring.x", 
    325355            
    326356           # Now use old orngMisc 
     
    383413           "orngLR.zprob":"Orange.classification.logreg.zprob", 
    384414            
     415           "orange.Preprocessor": "Orange.preprocess.Preprocessor", 
     416           "orange.Preprocessor_addCensorWeight": "Orange.preprocess.Preprocessor_addCensorWeight", 
     417           "orange.Preprocessor_addClassNoise": "Orange.preprocess.Preprocessor_addClassNoise", 
     418           "orange.Preprocessor_addClassWeight": "Orange.preprocess.Preprocessor_addClassWeight", 
     419           "orange.Preprocessor_addGaussianClassNoise": "Orange.preprocess.Preprocessor_addGaussianClassNoise", 
     420           "orange.Preprocessor_addGaussianNoise": "Orange.preprocess.Preprocessor_addGaussianNoise", 
     421           "orange.Preprocessor_addMissing": "Orange.preprocess.Preprocessor_addMissing", 
     422           "orange.Preprocessor_addMissingClasses": "Orange.preprocess.Preprocessor_addMissingClasses", 
     423           "orange.Preprocessor_addNoise": "Orange.preprocess.Preprocessor_addNoise", 
     424           "orange.Preprocessor_discretize": "Orange.preprocess.Preprocessor_discretize", 
     425           "orange.Preprocessor_drop": "Orange.preprocess.Preprocessor_drop", 
     426           "orange.Preprocessor_dropMissing": "Orange.preprocess.Preprocessor_dropMissing", 
     427           "orange.Preprocessor_dropMissingClasses": "Orange.preprocess.Preprocessor_dropMissingClasses", 
     428           "orange.Preprocessor_filter": "Orange.preprocess.Preprocessor_filter", 
     429           "orange.Preprocessor_ignore": "Orange.preprocess.Preprocessor_ignore", 
     430           "orange.Preprocessor_imputeByLearner": "Orange.preprocess.Preprocessor_imputeByLearner", 
     431           "orange.Preprocessor_removeDuplicates": "Orange.preprocess.Preprocessor_removeDuplicates", 
     432           "orange.Preprocessor_select": "Orange.preprocess.Preprocessor_select", 
     433           "orange.Preprocessor_shuffle": "Orange.preprocess.Preprocessor_shuffle", 
     434           "orange.Preprocessor_take": "Orange.preprocess.Preprocessor_take", 
     435           "orange.Preprocessor_takeMissing": "Orange.preprocess.Preprocessor_takeMissing", 
     436           "orange.Preprocessor_takeMissingClasses": "Orange.preprocess.Preprocessor_takeMissingClasses", 
     437            
     438           "orange.Discretizer": "Orange.feature.discretization.Discretizer", 
     439           "orange.BiModalDiscretizer": "Orange.feature.discretization.BiModalDiscretizer", 
     440           "orange.EquiDistDiscretizer": "Orange.feature.discretization.EquiDistDiscretizer", 
     441           "orange.IntervalDiscretizer": "Orange.feature.discretization.IntervalDiscretizer", 
     442           "orange.ThresholdDiscretizer": "Orange.feature.discretization.ThresholdDiscretizer", 
     443           "orange.EntropyDiscretization": "Orange.feature.discretization.EntropyDiscretization", 
     444           "orange.Discrete2Continuous": "Orange.feature.discretization.Discrete2Continuous", 
     445            
     446           "orange.DomainContinuizer": "Orange.feature.continuization.DomainContinuizer", 
     447            
     448           "orange.MakeRandomIndices": "Orange.data.sample.MakeRandomIndices", 
     449           "orange.MakeRandomIndicesN": "Orange.data.sample.MakeRandomIndicesN", 
     450           "orange.MakeRandomIndicesCV": "Orange.data.sample.MakeRandomIndicesCV", 
     451           "orange.MakeRandomIndicesMultiple": "Orange.data.sample.MakeRandomIndicesMultiple", 
     452           "orange.MakeRandomIndices2": "Orange.data.sample.MakeRandomIndices2", 
     453            
    385454           } 
    386455 
    387 #def build_pattern(mapping=MAPPING): 
    388 #    def split_dots(name): 
    389 #        return " '.' ".join(["'%s'" % n for n in name.split(".")]) 
    390 #         
    391 #    names = "(" + "|".join("%s" % split_dots(key) for key in mapping.keys()) + ")" 
    392 #     
    393 #    yield "power< bare_with_attr = (%s) trailer< any*> any*>"% names 
    394456     
    395457def build_pattern(mapping=MAPPING): 
  • orange/fixes/fix_changed_names_aggressive.py

    r7559 r7631  
    6868             
    6969            if all("module" not in res for res in self._import_matches):  
    70                 self.warning(node, "Aggressive name matched '%s' but no corresponding import! Fix manualy." % local) 
     70                self.warning(node, "Aggressive name matched '%s' but no corresponding import! Fix manually." % local_name) 
    7171                return 
    7272                 
  • orange/fixes/fix_orange_imports.py

    r7624 r7631  
    1717     
    1818.. note:: This fixer runs last and should be used as a last resort. Use 
    19     fix_changed_names fixer for fain grain control of name mappings. (for 
    20     instance we might want to replace the orange.SVMLearner from the core 
    21     to the one in Orange.classification.svm). 
     19    fix_changed_names fixer for fine grain control of name mappings. 
    2220   
    2321""" 
     
    3735 
    3836MAPPING = {"orange": "Orange.core", 
    39            "orangeom": "Orange.core", 
    4037           "orngSVM": "Orange.classification.svm", 
    4138           "orngSOM": "Orange.projection.som", 
     
    5047           "orngImpute": "Orange.feature.imputation", 
    5148           "orngStat": "Orange.evaluation.scoring", 
    52            "orngWrap": "Orange.optimization" 
     49           "orngWrap": "Orange.optimization", 
     50           "orngClustering": "Orange.clustering", 
    5351           } 
    5452 
Note: See TracChangeset for help on using the changeset viewer.