FLEXPART Testing Environment CTBTO WO8
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | Private Attributes | List of all members
distrotest.Distribution.Distribution Class Reference
Inheritance diagram for distrotest.Distribution.Distribution:
Inheritance graph
[legend]
Collaboration diagram for distrotest.Distribution.Distribution:
Collaboration graph
[legend]

Public Member Functions

def __init__
 
def get_descr
 
def get_distro_path
 
def get_parmod_path
 
def get_exec_name
 
def get_met_case_list
 

Private Attributes

 _description
 
 _distro_path
 
 _parmod_path
 
 _met_case_list
 
 _exec_name
 

Detailed Description

Distribution() - container that stores properties of a particular FLEXPART
distribution test, which will contain one or more MetCase objects, which
will contain one or more RunCase objects, which will contain one or more 
BasicTest objects.
Container includes description, path to distribution, 
path to par_mod.f90 file, and a list of MetCase objects to be applied. 

Definition at line 18 of file Distribution.py.

Constructor & Destructor Documentation

def distrotest.Distribution.Distribution.__init__ (   self,
  descr = None,
  distro_path = None,
  parmod_path = None,
  exec_name = None,
  met_case_list = None 
)
descr : Description string
distro_path : path to source code directory
parmod_path : (option) Path to par_mod.f90.  If no arg, uses the one
in the distribution
exec_name : name of executable
met_case_list : (optional) List of MetCase objects.  Defaults to empty
list.

Definition at line 32 of file Distribution.py.

32 
33  exec_name=None, met_case_list=None):
34 
35  """
36  descr : Description string
37  distro_path : path to source code directory
38  parmod_path : (option) Path to par_mod.f90. If no arg, uses the one
39  in the distribution
40  exec_name : name of executable
41  met_case_list : (optional) List of MetCase objects. Defaults to empty
42  list.
43  """
44 
45  if descr:
46  self._description = descr
47 
48  if distro_path:
49  if os.path.isdir(distro_path):
50  self._distro_path = distro_path
51  else:
52  raise Exception('Cannot find distro_path: ' + distro_path)
53  else:
54  raise Exception('distro_path not defined')
55 
56  # If parmod_path is not defined, then par_mod.f90 is assumed to be in the
57  # source distribution
58  if parmod_path:
59  if os.path.isfile(parmod_path):
60  self._parmod_path = parmod_path
61  else:
62  raise Exception('Cannot find parmod_path: ' + parmod_path)
63  else:
64  self._parmod_path = self._distro_path + '/par_mod.f90'
65  if not os.path.isfile(self._parmod_path):
66  raise Exception('Cannot find parmod_path in distribution: ' + self._parmod_path)
67 
68 
69  # Make sure all elements of met_case_list are indeed MetCase objects
70  if met_case_list:
71  for the_case in met_case_list:
72  if not isinstance(the_case, (MetCase.MetCase)):
73  raise Exception('item in met_case_list not a MetCase obj')
74  self._met_case_list = met_case_list
75  else:
76  self._met_case_list = []
77 
78 
79  if exec_name:
80  self._exec_name = exec_name
81  else:
82  raise Exception("No executable name provided...")
83 

Member Function Documentation

def distrotest.Distribution.Distribution.get_descr (   self)

Definition at line 84 of file Distribution.py.

84 
85  def get_descr(self):
86  return self._description
def distrotest.Distribution.Distribution.get_distro_path (   self)

Definition at line 87 of file Distribution.py.

87 
88  def get_distro_path(self):
89  return self._distro_path
def distrotest.Distribution.Distribution.get_exec_name (   self)

Definition at line 93 of file Distribution.py.

93 
94  def get_exec_name(self):
95  return self._exec_name
def distrotest.Distribution.Distribution.get_met_case_list (   self)

Definition at line 96 of file Distribution.py.

def distrotest.Distribution.Distribution.get_parmod_path (   self)

Definition at line 90 of file Distribution.py.

90 
91  def get_parmod_path(self):
92  return self._parmod_path

Member Data Documentation

distrotest.Distribution.Distribution._description
private

Definition at line 45 of file Distribution.py.

distrotest.Distribution.Distribution._distro_path
private

Definition at line 49 of file Distribution.py.

distrotest.Distribution.Distribution._exec_name
private

Definition at line 79 of file Distribution.py.

distrotest.Distribution.Distribution._met_case_list
private

Definition at line 73 of file Distribution.py.

distrotest.Distribution.Distribution._parmod_path
private

Definition at line 59 of file Distribution.py.


The documentation for this class was generated from the following file: