Changes between Version 14 and Version 15 of Orange25


Ignore:
Timestamp:
04/12/11 11:56:44 (3 years ago)
Author:
marko
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Orange25

    v14 v15  
    2020 
    2121For now, all C++ code is accessible both with CamelCase and underscore separated [wiki:Orange25/C++CamelCase (detailed description)]. Python code should be converted with [wiki:Orange25/NameDeprecationDecorators name deprecation decorators] (see the page for an example). 
    22  
    23 ==== C++ underscores vs. camelCase ==== 
    24  
    25 The names of attributes and methods in C++ classes have been modified to underscore form (Value.var_type instead of Value.varType). Class names are in CamelCase (e.g. BayesClassifier). Names of functions within the module, e.g. orange.getClassDistributions are still in mixedCase. 
    26  
    27 Old names still work, except for referencing of unbound methods. E.g.  
    28 {{{ 
    29 v = orange.EnumVariable(); v.getExisting() 
    30 }}} 
    31 is OK, but  
    32 {{{ 
    33 orange.EnumVariable.getExisting() 
    34 }}} 
    35 is not. Former is uncommon, but needs to be found and modified manually. 
    36  
    37 For refactoring, mapping of names can be found in source/orange/aliases.txt, source/_underscored and source/_underscored_manual. 
    38  
    39 === Things to check/fix later === 
    40  
    41 [wiki:Orange25/CAliases Aliases in C code to make] 
    42  
    43 * Floating-point numbers and functions are formatted in a weird fashion when enumerating default function parameter values. 
    44 * Base classes are determined inappropriately for our needs: for example, orange.RuleLearner is written (and linked) instead of its alias Orange.classification.rules.RuleLearner (or at least Orange.core.RuleLearner). 
    45  
    46 == Refactoring tool orange2to25.py == 
    47  
    48 In orange directory there is a orange2to25.py script 
    49 * Use it like this (this will output a diff of proposed changes): 
    50 {{{ 
    51 python orange2to25.py myscripy.py 
    52 }}} 
    53 * To overwrite the myscript.py (a backup will be saved in myscript.py.bak) use: 
    54 {{{ 
    55 python orange2to25.py -w myscripy.py 
    56 }}} 
    57 * To use an aggressive name changer add the '-a' flag (will fix names in the global and local scope, e.g. it will replace ExampleTable (without the orange. prefix) with Orange.data.Table and import the appropriate package (Orange.data)) 
    58 {{{ 
    59 python orange2to25.py -w -a myscripy.py 
    60 }}} 
    61 * To write the changed script to a new file use '-o' argument 
    62 {{{ 
    63 python orange2to25.py -w -o mynewandimprovedscript.py myscript.py 
    64 }}} 
    65 * For help type: 
    66 {{{ 
    67 python orange2to25.py --help 
    68 }}}  
    69  
    70 === Adding mapped names and modules === 
    71  
    72 Currently there are only a few MAPPING definitions in the both fixers available. Add all changed names and moved modules to the appropriate file: 
    73  
    74 * Add other mapped names to orange/fixer/fix_changed_names.py in the MAPPING global variable (For instance .. "orange.ExampleTable":"Orange.data.Table", ...)  
    75 * Add mapped modules to orange/fixer/fix_orange_imports.py in the MAPPING global variable (For instance ... "orngSVM": Orange.classification.svm", ...) 
    7622 
    7723== Reference documentation for conversion == 
     
    13682* updateOrange 
    13783* orngContingency, orngInteract, orngCRS, orng2Array, orngDimRed 
     84 
     85== Refactoring tool == 
     86 
     87Do forget to update the [wiki:Orange25/RefactoringTool refactoring rules]. 
     88 
     89== Things to check/fix later == 
     90 
     91[wiki:Orange25/CAliases Aliases in C code to make] 
     92 
     93* Floating-point numbers and functions are formatted in a weird fashion when enumerating default function parameter values. 
     94* Base classes are determined inappropriately for our needs: for example, orange.RuleLearner is written (and linked) instead of its alias Orange.classification.rules.RuleLearner (or at least Orange.core.RuleLearner). 
     95