FLEXPART Testing Environment CTBTO WO8
Main Page
Related Pages
Packages
Classes
Files
File List
All
Classes
Namespaces
Files
Functions
Variables
Pages
git
ctbto
flexpart-testing
distrotest
RunCase.py
Go to the documentation of this file.
1
# -*- coding: utf-8 -*-
2
"""
3
Created on Tue Aug 11 19:35:59 2015
4
5
@author: morton
6
"""
7
8
9
import
os
10
11
import
distrotest.BasicTest
as
BasicTest
12
13
class
RunCase
(object):
14
15
16
"""
17
RunCase.py - container that stores properties of a particular run, including
18
description, directory of case files, and a list of BasicTest objects to be
19
applied. A Case corresponds to a specific simulation (e.g. forward or backward,
20
specific set of inputs, specific domain, species, etc.)
21
"""
22
23
def
__init__
(self, descr=None, case_dir=None,
24
control_data_dir=
None
, test_list=
None
):
25
26
"""
27
descr : (optional) Description string
28
case_dir : directory where case configuration files is located
29
control_data_dir : (optional). Alternate location of control output
30
data. If not defined, then defaults to <case_dir>/output
31
test_list : (optional) List of BasicTest objects. Defaults to None.
32
"""
33
34
if
descr:
35
self.
_description
= descr
36
37
if
case_dir:
38
if
os.path.isdir(case_dir):
39
self.
_case_dir
= case_dir
40
else
:
41
raise
Exception(
'Cannot find case_dir: '
+ case_dir)
42
else
:
43
raise
Exception(
'case_dir not defined'
)
44
45
46
if
control_data_dir:
47
self.
_control_data_dir
= control_data_dir
48
else
:
49
self.
_control_data_dir
= self.
_case_dir
+
'/output'
50
51
# Default to the "output" dir of the case directory
52
#print control_data_dir, self._control_data_dir
53
if
not
os.path.isdir(self.
_control_data_dir
):
54
raise
Exception(
'control_data_dir not valid: '
+ self.
_control_data_dir
)
55
56
# Make sure all elements of test_list are indeed BasicTest objects
57
if
test_list:
58
for
the_test
in
test_list:
59
if
not
isinstance(the_test, (
BasicTest.BasicTest
)):
60
raise
Exception(
'item in test_list not a BasicTest obj'
)
61
self.
_test_list
= test_list
62
else
:
63
self.
_test_list
= []
64
65
66
def
get_descr
(self):
67
return
self.
_description
68
69
def
get_case_dir
(self):
70
return
self.
_case_dir
71
72
def
get_control_data_dir
(self):
73
return
self.
_control_data_dir
74
75
76
def
get_test_list
(self):
77
return
self.
_test_list
78
79
80
81
82
83
84
85
86
87
88
89
distrotest.RunCase.RunCase._description
_description
Definition:
RunCase.py:35
distrotest.RunCase.RunCase.__init__
def __init__
Definition:
RunCase.py:24
distrotest.RunCase.RunCase._test_list
_test_list
Definition:
RunCase.py:61
distrotest.BasicTest
Definition:
BasicTest.py:1
distrotest.RunCase.RunCase._control_data_dir
_control_data_dir
Definition:
RunCase.py:47
distrotest.RunCase.RunCase.get_case_dir
def get_case_dir
Definition:
RunCase.py:69
distrotest.RunCase.RunCase.get_control_data_dir
def get_control_data_dir
Definition:
RunCase.py:72
distrotest.BasicTest.BasicTest
Definition:
BasicTest.py:3
distrotest.RunCase.RunCase._case_dir
_case_dir
Definition:
RunCase.py:39
distrotest.RunCase.RunCase
Definition:
RunCase.py:13
distrotest.RunCase.RunCase.get_descr
def get_descr
Definition:
RunCase.py:66
distrotest.RunCase.RunCase.get_test_list
def get_test_list
Definition:
RunCase.py:76
Generated on Sun Mar 27 2016 01:16:01 for FLEXPART Testing Environment CTBTO WO8 by
1.8.6