Changes between Version 10 and Version 11 of CdatLite


Ignore:
Timestamp:
13/03/08 10:00:30 (11 years ago)
Author:
spascoe
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CdatLite

    v10 v11  
    3636}}} 
    3737 
    38 == Advanced Installation == 
     38=== Advanced Installation === 
    3939 
    4040You might want more control over the installation process but you can still get easy_install to download the tarball 
     
    4747This will download and unpack the tarball into {{{<dir>}}} then  you can run the {{{setup.py}}} script directly or build a binary egg for installation elsewhere. 
    4848 
    49  
     49== Upgrading == 
     50 
     51The move from Python-2.4 to Python-2.5 and from Numeric to numpy requires very few changes to your code.  Most changes that are needed can be done 
     52automatically using the {{{convertcdms}}} script. 
     53 
     54{{{ 
     55$ convertcdms --help 
     56option --help not recognized 
     57Usage: 
     58    convertcdms.py [options] path 
     59 
     60      Convert scripts that use the Numeric, MA, cdms, and regrid modules to numpy, ma, cdms2, and regrid2. 
     61 
     62    -or- 
     63 
     64    convertcdms.py [options] -r direc 
     65 
     66      Convert all Numeric/MA/cdms Python scripts and C source code in directory 'direc' to numpy/ma/cdms2. 
     67 
     68      Use this form to convert C source code. 
     69 
     70Arguments: 
     71 
     72    path: A .py file to convert 
     73    direc: A directory: convert all .py, .c, and .h files 
     74 
     75Options: 
     76 
     77    -a:           Disable 'aggressive' conversion (see Note 1) 
     78    -c:           Clobber the original file(s). The default is to move the original to <name>.orig 
     79    -h:           Print a help message 
     80    -n:           Do not write '# Adapted by...' comment at the top of file. 
     81    -r:           Recursively convert all .py and .c/.h files in directory direc 
     82    -s direc:     Skip the directory. This option may be used more than once. 
     83                    For example, '-s .svn' skips all subversion subdirectories. 
     84 
     85Notes: 
     86 
     87    1) The -a option turns off the following translations: 
     88 
     89        - MA.Float => Numeric.Float, similarly for MA.Int, MA.NewAxis 
     90        - MA.Numeric => Numeric 
     91        - The 'typecode=' argument in MA functions is changed to 'dtype=' 
     92        - XX.mask() => XX.mask 
     93        - XX.mask is None => ((XX.mask is None) or (XX.mask is MV2.nomask)) 
     94        - A keyword argument 'axis=0' is added to MA.sum, MA.average, MA.product, and MA.repeat 
     95 
     96    2) By default the following translations are made: 
     97 
     98        - import cdms => import cdms2 as cdms 
     99        - import regrid => import regrid2 as regrid 
     100        - import MV => import MV2 as MV 
     101        - import Numeric => import numpy.oldnumeric as Numeric 
     102        - import MA => import numpy.oldnumeric.ma as MA 
     103        - import cdms.MV => import cdms2.MV2 
     104        - from cdms import XX => from cdms2 import XX (similarly for regrid, MV, MA, and Numeric) 
     105        - from cdms.XX import YY => from cdms2.XX import YY (similarly for regrid, MV, MA, and Numeric) 
     106        - import cdms as XX => import cdms2 as XX (similarly for regrid, MV, MA, and Numeric) 
     107        - import cdms.XX => import cdms2.XX (similarly for regrid, MV, MA, and Numeric) 
     108        - import XX, cdms, YY => import XX, cdms2 as cdms, YY (similarly for regrid, MV, MA, and Numeric) 
     109        - the translations in Note (1) 
     110        - the translations in numpy.oldnumeric.alter_code1. This module is used for most Numeric and MA-related translations. 
     111}}} 
    50112 
    51113