source: CCCC/trunk/doc/build/html/index.html @ 328

Subversion URL: http://proj.badc.rl.ac.uk/svn/exarch/CCCC/trunk/doc/build/html/index.html@328
Revision 328, 39.5 KB checked in by mjuckes, 6 years ago (diff)

Extended documentation

Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
4
5<html xmlns="http://www.w3.org/1999/xhtml">
6  <head>
7    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8   
9    <title>The ceda-cc file compliance checker: technical documentation &mdash; ceda-cc 1.3.1+ documentation</title>
10   
11    <link rel="stylesheet" href="_static/default.css" type="text/css" />
12    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
13   
14    <script type="text/javascript">
15      var DOCUMENTATION_OPTIONS = {
16        URL_ROOT:    './',
17        VERSION:     '1.3.1+',
18        COLLAPSE_INDEX: false,
19        FILE_SUFFIX: '.html',
20        HAS_SOURCE:  true
21      };
22    </script>
23    <script type="text/javascript" src="_static/jquery.js"></script>
24    <script type="text/javascript" src="_static/underscore.js"></script>
25    <script type="text/javascript" src="_static/doctools.js"></script>
26    <link rel="top" title="ceda-cc 1.3.1+ documentation" href="#" /> 
27  </head>
28  <body>
29    <div class="related">
30      <h3>Navigation</h3>
31      <ul>
32        <li class="right" style="margin-right: 10px">
33          <a href="genindex.html" title="General Index"
34             accesskey="I">index</a></li>
35        <li class="right" >
36          <a href="py-modindex.html" title="Python Module Index"
37             >modules</a> |</li>
38        <li><a href="#">ceda-cc 1.3.1+ documentation</a> &raquo;</li> 
39      </ul>
40    </div> 
41
42    <div class="document">
43      <div class="documentwrapper">
44        <div class="bodywrapper">
45          <div class="body">
46           
47  <div class="section" id="the-ceda-cc-file-compliance-checker-technical-documentation">
48<h1>The ceda-cc file compliance checker: technical documentation<a class="headerlink" href="#the-ceda-cc-file-compliance-checker-technical-documentation" title="Permalink to this headline">¶</a></h1>
49<div class="toctree-wrapper compound">
50<ul class="simple">
51</ul>
52</div>
53</div>
54<div class="section" id="usage-ccinit">
55<h1>Usage (ccinit)<a class="headerlink" href="#usage-ccinit" title="Permalink to this headline">¶</a></h1>
56<div class="section" id="calling-options">
57<h2>Calling options<a class="headerlink" href="#calling-options" title="Permalink to this headline">¶</a></h2>
58<table border="1" class="docutils">
59<colgroup>
60<col width="44%" />
61<col width="56%" />
62</colgroup>
63<thead valign="bottom">
64<tr class="row-odd"><th class="head">Command line</th>
65<th class="head">Description</th>
66</tr>
67</thead>
68<tbody valign="top">
69<tr class="row-even"><td>ceda-cc -p &lt;project&gt; -D &lt;directory&gt;  [..]</td>
70<td>check all data in directory tree under specified directory</td>
71</tr>
72<tr class="row-odd"><td>ceda-cc -p &lt;project&gt; -d &lt;directory&gt;  [..]</td>
73<td>check all data in specified directory</td>
74</tr>
75<tr class="row-even"><td>ceda-cc -p &lt;project&gt; -f &lt;file&gt;       [..]</td>
76<td>check a single file</td>
77</tr>
78<tr class="row-odd"><td>ceda-cc &#8211;sum &lt;log file directory&gt;   [..]</td>
79<td>create an overview of results</td>
80</tr>
81<tr class="row-even"><td>ceda-cc &#8211;copy-config  &lt;target diectory&gt; [..]</td>
82<td>copy configuration files to a new directory</td>
83</tr>
84</tbody>
85</table>
86<span class="target" id="module-ccinit"></span><dl class="docutils">
87<dt>Arguments:</dt>
88<dd><table class="first last docutils field-list" frame="void" rules="none">
89<col class="field-name" />
90<col class="field-body" />
91<tbody valign="top">
92<tr class="field-odd field"><th class="field-name">-p:</th><td class="field-body">project</td>
93</tr>
94<tr class="field-even field"><th class="field-name">&#8211;copy-config:</th><td class="field-body">&lt;target directory path&gt;: copy configuration files to target directory path;</td>
95</tr>
96<tr class="field-odd field"><th class="field-name">&#8211;sum:</th><td class="field-body">&lt;log file directory&gt; create a summary of the results  logged in the specified directory.</td>
97</tr>
98<tr class="field-even field"><th class="field-name">-f:</th><td class="field-body">&lt;file&gt;: check a single file;</td>
99</tr>
100<tr class="field-odd field"><th class="field-name">-d:</th><td class="field-body">&lt;directory&gt;: check all the NetCDF files in a directory;</td>
101</tr>
102<tr class="field-even field"><th class="field-name">-D:</th><td class="field-body">&lt;directory&gt;: check all the NetCDF files in a directory tree (or latest versions if a recognised version managment system is defined for the project);</td>
103</tr>
104<tr class="field-odd field"><th class="field-name">&#8211;ld:</th><td class="field-body">&lt;log file directory&gt;:  ## directory to take log files;</td>
105</tr>
106<tr class="field-even field"><th class="field-name">-R:</th><td class="field-body">&lt;record file name&gt;: file name for file to take one record per file checked;</td>
107</tr>
108<tr class="field-odd field"><th class="field-name">&#8211;cae:</th><td class="field-body">&#8220;catch all errors&#8221;: will trap exceptions and record in  log files, and then continue. Default is to stop after unrecognised exceptions.</td>
109</tr>
110<tr class="field-even field"><th class="field-name">&#8211;log:</th><td class="field-body">&lt;single|multi&gt;:  Set log file management option &#8211; see &#8220;Single log&#8221; and &#8220;Multi-log&#8221; below.</td>
111</tr>
112<tr class="field-odd field"><th class="field-name">&#8211;blfmode:</th><td class="field-body">&lt;mode&gt;:    Set mode for batch log file &#8211; see log file modes</td>
113</tr>
114<tr class="field-even field"><th class="field-name">&#8211;flfmode:</th><td class="field-body">&lt;mode&gt;:  Set mode for file-level log file &#8211; see log file modes</td>
115</tr>
116<tr class="field-odd field"><th class="field-name">&#8211;aMap:</th><td class="field-body">Read in some attribute mappings and run tests with virtual substitutions;</td>
117</tr>
118</tbody>
119</table>
120</dd>
121</dl>
122<div class="section" id="log-file-modes">
123<h3>Log file modes<a class="headerlink" href="#log-file-modes" title="Permalink to this headline">¶</a></h3>
124<dl class="docutils">
125<dt>Valid modes are: &#8216;a&#8217;: append</dt>
126<dd>&#8216;n&#8217;, &#8216;np&#8217;: new file, &#8216;np&#8217;: protect after closing (mode = 444)
127&#8216;w&#8217;, &#8216;wo&#8217;: write (overwrite if present), &#8216;wo&#8217;: protect after closing (mode = 444)</dd>
128</dl>
129<p>Note that the log files generated in multi-log mode will re-use file names. If running with &#8211;flfmode set to &#8216;n&#8217;,&#8217;np&#8217; or &#8216;wo&#8217; it will be necessary to change or clear the target directory. The names of batch log files include the time, to the nearest second, when the process is started, so will not generally suffer from re-use.</p>
130</div>
131</div>
132</div>
133<div class="section" id="module-c4">
134<span id="c4"></span><h1>c4<a class="headerlink" href="#module-c4" title="Permalink to this headline">¶</a></h1>
135<div class="section" id="c4-py">
136<h2>c4.py<a class="headerlink" href="#c4-py" title="Permalink to this headline">¶</a></h2>
137<p>Entry point for command line usage &#8211; see ccinit for usage information.</p>
138<dl class="function">
139<dt id="c4.main_entry">
140<tt class="descclassname">c4.</tt><tt class="descname">main_entry</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/c4.html#main_entry"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#c4.main_entry" title="Permalink to this definition">¶</a></dt>
141<dd><p>Wrapper around main() for use with setuptools.</p>
142</dd></dl>
143
144</div>
145</div>
146<div class="section" id="module-c4_run">
147<span id="c4-run"></span><h1>c4_run<a class="headerlink" href="#module-c4_run" title="Permalink to this headline">¶</a></h1>
148<div class="section" id="ceda-cc">
149<h2>ceda_cc<a class="headerlink" href="#ceda-cc" title="Permalink to this headline">¶</a></h2>
150<p>Entry point for API.</p>
151</div>
152<div class="section" id="usage">
153<h2>USAGE<a class="headerlink" href="#usage" title="Permalink to this headline">¶</a></h2>
154<p>c4_run.main( &lt;argument list&gt; )</p>
155<dl class="class">
156<dt id="c4_run.main">
157<em class="property">class </em><tt class="descclassname">c4_run.</tt><tt class="descname">main</tt><big>(</big><em>args=None</em>, <em>abortMessageCount=-1</em>, <em>printInfo=False</em>, <em>monitorFileHandles=False</em>, <em>cmdl=None</em><big>)</big><a class="reference internal" href="_modules/c4_run.html#main"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#c4_run.main" title="Permalink to this definition">¶</a></dt>
158<dd><p>Main entry point for execution.</p>
159<p>All compliance tests are completed in the instantiation of a &#8220;main&#8221; object. The object created will contain attributes with test results.</p>
160</dd></dl>
161
162</div>
163</div>
164<div class="section" id="module-config_c4">
165<span id="config-c4"></span><h1>config_c4<a class="headerlink" href="#module-config_c4" title="Permalink to this headline">¶</a></h1>
166<div class="section" id="id1">
167<h2>config_c4<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2>
168<p>USAGE:
169import config_c4</p>
170<p>This module sets some basic variables, including some vocabulary lists.</p>
171<dl class="attribute">
172<dt id="config_c4.NT_fnParts">
173<tt class="descclassname">config_c4.</tt><tt class="descname">NT_fnParts</tt><a class="headerlink" href="#config_c4.NT_fnParts" title="Permalink to this definition">¶</a></dt>
174<dd><p>alias of <tt class="xref py py-class docutils literal"><span class="pre">fnParts</span></tt></p>
175</dd></dl>
176
177<dl class="attribute">
178<dt id="config_c4.NT_project">
179<tt class="descclassname">config_c4.</tt><tt class="descname">NT_project</tt><a class="headerlink" href="#config_c4.NT_project" title="Permalink to this definition">¶</a></dt>
180<dd><p>alias of <tt class="xref py py-class docutils literal"><span class="pre">project</span></tt></p>
181</dd></dl>
182
183<dl class="function">
184<dt id="config_c4.copy_config">
185<tt class="descclassname">config_c4.</tt><tt class="descname">copy_config</tt><big>(</big><em>dest_dir</em><big>)</big><a class="reference internal" href="_modules/config_c4.html#copy_config"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#config_c4.copy_config" title="Permalink to this definition">¶</a></dt>
186<dd><p>Copy the current default configuration directory into a separate directory.</p>
187<p>The directory &lt;ceda_cc-package-dir&gt;/config is copied to <cite>dest_dir</cite>.
188This is useful when ceda-cc is installed as a Python package and the user may
189not know where the config directory is stored.</p>
190<table class="docutils field-list" frame="void" rules="none">
191<col class="field-name" />
192<col class="field-body" />
193<tbody valign="top">
194<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>dest_dir</strong> &#8211; should be a path to a directory which does not yet exist. 
195The configuration directory will be copied to this path.</td>
196</tr>
197</tbody>
198</table>
199</dd></dl>
200
201<dl class="class">
202<dt id="config_c4.projectConfig">
203<em class="property">class </em><tt class="descclassname">config_c4.</tt><tt class="descname">projectConfig</tt><big>(</big><em>project</em>, <em>version=-1</em><big>)</big><a class="reference internal" href="_modules/config_c4.html#projectConfig"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#config_c4.projectConfig" title="Permalink to this definition">¶</a></dt>
204<dd><p>projectConfig:
205Set project specific configuration options.</p>
206<p>pcfg = projectConfig( &lt;project id&gt;[, version=..] )</p>
207<p>Creates a &#8220;pcfg&#8221; object which contains attributes used in the code, including vocabulary lists.</p>
208</dd></dl>
209
210<dl class="class">
211<dt id="config_c4.readVocab">
212<em class="property">class </em><tt class="descclassname">config_c4.</tt><tt class="descname">readVocab</tt><big>(</big><em>dir</em><big>)</big><a class="reference internal" href="_modules/config_c4.html#readVocab"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#config_c4.readVocab" title="Permalink to this definition">¶</a></dt>
213<dd><p>readVocab:
214A general class to read in vocabulary lists (&#8220;code lists&#8221; in ISO 19115 terminology) from a variety of structured text files.</p>
215</dd></dl>
216
217</div>
218</div>
219<div class="section" id="module-utils_c4">
220<span id="utils-c4"></span><h1>utils_c4<a class="headerlink" href="#module-utils_c4" title="Permalink to this headline">¶</a></h1>
221<p>A set of classes running checks and providing utilities to support checks</p>
222<dl class="class">
223<dt id="utils_c4.checkBase">
224<em class="property">class </em><tt class="descclassname">utils_c4.</tt><tt class="descname">checkBase</tt><big>(</big><em>cls='CORDEX'</em>, <em>reportPass=True</em>, <em>parent=None</em>, <em>monitor=None</em><big>)</big><a class="reference internal" href="_modules/utils_c4.html#checkBase"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#utils_c4.checkBase" title="Permalink to this definition">¶</a></dt>
225<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
226<p>Base class for checks, containing a set of standard methods for managing operation of checks and logging of results</p>
227<dl class="method">
228<dt id="utils_c4.checkBase.isInt">
229<tt class="descname">isInt</tt><big>(</big><em>x</em><big>)</big><a class="reference internal" href="_modules/utils_c4.html#checkBase.isInt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#utils_c4.checkBase.isInt" title="Permalink to this definition">¶</a></dt>
230<dd><p>Check that a string is a representation of an integer</p>
231</dd></dl>
232
233<dl class="method">
234<dt id="utils_c4.checkBase.logMessage">
235<tt class="descname">logMessage</tt><big>(</big><em>msg</em>, <em>error=False</em><big>)</big><a class="reference internal" href="_modules/utils_c4.html#checkBase.logMessage"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#utils_c4.checkBase.logMessage" title="Permalink to this definition">¶</a></dt>
236<dd><p>Log messages and count messages</p>
237</dd></dl>
238
239<dl class="method">
240<dt id="utils_c4.checkBase.log_error">
241<tt class="descname">log_error</tt><big>(</big><em>msg</em><big>)</big><a class="reference internal" href="_modules/utils_c4.html#checkBase.log_error"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#utils_c4.checkBase.log_error" title="Permalink to this definition">¶</a></dt>
242<dd><p>Create an error log message and call logMessage; count errors;</p>
243</dd></dl>
244
245<dl class="method">
246<dt id="utils_c4.checkBase.log_exception">
247<tt class="descname">log_exception</tt><big>(</big><em>msg</em><big>)</big><a class="reference internal" href="_modules/utils_c4.html#checkBase.log_exception"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#utils_c4.checkBase.log_exception" title="Permalink to this definition">¶</a></dt>
248<dd><p>Logging of exceptions &#8211; putting trace information in log files</p>
249</dd></dl>
250
251<dl class="method">
252<dt id="utils_c4.checkBase.log_pass">
253<tt class="descname">log_pass</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/utils_c4.html#checkBase.log_pass"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#utils_c4.checkBase.log_pass" title="Permalink to this definition">¶</a></dt>
254<dd><p>Create a pass log message and call logMessage; count passes;</p>
255</dd></dl>
256
257<dl class="method">
258<dt id="utils_c4.checkBase.runChecks">
259<tt class="descname">runChecks</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/utils_c4.html#checkBase.runChecks"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#utils_c4.checkBase.runChecks" title="Permalink to this definition">¶</a></dt>
260<dd><p>Run all the checks registered in this instance (in self.checks) and handle exceptions</p>
261</dd></dl>
262
263<dl class="method">
264<dt id="utils_c4.checkBase.test">
265<tt class="descname">test</tt><big>(</big><em>res</em>, <em>msg</em>, <em>abort=False</em>, <em>part=False</em>, <em>appendLogfile=(None</em>, <em>None)</em><big>)</big><a class="reference internal" href="_modules/utils_c4.html#checkBase.test"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#utils_c4.checkBase.test" title="Permalink to this definition">¶</a></dt>
266<dd><p>Handle test results.
267:param res: [True/False] result of test;
268:param msg: Message describing the test;
269:param abort: {optional} Set True if checks should be aborted when test fails;
270:param part: {optional} Set True if this is a component of a test (logging of pass suppressed);
271:param appendLogfile: {optional} Allows results to be appended to pre-existing log file;</p>
272</dd></dl>
273
274</dd></dl>
275
276<dl class="class">
277<dt id="utils_c4.checkByVar">
278<em class="property">class </em><tt class="descclassname">utils_c4.</tt><tt class="descname">checkByVar</tt><big>(</big><em>cls='CORDEX'</em>, <em>reportPass=True</em>, <em>parent=None</em>, <em>monitor=None</em><big>)</big><a class="reference internal" href="_modules/utils_c4.html#checkByVar"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#utils_c4.checkByVar" title="Permalink to this definition">¶</a></dt>
279<dd><p>Bases: <a class="reference internal" href="#utils_c4.checkBase" title="utils_c4.checkBase"><tt class="xref py py-class docutils literal"><span class="pre">utils_c4.checkBase</span></tt></a></p>
280<p>Run some checks on groups of files with a common variable. Checks for continuity of time in group</p>
281<dl class="method">
282<dt id="utils_c4.checkByVar.checkThisTrange">
283<tt class="descname">checkThisTrange</tt><big>(</big><em>tt</em>, <em>group</em><big>)</big><a class="reference internal" href="_modules/utils_c4.html#checkByVar.checkThisTrange"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#utils_c4.checkByVar.checkThisTrange" title="Permalink to this definition">¶</a></dt>
284<dd><p>Check consistency across a list of time ranges</p>
285</dd></dl>
286
287<dl class="method">
288<dt id="utils_c4.checkByVar.checkTrange">
289<tt class="descname">checkTrange</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/utils_c4.html#checkByVar.checkTrange"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#utils_c4.checkByVar.checkTrange" title="Permalink to this definition">¶</a></dt>
290<dd><p>Manage time range checks: loop over groups of files identified by <a class="reference internal" href="#utils_c4.checkByVar.impt" title="utils_c4.checkByVar.impt"><tt class="xref py py-meth docutils literal"><span class="pre">impt()</span></tt></a></p>
291</dd></dl>
292
293<dl class="method">
294<dt id="utils_c4.checkByVar.impt">
295<tt class="descname">impt</tt><big>(</big><em>flist</em><big>)</big><a class="reference internal" href="_modules/utils_c4.html#checkByVar.impt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#utils_c4.checkByVar.impt" title="Permalink to this definition">¶</a></dt>
296<dd><dl class="docutils">
297<dt>Scan a list of files and identify groups which a common variable and extract time ranges into a dictionary of lists, keyed on group identifiers.</dt>
298<dd><table class="first last docutils field-list" frame="void" rules="none">
299<col class="field-name" />
300<col class="field-body" />
301<tbody valign="top">
302<tr class="field-odd field"><th class="field-name">param flist:</th><td class="field-body">List of file names.</td>
303</tr>
304</tbody>
305</table>
306</dd>
307</dl>
308<p>This routine has rather obscure nested logical tests used to identify the group to which a file belongs. The complexity arises from the fact that the identification of the files that should form a continuous time series from the file names alone is not a standardised feature of the file names.</p>
309</dd></dl>
310
311<dl class="method">
312<dt id="utils_c4.checkByVar.isInt">
313<tt class="descname">isInt</tt><big>(</big><em>x</em><big>)</big><a class="headerlink" href="#utils_c4.checkByVar.isInt" title="Permalink to this definition">¶</a></dt>
314<dd><p>Check that a string is a representation of an integer</p>
315</dd></dl>
316
317<dl class="method">
318<dt id="utils_c4.checkByVar.logMessage">
319<tt class="descname">logMessage</tt><big>(</big><em>msg</em>, <em>error=False</em><big>)</big><a class="headerlink" href="#utils_c4.checkByVar.logMessage" title="Permalink to this definition">¶</a></dt>
320<dd><p>Log messages and count messages</p>
321</dd></dl>
322
323<dl class="method">
324<dt id="utils_c4.checkByVar.log_error">
325<tt class="descname">log_error</tt><big>(</big><em>msg</em><big>)</big><a class="headerlink" href="#utils_c4.checkByVar.log_error" title="Permalink to this definition">¶</a></dt>
326<dd><p>Create an error log message and call logMessage; count errors;</p>
327</dd></dl>
328
329<dl class="method">
330<dt id="utils_c4.checkByVar.log_exception">
331<tt class="descname">log_exception</tt><big>(</big><em>msg</em><big>)</big><a class="headerlink" href="#utils_c4.checkByVar.log_exception" title="Permalink to this definition">¶</a></dt>
332<dd><p>Logging of exceptions &#8211; putting trace information in log files</p>
333</dd></dl>
334
335<dl class="method">
336<dt id="utils_c4.checkByVar.log_pass">
337<tt class="descname">log_pass</tt><big>(</big><big>)</big><a class="headerlink" href="#utils_c4.checkByVar.log_pass" title="Permalink to this definition">¶</a></dt>
338<dd><p>Create a pass log message and call logMessage; count passes;</p>
339</dd></dl>
340
341<dl class="method">
342<dt id="utils_c4.checkByVar.runChecks">
343<tt class="descname">runChecks</tt><big>(</big><big>)</big><a class="headerlink" href="#utils_c4.checkByVar.runChecks" title="Permalink to this definition">¶</a></dt>
344<dd><p>Run all the checks registered in this instance (in self.checks) and handle exceptions</p>
345</dd></dl>
346
347<dl class="method">
348<dt id="utils_c4.checkByVar.test">
349<tt class="descname">test</tt><big>(</big><em>res</em>, <em>msg</em>, <em>abort=False</em>, <em>part=False</em>, <em>appendLogfile=(None</em>, <em>None)</em><big>)</big><a class="headerlink" href="#utils_c4.checkByVar.test" title="Permalink to this definition">¶</a></dt>
350<dd><p>Handle test results.
351:param res: [True/False] result of test;
352:param msg: Message describing the test;
353:param abort: {optional} Set True if checks should be aborted when test fails;
354:param part: {optional} Set True if this is a component of a test (logging of pass suppressed);
355:param appendLogfile: {optional} Allows results to be appended to pre-existing log file;</p>
356</dd></dl>
357
358</dd></dl>
359
360<dl class="class">
361<dt id="utils_c4.checkFileName">
362<em class="property">class </em><tt class="descclassname">utils_c4.</tt><tt class="descname">checkFileName</tt><big>(</big><em>cls='CORDEX'</em>, <em>reportPass=True</em>, <em>parent=None</em>, <em>monitor=None</em><big>)</big><a class="reference internal" href="_modules/utils_c4.html#checkFileName"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#utils_c4.checkFileName" title="Permalink to this definition">¶</a></dt>
363<dd><p>Bases: <a class="reference internal" href="#utils_c4.checkBase" title="utils_c4.checkBase"><tt class="xref py py-class docutils literal"><span class="pre">utils_c4.checkBase</span></tt></a></p>
364<p>Check basic syntax of file names (i.e. checks properties of the text string, it does not attempt to access the file).
365Inherits <a class="reference internal" href="#utils_c4.checkBase" title="utils_c4.checkBase"><tt class="xref py py-class docutils literal"><span class="pre">checkBase</span></tt></a> class. Checks are run by the <a class="reference internal" href="#utils_c4.checkFileName.check" title="utils_c4.checkFileName.check"><tt class="xref py py-meth docutils literal"><span class="pre">check()</span></tt></a> method.</p>
366<dl class="method">
367<dt id="utils_c4.checkFileName.check">
368<tt class="descname">check</tt><big>(</big><em>fn</em><big>)</big><a class="reference internal" href="_modules/utils_c4.html#checkFileName.check"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#utils_c4.checkFileName.check" title="Permalink to this definition">¶</a></dt>
369<dd><p>Initiate checks: manage arguments and then call <em>runChecks</em> (inherited from checkBase class).
370Arguments: fn: file name: the file name to be checked.</p>
371</dd></dl>
372
373<dl class="method">
374<dt id="utils_c4.checkFileName.do_check_fn">
375<tt class="descname">do_check_fn</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/utils_c4.html#checkFileName.do_check_fn"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#utils_c4.checkFileName.do_check_fn" title="Permalink to this definition">¶</a></dt>
376<dd><p>Basic file name checks:
377(1) Check suffix;
378(1b) [for ESA-CCI files] check presence of &#8220;ESACCI&#8221; and identify file naming convention;
379(2) Split file name into components and check number of such components;
380(3) Additional specialist checks for ESA-CCI, CORDEX, CMIP-type (for the time range).</p>
381</dd></dl>
382
383<dl class="method">
384<dt id="utils_c4.checkFileName.do_check_fnextra">
385<tt class="descname">do_check_fnextra</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/utils_c4.html#checkFileName.do_check_fnextra"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#utils_c4.checkFileName.do_check_fnextra" title="Permalink to this definition">¶</a></dt>
386<dd><p>Check whether file name components match constraints &#8211; but only if those constraints are not implicitly verified through comparison with global attributes in later checks</p>
387</dd></dl>
388
389<dl class="method">
390<dt id="utils_c4.checkFileName.isInt">
391<tt class="descname">isInt</tt><big>(</big><em>x</em><big>)</big><a class="headerlink" href="#utils_c4.checkFileName.isInt" title="Permalink to this definition">¶</a></dt>
392<dd><p>Check that a string is a representation of an integer</p>
393</dd></dl>
394
395<dl class="method">
396<dt id="utils_c4.checkFileName.logMessage">
397<tt class="descname">logMessage</tt><big>(</big><em>msg</em>, <em>error=False</em><big>)</big><a class="headerlink" href="#utils_c4.checkFileName.logMessage" title="Permalink to this definition">¶</a></dt>
398<dd><p>Log messages and count messages</p>
399</dd></dl>
400
401<dl class="method">
402<dt id="utils_c4.checkFileName.log_error">
403<tt class="descname">log_error</tt><big>(</big><em>msg</em><big>)</big><a class="headerlink" href="#utils_c4.checkFileName.log_error" title="Permalink to this definition">¶</a></dt>
404<dd><p>Create an error log message and call logMessage; count errors;</p>
405</dd></dl>
406
407<dl class="method">
408<dt id="utils_c4.checkFileName.log_exception">
409<tt class="descname">log_exception</tt><big>(</big><em>msg</em><big>)</big><a class="headerlink" href="#utils_c4.checkFileName.log_exception" title="Permalink to this definition">¶</a></dt>
410<dd><p>Logging of exceptions &#8211; putting trace information in log files</p>
411</dd></dl>
412
413<dl class="method">
414<dt id="utils_c4.checkFileName.log_pass">
415<tt class="descname">log_pass</tt><big>(</big><big>)</big><a class="headerlink" href="#utils_c4.checkFileName.log_pass" title="Permalink to this definition">¶</a></dt>
416<dd><p>Create a pass log message and call logMessage; count passes;</p>
417</dd></dl>
418
419<dl class="method">
420<dt id="utils_c4.checkFileName.runChecks">
421<tt class="descname">runChecks</tt><big>(</big><big>)</big><a class="headerlink" href="#utils_c4.checkFileName.runChecks" title="Permalink to this definition">¶</a></dt>
422<dd><p>Run all the checks registered in this instance (in self.checks) and handle exceptions</p>
423</dd></dl>
424
425<dl class="method">
426<dt id="utils_c4.checkFileName.test">
427<tt class="descname">test</tt><big>(</big><em>res</em>, <em>msg</em>, <em>abort=False</em>, <em>part=False</em>, <em>appendLogfile=(None</em>, <em>None)</em><big>)</big><a class="headerlink" href="#utils_c4.checkFileName.test" title="Permalink to this definition">¶</a></dt>
428<dd><p>Handle test results.
429:param res: [True/False] result of test;
430:param msg: Message describing the test;
431:param abort: {optional} Set True if checks should be aborted when test fails;
432:param part: {optional} Set True if this is a component of a test (logging of pass suppressed);
433:param appendLogfile: {optional} Allows results to be appended to pre-existing log file;</p>
434</dd></dl>
435
436</dd></dl>
437
438<dl class="class">
439<dt id="utils_c4.checkGlobalAttributes">
440<em class="property">class </em><tt class="descclassname">utils_c4.</tt><tt class="descname">checkGlobalAttributes</tt><big>(</big><em>cls='CORDEX'</em>, <em>reportPass=True</em>, <em>parent=None</em>, <em>monitor=None</em><big>)</big><a class="reference internal" href="_modules/utils_c4.html#checkGlobalAttributes"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#utils_c4.checkGlobalAttributes" title="Permalink to this definition">¶</a></dt>
441<dd><p>Bases: <a class="reference internal" href="#utils_c4.checkBase" title="utils_c4.checkBase"><tt class="xref py py-class docutils literal"><span class="pre">utils_c4.checkBase</span></tt></a></p>
442<p>Check global and variable attributes, using tables of valid values</p>
443<dl class="method">
444<dt id="utils_c4.checkGlobalAttributes.isInt">
445<tt class="descname">isInt</tt><big>(</big><em>x</em><big>)</big><a class="headerlink" href="#utils_c4.checkGlobalAttributes.isInt" title="Permalink to this definition">¶</a></dt>
446<dd><p>Check that a string is a representation of an integer</p>
447</dd></dl>
448
449<dl class="method">
450<dt id="utils_c4.checkGlobalAttributes.logMessage">
451<tt class="descname">logMessage</tt><big>(</big><em>msg</em>, <em>error=False</em><big>)</big><a class="headerlink" href="#utils_c4.checkGlobalAttributes.logMessage" title="Permalink to this definition">¶</a></dt>
452<dd><p>Log messages and count messages</p>
453</dd></dl>
454
455<dl class="method">
456<dt id="utils_c4.checkGlobalAttributes.log_error">
457<tt class="descname">log_error</tt><big>(</big><em>msg</em><big>)</big><a class="headerlink" href="#utils_c4.checkGlobalAttributes.log_error" title="Permalink to this definition">¶</a></dt>
458<dd><p>Create an error log message and call logMessage; count errors;</p>
459</dd></dl>
460
461<dl class="method">
462<dt id="utils_c4.checkGlobalAttributes.log_exception">
463<tt class="descname">log_exception</tt><big>(</big><em>msg</em><big>)</big><a class="headerlink" href="#utils_c4.checkGlobalAttributes.log_exception" title="Permalink to this definition">¶</a></dt>
464<dd><p>Logging of exceptions &#8211; putting trace information in log files</p>
465</dd></dl>
466
467<dl class="method">
468<dt id="utils_c4.checkGlobalAttributes.log_pass">
469<tt class="descname">log_pass</tt><big>(</big><big>)</big><a class="headerlink" href="#utils_c4.checkGlobalAttributes.log_pass" title="Permalink to this definition">¶</a></dt>
470<dd><p>Create a pass log message and call logMessage; count passes;</p>
471</dd></dl>
472
473<dl class="method">
474<dt id="utils_c4.checkGlobalAttributes.runChecks">
475<tt class="descname">runChecks</tt><big>(</big><big>)</big><a class="headerlink" href="#utils_c4.checkGlobalAttributes.runChecks" title="Permalink to this definition">¶</a></dt>
476<dd><p>Run all the checks registered in this instance (in self.checks) and handle exceptions</p>
477</dd></dl>
478
479<dl class="method">
480<dt id="utils_c4.checkGlobalAttributes.test">
481<tt class="descname">test</tt><big>(</big><em>res</em>, <em>msg</em>, <em>abort=False</em>, <em>part=False</em>, <em>appendLogfile=(None</em>, <em>None)</em><big>)</big><a class="headerlink" href="#utils_c4.checkGlobalAttributes.test" title="Permalink to this definition">¶</a></dt>
482<dd><p>Handle test results.
483:param res: [True/False] result of test;
484:param msg: Message describing the test;
485:param abort: {optional} Set True if checks should be aborted when test fails;
486:param part: {optional} Set True if this is a component of a test (logging of pass suppressed);
487:param appendLogfile: {optional} Allows results to be appended to pre-existing log file;</p>
488</dd></dl>
489
490</dd></dl>
491
492<dl class="class">
493<dt id="utils_c4.checkStandardDims">
494<em class="property">class </em><tt class="descclassname">utils_c4.</tt><tt class="descname">checkStandardDims</tt><big>(</big><em>cls='CORDEX'</em>, <em>reportPass=True</em>, <em>parent=None</em>, <em>monitor=None</em><big>)</big><a class="reference internal" href="_modules/utils_c4.html#checkStandardDims"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#utils_c4.checkStandardDims" title="Permalink to this definition">¶</a></dt>
495<dd><p>Bases: <a class="reference internal" href="#utils_c4.checkBase" title="utils_c4.checkBase"><tt class="xref py py-class docutils literal"><span class="pre">utils_c4.checkBase</span></tt></a></p>
496<p>Check the dimensions which are defined in the specifications</p>
497<dl class="method">
498<dt id="utils_c4.checkStandardDims.isInt">
499<tt class="descname">isInt</tt><big>(</big><em>x</em><big>)</big><a class="headerlink" href="#utils_c4.checkStandardDims.isInt" title="Permalink to this definition">¶</a></dt>
500<dd><p>Check that a string is a representation of an integer</p>
501</dd></dl>
502
503<dl class="method">
504<dt id="utils_c4.checkStandardDims.logMessage">
505<tt class="descname">logMessage</tt><big>(</big><em>msg</em>, <em>error=False</em><big>)</big><a class="headerlink" href="#utils_c4.checkStandardDims.logMessage" title="Permalink to this definition">¶</a></dt>
506<dd><p>Log messages and count messages</p>
507</dd></dl>
508
509<dl class="method">
510<dt id="utils_c4.checkStandardDims.log_error">
511<tt class="descname">log_error</tt><big>(</big><em>msg</em><big>)</big><a class="headerlink" href="#utils_c4.checkStandardDims.log_error" title="Permalink to this definition">¶</a></dt>
512<dd><p>Create an error log message and call logMessage; count errors;</p>
513</dd></dl>
514
515<dl class="method">
516<dt id="utils_c4.checkStandardDims.log_exception">
517<tt class="descname">log_exception</tt><big>(</big><em>msg</em><big>)</big><a class="headerlink" href="#utils_c4.checkStandardDims.log_exception" title="Permalink to this definition">¶</a></dt>
518<dd><p>Logging of exceptions &#8211; putting trace information in log files</p>
519</dd></dl>
520
521<dl class="method">
522<dt id="utils_c4.checkStandardDims.log_pass">
523<tt class="descname">log_pass</tt><big>(</big><big>)</big><a class="headerlink" href="#utils_c4.checkStandardDims.log_pass" title="Permalink to this definition">¶</a></dt>
524<dd><p>Create a pass log message and call logMessage; count passes;</p>
525</dd></dl>
526
527<dl class="method">
528<dt id="utils_c4.checkStandardDims.runChecks">
529<tt class="descname">runChecks</tt><big>(</big><big>)</big><a class="headerlink" href="#utils_c4.checkStandardDims.runChecks" title="Permalink to this definition">¶</a></dt>
530<dd><p>Run all the checks registered in this instance (in self.checks) and handle exceptions</p>
531</dd></dl>
532
533<dl class="method">
534<dt id="utils_c4.checkStandardDims.test">
535<tt class="descname">test</tt><big>(</big><em>res</em>, <em>msg</em>, <em>abort=False</em>, <em>part=False</em>, <em>appendLogfile=(None</em>, <em>None)</em><big>)</big><a class="headerlink" href="#utils_c4.checkStandardDims.test" title="Permalink to this definition">¶</a></dt>
536<dd><p>Handle test results.
537:param res: [True/False] result of test;
538:param msg: Message describing the test;
539:param abort: {optional} Set True if checks should be aborted when test fails;
540:param part: {optional} Set True if this is a component of a test (logging of pass suppressed);
541:param appendLogfile: {optional} Allows results to be appended to pre-existing log file;</p>
542</dd></dl>
543
544</dd></dl>
545
546</div>
547<div class="section" id="module-xceptions">
548<span id="xceptions"></span><h1>xceptions<a class="headerlink" href="#module-xceptions" title="Permalink to this headline">¶</a></h1>
549<p>Some exceptions used in the code</p>
550<dl class="exception">
551<dt id="xceptions.abortChecks">
552<em class="property">exception </em><tt class="descclassname">xceptions.</tt><tt class="descname">abortChecks</tt><a class="reference internal" href="_modules/xceptions.html#abortChecks"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xceptions.abortChecks" title="Permalink to this definition">¶</a></dt>
553<dd><p>Raised when checks are aborted following failure of a critical test (e.g. file name cannot be parsed).</p>
554</dd></dl>
555
556<dl class="exception">
557<dt id="xceptions.baseException">
558<em class="property">exception </em><tt class="descclassname">xceptions.</tt><tt class="descname">baseException</tt><big>(</big><em>msg</em><big>)</big><a class="reference internal" href="_modules/xceptions.html#baseException"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xceptions.baseException" title="Permalink to this definition">¶</a></dt>
559<dd><p>Basic exception for general use in code.</p>
560</dd></dl>
561
562<dl class="exception">
563<dt id="xceptions.loggedException">
564<em class="property">exception </em><tt class="descclassname">xceptions.</tt><tt class="descname">loggedException</tt><a class="reference internal" href="_modules/xceptions.html#loggedException"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#xceptions.loggedException" title="Permalink to this definition">¶</a></dt>
565<dd><p>Raised after an exception has been caught and logged in a checking class, allowing execution to fall back to the loop over files.</p>
566</dd></dl>
567
568</div>
569<div class="section" id="indices-and-tables">
570<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h1>
571<ul class="simple">
572<li><a class="reference internal" href="genindex.html"><em>Index</em></a></li>
573<li><a class="reference internal" href="py-modindex.html"><em>Module Index</em></a></li>
574<li><a class="reference internal" href="search.html"><em>Search Page</em></a></li>
575</ul>
576</div>
577
578
579          </div>
580        </div>
581      </div>
582      <div class="sphinxsidebar">
583        <div class="sphinxsidebarwrapper">
584  <h3><a href="#">Table Of Contents</a></h3>
585  <ul>
586<li><a class="reference internal" href="#">The ceda-cc file compliance checker: technical documentation</a></li>
587<li><a class="reference internal" href="#usage-ccinit">Usage (ccinit)</a><ul>
588<li><a class="reference internal" href="#calling-options">Calling options</a><ul>
589<li><a class="reference internal" href="#log-file-modes">Log file modes</a></li>
590</ul>
591</li>
592</ul>
593</li>
594<li><a class="reference internal" href="#module-c4">c4</a><ul>
595<li><a class="reference internal" href="#c4-py">c4.py</a></li>
596</ul>
597</li>
598<li><a class="reference internal" href="#module-c4_run">c4_run</a><ul>
599<li><a class="reference internal" href="#ceda-cc">ceda_cc</a></li>
600<li><a class="reference internal" href="#usage">USAGE</a></li>
601</ul>
602</li>
603<li><a class="reference internal" href="#module-config_c4">config_c4</a><ul>
604<li><a class="reference internal" href="#id1">config_c4</a></li>
605</ul>
606</li>
607<li><a class="reference internal" href="#module-utils_c4">utils_c4</a></li>
608<li><a class="reference internal" href="#module-xceptions">xceptions</a></li>
609<li><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li>
610</ul>
611
612  <h3>This Page</h3>
613  <ul class="this-page-menu">
614    <li><a href="_sources/index.txt"
615           rel="nofollow">Show Source</a></li>
616  </ul>
617<div id="searchbox" style="display: none">
618  <h3>Quick search</h3>
619    <form class="search" action="search.html" method="get">
620      <input type="text" name="q" />
621      <input type="submit" value="Go" />
622      <input type="hidden" name="check_keywords" value="yes" />
623      <input type="hidden" name="area" value="default" />
624    </form>
625    <p class="searchtip" style="font-size: 90%">
626    Enter search terms or a module, class or function name.
627    </p>
628</div>
629<script type="text/javascript">$('#searchbox').show(0);</script>
630        </div>
631      </div>
632      <div class="clearer"></div>
633    </div>
634    <div class="related">
635      <h3>Navigation</h3>
636      <ul>
637        <li class="right" style="margin-right: 10px">
638          <a href="genindex.html" title="General Index"
639             >index</a></li>
640        <li class="right" >
641          <a href="py-modindex.html" title="Python Module Index"
642             >modules</a> |</li>
643        <li><a href="#">ceda-cc 1.3.1+ documentation</a> &raquo;</li> 
644      </ul>
645    </div>
646    <div class="footer">
647        &copy; Copyright 2015, Martin Juckes.
648      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
649    </div>
650  </body>
651</html>
Note: See TracBrowser for help on using the repository browser.