source: nappy/trunk/nappy/Plans for re-factoring 2008.txt @ 3321

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/nappy/trunk/nappy/Plans for re-factoring 2008.txt@3321
Revision 3321, 3.4 KB checked in by astephen, 12 years ago (diff)

First major re-factor.

Line 
1= Changes needed to make Nappy fit for purpose =
2
3
4 * Need error checking throughout - making it more robust but also checking on read will make Nappy a useful NASA Ames checker replacement.
5
6 * cdms interface should be in a separate part of the stack, not in core classes AND SUB-CLASSES
7
8 * Need to make an egg of it, but in the meantime we also need it installed as:
9
10   * nappy-0.2.3
11     * nappy
12     * bin
13     * nappy/nc_interface
14     * nappy/cdms_utils/
15     * nappy/utils
16     * nappy/na_file
17     * nappy/contrib/aircraft
18   
19
20 * GET REST FROM WIKI!
21
22
23===============
24localRules.py --> REMOVE COMPLETELY
25localRules/blah - remove this and put stuff in a top-level config file, or even remove altogether.
26
27localRules/aircraft.py - Need to consider how this can be a sub-class of Cdms2NA so that we push all the odd code into separate modules. Need to encapstulate the differences into one or two methods that are small and can be overridden.
28
29======
30bin/scanFAAM.py - put in contrib
31
32======
33
34version.py - put in config file.
35
36======
37
38general.py --> call it utils/xxxxx.py
39
40textParser --> utils/text_parser.py
41
42naError.py --> na_error/na_error.py
43
44naCore.py --> na_file/na_core.py
45
46listManipulator -_> utils/list_manipulator.py
47
48cdmsMap.py --> put in config file given simplicity
49
50Need utils/parse_config.py
51
52======
53
54CDMS stuff is most of the mess
55==============================
56
571. naToCdms.py holds:
58
59AbstractNAToCdms CLASS
60toCdmsFile
61createCdmsVariables
62toCdmsVariable
63createCdmsAuxVariables
64auxToCdmsVariable
65createCdmsAxes
66toCdmsAxes
67
682. na2cdms.py:
69
70Command-line script
71
723. bin/na2nc:
73
74Same as na2cdms.py ???
75
764. cdms2na.py is the mother of all modules:
77
78compareAxes --> areAxesIdentical(a,b) cdms_utils
79compareVariables --> areDomainsIdentical(v1, v2) cdms_utils
80isAuxAndVar --> isAuxVarAndVar
81arrayToList utils
82listOfListsCreator utils
83getBestName cdms_utils - need some advice and compare with Dom
84getMissingValue cdms_utils
85fixHeaderLengthNowDefunct # Can destroy
86flatten2DTimeData aircraft
87modifyNADictCopy - needs a better name as it is specific
88cdms2na - 200 lines of code to do main conversion, needs to be split out into other stuff.
89 * getVariableCollections(f and varlist) --> (ordered_vars, other_vars)
90 * buildNADicts()
91 * writeToOutputFiles()
92
93class CdmsToNABuilder --> NAContentCollector: (naDict, varIDs, varBin)
94__init__ --> sets everything up and runs it move some to --> analyse()
95analyseVariables
96defineNAVars
97defineNAAuxVars
98getAxisDefinition
99defineNAGlobals
100defineNAComments
101defineGeneralHeader
102_useLocalRule --> Remove this and put it all in aircraft contrib bit
103
104=================
105
106naToCdms.py
107===========
108
109This is a sub-class of all NAFile objects. Bad idea. What we need is to:
110
111import convertor
112convertor.writeToNC(blah)
113convertor.convertToCdms(blah): (vars, global_atts)
114
115class NAToCdms
116
117toCdmsFile
118createCdmsVariables - does all
119toCdmsVariable - does each in turn
120CreateCdmsAuxVariables - does all
121auxToCdmsVariables - does each in turn
122createCdmsAxes - does all
123toCdmsAxes - does each in turn
124
125================
126
127Have I broken textParser.py's main function - is it same in old and new.
128
129=====
130
131NAFile2010:
132_readData[12] are crying out for useful names
133
134GREP
135====
136
137Need to do a lot of grepping for inconsistencies.
138
139 * _normalizedX should be True|False not "yes","no"
140
141Global find and replace:
142
143floatFormat
144naDict
Note: See TracBrowser for help on using the repository browser.