Changeset 3380 for nappy


Ignore:
Timestamp:
11/02/08 19:53:32 (12 years ago)
Author:
astephen
Message:

Last little commit before moving.

Location:
nappy/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • nappy/trunk/2008 refactoring notes.txt

    r3377 r3380  
    134134   * localRules.py 
    135135   * version.py 
     136   * cdmsMap.py 
    136137 
    137138 * localRules package removed and information put in config file. 
    138139 * localRules/aircraft.py - moved out to contrib/aircraft/ - no longer supported! 
    139  
     140 * bin/scanFAAM.py - put in nappy/contrib/aircraft/ 
     141 * general.py - moved to nappy/utils/common_utils.py 
     142 * textParser.py - moved to nappy/utils/text_parser.py 
     143 * naError.py - moved to nappy/na_error/na_error.py 
     144 * listManipulator.py - moved to nappy/utils/list_manipulator.py 
     145 
     146'''Re-factoring cdms2na.py''' 
     147 
     148 * compareAxes function - moved to nappy/cdms_utils/axis_utils.py#areAxesIdentical 
     149 * compareVariables function - moved to nappy/cdms_utils/axis_utils.py#areAxesIdentical 
     150 * arrayToList function - moved to nappy/utils/list_manipulator.py 
     151 * listOfListsCreator function - moved to nappy/utils/list_manipulator.py 
     152 * getMissingValue function - moved to nappy/cdms_utils/var_utils.py 
     153 * getBestName function - moved to nappy/cdms_utils/var_utils.py 
     154 * fixHeaderLength - old, destroyed! 
     155 * flatten2DTimeData - moved out to nappy/contrib/aircraft/ 
     156 * modifyNADictCopy - needs a better name as it is specific to NA 
     157 * cdms2na function - turned into a class: 
     158   * getVariableCollections(f and varlist) --> (ordered_vars, other_vars) 
     159   * buildNADicts() 
     160   * writeToOutputFiles() 
     161 * CdmsToNABuilder class - renamed to NAContentCollector in na_content_collector.py module. 
     162 * Removed all stuff about ''rules'' as this was all unnecessary. 
     163 
     164The following have been changed from strings with "yes"|"no" values or boolean: 
     165 * _normalizedX  
     166 * time_warning 
    140167 
    141168=== Making a clean API === 
     
    152179=== Broken? === 
    153180 
    154 Have I broken textParser.py's main function - is it same in old and new - need a test for it! 
     181 * Have I broken textParser.py's main function - is it same in old and new - need a test for it! 
     182 * getBestName is Ag's made up rules for getting the best long name. Need to ask colleagues best suggested method. 
    155183 
    156184=== Questions === 
     
    161189 
    162190Need to move to DCIP repository and update NDG page about that. 
    163  
    164 ---- 
    165191 
    166192Get new version from: 
     
    176202     * test_outputs - ready to receive outputs from the unit tests 
    177203     * nappy - main python package 
     204       * na_file/ - main NA file class stack 
    178205       * nc_interface/ - conversion to/from NetCDf code 
    179206       * cdms_utils/ - utility functions for CDMS (NetCDF-handling) code 
    180207       * utils/ - general utility functions used in various parts of nappy 
    181        * na_file/ -  
    182        * nappy/contrib/aircraft 
    183     
    184  
    185 ====== 
    186 bin/scanFAAM.py - put in contrib 
    187  
    188 ====== 
    189  
    190 version.py - put in config file. 
    191  
    192 ====== 
    193  
    194 general.py --> call it utils/xxxxx.py 
    195  
    196 textParser --> utils/text_parser.py 
    197  
    198 naError.py --> na_error/na_error.py 
    199  
    200 naCore.py --> na_file/na_core.py 
    201  
    202 listManipulator -_> utils/list_manipulator.py 
    203  
    204 cdmsMap.py --> put in config file given simplicity 
    205  
    206 Need utils/parse_config.py 
    207  
    208 ====== 
    209  
    210 CDMS stuff is most of the mess 
    211 ============================== 
    212  
    213  
    214 Renamed some of: 
    215  
    216 1. naToCdms.py holds: 
    217  
    218 AbstractNAToCdms CLASS 
    219 toCdmsFile 
    220 createCdmsVariables 
    221 toCdmsVariable 
    222 createCdmsAuxVariables 
    223 auxToCdmsVariable 
    224 createCdmsAxes 
    225 toCdmsAxes 
    226  
    227 2. na2cdms.py: 
    228  
    229 Command-line script 
    230  
    231 3. bin/na2nc: 
    232  
    233 Same as na2cdms.py ??? 
    234  
    235 4. cdms2na.py is the mother of all modules: 
    236  
    237 compareAxes --> areAxesIdentical(a,b) cdms_utils 
    238 compareVariables --> areDomainsIdentical(v1, v2) cdms_utils 
    239 isAuxAndVar --> isAuxVarAndVar  
    240 arrayToList utils 
    241 listOfListsCreator utils 
    242 getBestName cdms_utils - need some advice and compare with Dom 
    243 getMissingValue cdms_utils 
    244 fixHeaderLengthNowDefunct # Can destroy 
    245 flatten2DTimeData aircraft 
    246 modifyNADictCopy - needs a better name as it is specific 
    247 cdms2na - 200 lines of code to do main conversion, needs to be split out into other stuff. 
    248  * getVariableCollections(f and varlist) --> (ordered_vars, other_vars) 
    249  * buildNADicts() 
    250  * writeToOutputFiles() 
    251  
    252 class CdmsToNABuilder --> NAContentCollector: (naDict, varIDs, varBin) 
    253 __init__ --> sets everything up and runs it move some to --> analyse() 
    254 analyseVariables 
    255 defineNAVars 
    256 defineNAAuxVars 
    257 getAxisDefinition 
    258 defineNAGlobals 
    259 defineNAComments 
    260 defineGeneralHeader 
    261 _useLocalRule --> Remove this and put it all in aircraft contrib bit 
    262  
    263 ================= 
    264  
    265 '''naToCdms.py''' 
    266  
    267 The naToCdms.py module has been re-factored by  
    268 naToCdms.py 
    269 =========== 
    270  
    271 This is a sub-class of all NAFile objects. Bad idea. What we need is to: 
    272  
    273 import convertor 
    274 convertor.writeToNC(blah) 
    275 convertor.convertToCdms(blah): (vars, global_atts) 
    276  
    277 class NAToCdms 
    278  
    279 toCdmsFile 
    280 createCdmsVariables - does all 
    281 toCdmsVariable - does each in turn 
    282 CreateCdmsAuxVariables - does all 
    283 auxToCdmsVariables - does each in turn 
    284 createCdmsAxes - does all 
    285 toCdmsAxes - does each in turn 
    286  
    287 ================ 
    288  
    289 GREP 
    290 ==== 
    291  
    292 Need to do a lot of grepping for inconsistencies. 
    293  
    294 The following need to be set to True or False (not yes,no): 
    295  * _normalizedX  
    296  * time_warning 
    297  
    298 Global find and replace: 
    299  
    300 Should we leave in the interactive time units checker in na_to_cdms.py - ask Charles 
    301  
    302 ===== 
    303 cdms_map is not all done in the config file dict. 
     208       * unit_tests/ - a set of unit tests to test all major functionality 
     209       * na_error/ - exception stack for nappy 
     210       * contrib/ - contributed stuff (such as aircraft modules) - UNSUPPORTED! 
     211       * nappy_api.py - a clean API module for doing all the top-level stuff - this can be usefully and succinctly documented! 
  • nappy/trunk/nappy/cdms_utils/var_utils.py

    r3351 r3380  
    2424import nappy.cdms_utils.axis_utils 
    2525 
    26 def compareVariables(var1, var2): 
     26def areDomainsIdentical(var1, var2): 
    2727    """ 
    2828    Compares two cdms variables to see if they are defined on identical 
Note: See TracChangeset for help on using the changeset viewer.