Преглед изворни кода

Changing verbosity of runSolver and adding strides to setupYear

Andrej пре 2 година
родитељ
комит
8823ae3ca1
2 измењених фајлова са 11 додато и 3 уклоњено
  1. 8 2
      pythonScripts/runSolver.py
  2. 3 1
      setup/setupYear.json

+ 8 - 2
pythonScripts/runSolver.py

@@ -283,13 +283,16 @@ def loadSolutionFromRef(setup, loadAll=False):
    inFiles=getFiles(setupOld,loadAll)
 
    #inFiles.extend(parFiles)
+   i=0
+   n=len(inFiles)
    for fSet in inFiles:
       for x in fSet:
          f=fSet[x]
          localPath=os.path.join(localDir,f)
          remotePath='/'.join([remoteDir,f])
          fb.readFileToFile(remotePath,localPath)
-
+         print('Loaded {}/{} {}'.format(i+1,n,localPath)
+         i+=1
    return loadSolutionFromDir(localDir,loadAll)
 
 def merge(a1,a2):
@@ -306,11 +309,13 @@ def loadSolutionFromDir(jobDir,loadAll=False):
    operators={x:numpy.loadtxt for x in inFiles[0]}
    operators['sOut']=read3D
    data={}
+   i=0
+   n=len(inFiles)
    for fSet in inFiles:
       idata={}
+      print('Parsing [{}/{}]'.format(i+1,n))
       for f in fSet:
          path=os.path.join(jobDir,fSet[f])
-         print('Loading [{}] {}'.format(os.path.isfile(path),path))
          idata=operators[f](os.path.join(jobDir,fSet[f]))
          if f=='sOut':
             lut=idata[1]
@@ -320,6 +325,7 @@ def loadSolutionFromDir(jobDir,loadAll=False):
             data[f]=numpy.concatenate((data[f],idata))
          except KeyError:
             data[f]=idata
+      i+=1
    return data['t'],data['sol'],data['se'],data['sOut'],data['qt'],lut,lutSE,setup
 
 def getStartPointFromDir(jobDir):

+ 3 - 1
setup/setupYear.json

@@ -4,4 +4,6 @@
 "mode":"IVPSimultaneous",
 "nt":201,
 "tmax":1,
-"tUnit":"year"}
+"tUnit":"year",
+"stride":{"length":0.5,"tUnit":"month"}
+}