source: CMIP6dreqbuild/trunk/src/framework/imanage.py @ 1113

Subversion URL: http://proj.badc.rl.ac.uk/svn/exarch/CMIP6dreqbuild/trunk/src/framework/imanage.py@1291
Revision 1113, 1.7 KB checked in by mjuckes, 2 years ago (diff)

updates for port to new laptop

Line 
1
2from ingest import util_checkUpd
3from ingest import util_anal
4from ingest import dreq_consol_dreq2
5from dreqPy import dreq
6reload( util_checkUpd )
7import sys, os
8
9class main(object):
10
11  def __init__(self):
12    pass
13
14  def ingest(self,dq=None,version=None):
15    if dq==None:
16      self.getDq(version=version)
17    else:
18      self.dq = dq
19    self.so = util_checkUpd.stdo(dq=self.dq)
20    self.vg = util_checkUpd.varGroups()
21    self.rs = util_checkUpd.requestScope()
22
23  def getDq(self,version=None):
24    if version == None:
25      self.dq = dreq.loadDreq()
26    else:
27      if os.path.isdir( 'old/%s' % version ):
28        vfile = 'old/%s' % version
29      else:
30        vfile = '/data/svn/exarch/CMIP6dreq/tags/%s/dreqPy/docs' % version
31        assert os.path.isdir( vfile ), 'No valid directory found for version %s' % version
32      self.dq = dreq.loadDreq(dreqXML='%s/dreq.xml' % vfile, configdoc='%s/dreq2Defn.xml' % vfile)
33
34##i = ingest()
35if __name__ == '__main__':
36
37  args = sys.argv[1:]
38  m = main()
39  if len(args) == 0:
40    m.ingest(version='01.beta.38')
41
42  elif args[0]  in [ '-A','--all']:
43    m.ingest(version='01.beta.38')
44  elif args[0]  in [ '--dcd']:
45    rqs = dreq_consol_dreq2.rqsummary( idir='inSh')
46    m = dreq_consol_dreq2.main( rqs, odir='inSh' )
47    m.rvg()
48    m.rql()
49   
50
51    ## refTabChk is run by revTabChk
52    ## rftc = util_anal.refTabChk()
53  if len(args) > 0 and args[0] in ['-a','--anal','-A','--all']:
54    vgc = util_anal.varGroupChk()
55    rvtc = util_anal.revTabChk()
56    rqs = dreq_consol_dreq2.rqsummary( idir='inSh')
57    m = dreq_consol_dreq2.main( rqs, odir='inSh' )
58    m.rvg()
59    m.rql()
60
61  else:
62    print '''Valid arguments:
63 * None       : Ingest only
64 * -A, --all  : Ingest and run analysis
65 * -a, --anal : Analysis only
66'''
67   
Note: See TracBrowser for help on using the repository browser.