Skip to content

Commit

Permalink
adapter changes working to zero config
Browse files Browse the repository at this point in the history
  • Loading branch information
jaapschellekens committed Jun 13, 2017
1 parent 6642a1d commit 3a508f3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 16 deletions.
4 changes: 2 additions & 2 deletions wflow-py/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is made by mkversion_buildserver.py, do not edit!VERSION="1.0.master.1"
# This file is made by mkversion.py, do not edit!VERSION="1.0.master.1"
MVERSION="1.0.master"
NVERSION="1.0.1"
BUILD="2017-06-01 15:37:12.049000"
BUILD="2017-06-13 10:10:58.703000"
2 changes: 0 additions & 2 deletions wflow-py/make_wflow_exe_cx.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ def mkdatatuples(thelist,destdir="."):
data_files.extend(mkdatatuples(MKL_files,destdir="."))
# pcraster dll's
ddir = "c:/pcraster/lib/"
# for teamcity
ddir = "D:/BuildAgent/work/wflow_exe/pcraster-4.1.0_x86-64"
data_files.extend(mkdatatuples(glob.glob(ddir + "/*.dll"),destdir='.'))

# GDAL data files
Expand Down
12 changes: 3 additions & 9 deletions wflow-py/wflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,15 @@
__version__="1.0.master"
__release__="1.0.master.1"
__versionnr__="1.0.1"
__build__="2017-06-01 15:37:12.049000"
__build__="2017-06-13 10:10:58.703000"
import osgeo.gdal as gdal

import os, sys
if hasattr(sys, "frozen"):
print('Frozen...')
_ROOT = os.path.abspath(os.path.dirname(__file__)).split("library.zip")[0]
os.environ['GDAL_DATA'] = os.path.join(_ROOT,'gdal-data')
os.environ['PATH'] = _ROOT + ';' + os.environ['PATH']
os.environ['PYTHONPATH'] = _ROOT + ';' + os.environ['PYTHONPATH']
sys.path.insert(0,_ROOT)
if _ROOT not in os.environ['PATH']:
print('Root dir of binary not insystem path. This may cause problems...')
else:
_ROOT = os.path.abspath(os.path.dirname(__file__))

import osgeo.gdal as gdal

def get_data(path):
return os.path.join(_ROOT, 'data', path)
8 changes: 5 additions & 3 deletions wflow-py/wflow/wf_DynamicFramework.py
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ def createRunId(self, intbl="intbl", logfname="wflow.log", NoOverWrite=True, mod
self.modelname = modelnamefromobject

if modelnamefromobject != self.modelname:
self.logger.error("Ini file made for " + self.modelname + " but found " + modelnamefromobject + " in code.")
self.logger.warn("Ini file made for " + self.modelname + " but found " + modelnamefromobject + " in code.")

self.runlengthdetermination = configget(self._userModel().config, 'run', 'runlengthdetermination', "steps")
self.DT.update(timestepsecs=int(configget(self._userModel().config, 'run', 'timestepsecs', "86400")),
Expand Down Expand Up @@ -2113,7 +2113,6 @@ def _runDynamic(self, firststep, laststep):
while step <= self._userModel().nrTimeSteps():
self._incrementIndentLevel()
self._atStartOfTimeStep(step)
# TODO: Check why the timestep setting doesn't work.....
self._userModel()._setCurrentTimeStep(step)

if hasattr(self._userModel(), 'dynamic'):
Expand Down Expand Up @@ -2424,7 +2423,10 @@ def wf_readmap(self, name, default, verbose=True,fail=False,ncfilesource="not se
if hasattr(self._userModel(), "_inDynamic"):
if self._userModel()._inDynamic() or self._inUpdateWeight():
timestep = self._userModel().currentTimeStep()
newName = generateNameT(name, timestep)
if 'None' not in self.ncfile:
newName = name
else:
newName = generateNameT(name, timestep)

if style == 1: # Normal reading of mapstack from DISK per via or via netcdf
path = os.path.join(directoryPrefix, newName)
Expand Down

0 comments on commit 3a508f3

Please sign in to comment.