Changes between Version 2 and Version 3 of CdatLite

28/12/06 21:19:36 (13 years ago)



  • CdatLite

    v2 v3  
    1 cdat_lite is a repackaging of the core components from the Climate Data analysis Tools ([ CDAT]) in PythonEggs format.  The package includes: 
     1= CDAT-lite = 
    3  1. cdms: configured without dods, drs or hdf. 
    4  1. cdunifpp: provides read support for UK Met. Office PP files. 
    5  1. cdscan: script for generating CDML dataset aggregation files. 
    6  1. cdtime, cdutil, genutil, regrid, unidata, xmgrace: assorted packages from CDAT. 
     3cdat_lite is a simple repackaging of the I/O layer of the [ Climate Data Analysis Tools (CDAT)] as a [wiki:PythonEggs: Python Egg]. 
    8 == Download == 
     5== Package Overview == 
    10 First you will require [ setuptools].  Then simply type: 
     7 * CDAT core packages:  
     8   * cdms, cdtime, cdutil, genutil, Properties, regrid, unidata, xmgrace 
     9   These top-level packages can be used in the same way you would with a full CDAT installation.  E.g. 
     10   {{{ 
     11   #!python 
     12   >>> import cdms 
     13   >>> f ='') 
     14   }}} 
     15 * cdat_lite support packages: These packages support the cdat_lite 
     16   egg installation. 
     17   * cdat_lite.clib: libraries and headers used to build CDAT source: 
     18     libcdms and libnetcdf.   
     19   * cdat_lite.scripts: contains a version of cdscan suitable for declaring as 
     20     a setuptools entry-point [entry-points].  During installation 
     21     easy-install will create a stub script to execute cdscan on the 
     22     command line 
     23   * cdat_lite.test: contains a test suite. 
     25== Features == 
     27 * Includes cdscan from the comand-line or from within python 
     28   using the cdat_lite.scripts.cdscan module. 
     29 * Includes the latest version of the British Atmospheric Data 
     30   Centre's cdunifpp module which provides read access to UK 
     31   Met. Office PP files. 
     32 * Downloads and installs Numeric on demand.  If you have Numeric installed 
     33   already but the package doesn't have an egg-info directory easy-install will 
     34   re-install Numeric for you unless you use the --no-deps switch. 
     36== Installation == 
     38Binary eggs and the source tarball of cdat_lite are available from [].  It is also registered at the [ Python Cheeseshop] so should be discovered automatically by {{{easy_install}}}. 
     40 1. Start with a python 2.4+ installation with distutils.  You cannot build or run the egg without distutils.  If your python has been installed by a unix package manager then you may have to install the python-devel package. 
     41 1. Install [ setuptools].  This includes the {{{easy_install}}} script. 
     42 1. simply type: 
     43 {{{ 
     44 $ easy_install cdat_lite 
     45 }}} 
     46 1. Alternatively, if you want to install into a local directory {{{$EGG_DIR}}}, ensure {{{$EGG_DIR}}} exists and is on your {{{$PYTHONPATH}}} then type: 
     47 {{{ 
     48 $ easy_install -d $EGG_DIR cdat_lite 
     49 }}} 
     50 1. For more installation options see the [ easy_install documentation] 
     53== Versioning == 
     55cdat-lite versioning is complicated as it is a repackage of CDAT with 
     56an updated cdunifpp module. There are therefore 3 version numbers to 
     57consider: CDAT, cdunifpp and cdat-lite.  Once we start using versions 
     58of CDAT from the PCMDI SVN the version string could become very long 
     59indeed therefore the following strategy is used: 
     61 1. Eggs are quoted with the version: <cdat-release>-<cdat-lite-version> 
     62 1. If a PCMDI SVN version of CDAT is used it is stated in long_description no 
     63t in <cdat-release>. 
     64 1. The cdunifpp version is stated in long_description not in the version.  An 
     65y change to the cdunifpp version naturally triggers a new <cdat-lite-version 
     68== Testing the installation == 
     70A small set of unit tests are included with in the cdat_lite egg for verifying the installation is working.  To run the tests do: 
    12 $ easy_install cdat_lite 
     73>>> from cdat_lite import test 
     74>>> test.main() 
     75......cdat_lite/test/testpp.pp is a 32-bit PP-file 
     78Ran 7 tests in 0.553s 
     82Of course you may uncover a bug not tested for.  If so please email [ Stephen Pascoe] 
     84== Using CDMS scripts == 
     86cdat_lite includes the libcdms script cdscan within the egg.  You have 
     87several options to get at it. 
     89=== The stub script === 
     91When you install the egg with easy_install a script stub is created 
     92automatically which calls cdscan within the egg.  Therefore you should 
     93be able to use cdscan as usual.  If you've installed the egg in a 
     94local directory the script stub will be in that directory. 
     96=== Import cdscan as a module from within python === 
     99>>> import cdat_scripts.cdscan as cdscan 
     100>>> cdscan.main(['cdscan', '-x', 'dataset.xml', filename, ...]) 
     103The argument to main() must be the equivilent of sys.argv when run 
     104from the command line, i.e. the first element should be a pseudo 
     105command name. 
     107=== Import a cdscan entry point using the pkg_resources API. === 
     109This is the way scripts are supposed to be found from within eggs and is 
     110used by easy_install to automatically create script stubs. 
     113>>> import pkg_resources 
     114>>> cdscan = pkg_resources.load_entry_point('cdat_lite', 'console_scripts', 'cdscan') 
     115>>> cdscan() 
     117In this case sys.argv must be set to the arguments you want.