Skip to content
Snippets Groups Projects
Commit 5d42acdb authored by Anne Philipp's avatar Anne Philipp
Browse files

working version of restructured usement of pathes with config file

parent 2fb99de9
Branches
Tags
No related merge requests found
...@@ -48,7 +48,7 @@ cd $SCRATCH ...@@ -48,7 +48,7 @@ cd $SCRATCH
mkdir -p python$$ mkdir -p python$$
cd python$$ cd python$$
export CONTROL=CONTROL export CONTROL=$PWD/CONTROL
cat >$CONTROL<<EOF cat >$CONTROL<<EOF
EOF EOF
......
Abhängigkeiten:
pytest
pytest-cov (https://pypi.org/project/pytest-cov/ ; https://pytest-cov.readthedocs.io/en/latest/)
coverage
#Grundsätzlicher Befehl die Coverage des Testens zu überprüfen
pytest --cov=PATH_TO_PROJECT_SRC PATH_TO_TEST_SRC
# einen test mit einem bestimmten marker nicht ausführen
pytest TestTools.py -m "not msuser_pw"
# Tests mit einem bestimmten Marker ausführen
pytest TestTools.py -m "msuser_pw"
\ No newline at end of file
...@@ -424,7 +424,7 @@ class ControlFile(object): ...@@ -424,7 +424,7 @@ class ControlFile(object):
sys.exit(1) sys.exit(1)
if self.request != 0: if self.request != 0:
marsfile = os.path.join(_config.PATH_RUN_DIR, marsfile = os.path.join(self.inputdir,
_config.FILE_MARS_REQUESTS) _config.FILE_MARS_REQUESTS)
if os.path.isfile(marsfile): if os.path.isfile(marsfile):
os.remove(marsfile) os.remove(marsfile)
......
...@@ -205,6 +205,7 @@ class EcFlexpart(object): ...@@ -205,6 +205,7 @@ class EcFlexpart(object):
self.accuracy = c.accuracy self.accuracy = c.accuracy
self.level = c.level self.level = c.level
self.expver = c.expver self.expver = c.expver
self.levelist = c.levelist
# for gaussian grid retrieval # for gaussian grid retrieval
self.glevelist = '1/to/' + c.level self.glevelist = '1/to/' + c.level
......
...@@ -76,8 +76,14 @@ PATH_RUN_DIR = os.path.join(PATH_FLEXEXTRACT_DIR, 'run') ...@@ -76,8 +76,14 @@ PATH_RUN_DIR = os.path.join(PATH_FLEXEXTRACT_DIR, 'run')
PATH_RELATIVE_RUN_DIR = os.path.relpath(PATH_RUN_DIR, PATH_FLEXEXTRACT_DIR) PATH_RELATIVE_RUN_DIR = os.path.relpath(PATH_RUN_DIR, PATH_FLEXEXTRACT_DIR)
# path to directory where all control files are stored # path to directory where all control files are stored
PATH_CONTROLFILES = os.path.join(PATH_RUN_DIR, 'control') if os.getenv('CONTROL') and '/' in os.getenv('CONTROL'):
PATH_RELATIVE_CONTROLFILES = os.path.relpath(PATH_CONTROLFILES, PATH_FLEXEXTRACT_DIR) # this is only needed if remote version with job script is used!
# because job is directly submitted from SCRATCH and because the
# CONTROL file is stored there, the normal path is not valid.
PATH_CONTROLFILES = os.getenv('CONTROL')
else:
PATH_CONTROLFILES = os.path.join(PATH_RUN_DIR, 'control')
PATH_RELATIVE_CONTROLFILES = os.path.relpath(PATH_CONTROLFILES, PATH_FLEXEXTRACT_DIR)
# path to directory where all job scripts are stored # path to directory where all job scripts are stored
PATH_JOBSCRIPTS = os.path.join(PATH_RUN_DIR, 'jobscripts') PATH_JOBSCRIPTS = os.path.join(PATH_RUN_DIR, 'jobscripts')
......
...@@ -15,4 +15,4 @@ RESOL 63 ...@@ -15,4 +15,4 @@ RESOL 63
GAUSS 1 GAUSS 1
ADDPAR 186/187/188/235/139/39 ADDPAR 186/187/188/235/139/39
PREFIX EItest_ PREFIX EItest_
ECTRANS 1 ECTRANS 1
\ No newline at end of file
...@@ -48,7 +48,7 @@ cd $SCRATCH ...@@ -48,7 +48,7 @@ cd $SCRATCH
mkdir -p python$$ mkdir -p python$$
cd python$$ cd python$$
export CONTROL=CONTROL export CONTROL=$PWD/CONTROL
cat >$CONTROL<<EOF cat >$CONTROL<<EOF
accuracy 24 accuracy 24
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment