Changeset 738
- Timestamp:
- 18/08/16 02:16:05 (5 years ago)
- Location:
- CMIP6dreq/trunk
- Files:
-
- 3 added
- 1 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
CMIP6dreq/trunk/dreqPy/dreqCmdl.py
r725 r738 3 3 """ 4 4 5 import scope, sys 5 scr = __name__ == '__main__' 6 import sys 7 if scr: 8 import scope 9 else: 10 from . import scope 11 6 12 7 13 def main_entry(): … … 16 22 17 23 if sys.argv[1] == '-v': 18 from packageConfig import __version__, __versionComment__ 24 if scr: 25 from packageConfig import __version__, __versionComment__ 26 else: 27 from .packageConfig import __version__, __versionComment__ 19 28 print( 'dreqPy version %s [%s]' % (__version__,__versionComment__) ) 20 29 elif sys.argv[1] == '--unitTest': 21 30 print( "Starting test suite 1" ) 22 import simpleCheck 31 if scr: 32 import simpleCheck 33 else: 34 from . import simpleCheck 23 35 print( "Starting test suite 2" ) 24 import examples.ex203 36 if scr: 37 import examples.ex203 38 else: 39 from .examples import ex203 25 40 print( "Tests completed" ) 26 41 else: -
CMIP6dreq/trunk/dreqPy/examples/ex002.py
r626 r738 8 8 import dreq 9 9 else: 10 print 'No dreq.py in specified directory'10 print ( 'No dreq.py in specified directory' ) 11 11 sys.exit(0) 12 12 else: 13 print 'Specified directoty does not exist'13 print ('Specified directoty does not exist' ) 14 14 sys.exit(0) 15 15 else: … … 21 21 22 22 dcppLinks = [x for x in dq.coll['requestLink'].items if x.mip == 'DCPP'] 23 print 'Request links found for DCPP: %s' % len( dcppLinks)23 print ('Request links found for DCPP: %s' % len( dcppLinks ) ) 24 24 25 25 dcppRequestedGroups = set( [dq.inx.uid[x.refid] for x in dcppLinks] ) 26 print 'Request groups found for DCPP: %s' % len( dcppRequestedGroups)26 print ('Request groups found for DCPP: %s' % len( dcppRequestedGroups ) ) 27 27 28 28 dcppRequestedCmorVars = set() … … 30 30 for x in dq.inx.iref_by_sect[vg.uid].a['requestVar']: 31 31 dcppRequestedCmorVars.add( dq.inx.uid[x].vid ) 32 print 'Requested CMOR Variables found for DCPP: %s' % len( dcppRequestedCmorVars)32 print ('Requested CMOR Variables found for DCPP: %s' % len( dcppRequestedCmorVars ) ) 33 33 -
CMIP6dreq/trunk/dreqPy/examples/ex101.py
r626 r738 6 6 7 7 ver = doc.getElementsByTagName('pav:version')[0] 8 print ver.firstChild.data8 print ( ver.firstChild.data ) -
CMIP6dreq/trunk/dreqPy/examples/ex102.py
r626 r738 9 9 xmlf = fn 10 10 else: 11 print 'File %s not found' % fn11 print ( 'File %s not found' % fn ) 12 12 sys.exit(0) 13 13 else: … … 26 26 dcppLinks.append( item ) 27 27 requestedGroups.add( item.getAttribute( 'refid' ) ) 28 print 'Request links found for DCPP: %s' % len( dcppLinks )29 28 30 print 'Request groups found for DCPP: %s' % len( requestedGroups ) 29 print ( 'Request links found for DCPP: %s' % len( dcppLinks ) ) 30 31 print ( 'Request groups found for DCPP: %s' % len( requestedGroups ) ) 31 32 32 33 sect = doc.getElementsByTagName( 'requestVar' )[0] … … 36 37 cmorVars.add( item.getAttribute( 'vid' ) ) 37 38 38 print 'CMOR variables requested by DCPP: %s' % len(cmorVars)39 print ( 'CMOR variables requested by DCPP: %s' % len(cmorVars) ) -
CMIP6dreq/trunk/dreqPy/examples/ex202.py
r634 r738 7 7 import scope 8 8 else: 9 print 'No scope.py in specified directory'9 print ( 'No scope.py in specified directory' ) 10 10 sys.exit(0) 11 11 else: 12 print 'Specified directoty does not exist'12 print ('Specified directoty does not exist' ) 13 13 sys.exit(0) 14 14 else: -
CMIP6dreq/trunk/dreqPy/scope.py
r717 r738 25 25 mlg = mlog3() 26 26 else: 27 from utilP2 import mlog28 mlg = mlog()27 from utilP2 import util 28 mlg = util.mlog() 29 29 30 30 class c1(object): … … 978 978 979 979 v0 = self.sc.volByMip( self.adict['m'], pmax=pmax, intersection=self.intersection, adsCount=adsCount, exptid=eid ) 980 #mlg.prnt ( '%7.2fTb' % (v0*2.*1.e-12) )981 980 mlg.prnt ( 'getVolByMip: %s [%s]' % (v0,makeTables.vfmt(v0*2.)) ) 982 981 cc = collections.defaultdict( int ) -
CMIP6dreq/trunk/dreqPy/simpleCheck.py
r717 r738 1 from __init__ import DOC_DIR1 from .__init__ import DOC_DIR 2 2 import string, os, sys, collections 3 3 … … 79 79 class check1(checkbase): 80 80 def _ch01_importDreq(self): 81 import dreq81 from . import dreq 82 82 print ( 'Dreq software import checked' ) 83 83 self.ok = True 84 84 85 85 def _ch02_importSample(self): 86 import dreq86 from . import dreq 87 87 self.dq = dreq.loadDreq( manifest='%s/dreqManifest.txt' % self.docdir ) 88 88 print ( 'Dreq sample load checked' ) … … 91 91 def _ch03_linkCheck(self): 92 92 nn = 0 93 import dreq93 from . import dreq 94 94 self.dq = dreq.loadDreq( manifest='%s/dreqManifest.txt' % self.docdir ) 95 95 for section in self.dq.coll : -
CMIP6dreq/trunk/setup.py
r474 r738 8 8 9 9 NAME = "dreqPy" 10 PACKAGES = find_packages(exclude=["tests*"]) 10 python2 = True 11 if sys.version_info[0] == 3: 12 PACKAGES = find_packages(exclude=["tests*","dreqPy.utilP2"]) 13 python2 = False 14 else: 15 PACKAGES = find_packages(exclude=["tests*"]) 16 11 17 META_PATH = os.path.join("dreqPy", "packageConfig.py") 12 18 KEYWORDS = ["CMIP6"]
Note: See TracChangeset
for help on using the changeset viewer.