Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
HTML
<div class="section" id="defining-a-new-suite">
<span id="defining-a-suite"></span><span id="index-0"></span>
<div class="line-block">
<div class="line">There are several ways of defining the <a class="reference internal" href="/wiki/display/ECFLOW/Glossary#term-suite-definition"><em class="xref std std-term">suite definition</em></a>. See <a class="reference internal" href="/wiki/display/ECFLOW/Definition+creation+strategies#strategy"><em>Definition creation strategies</em></a>.</div>
<div class="line">This tutorial will usegive examples for both the plain text and Python methods.</div>
</div>
<div class="section" id="text-method">
<h2>Text<a<h2>Text Method<a class="headerlink" href="#text-method" title="Permalink to this headline">¶</a></h2>
<p>Create a file called <tt class="file docutils literal"><span class="pre">test.def</span></tt>,using your favourite text editor, with the following contents</p>
<div class="highlight-python"><pre># Definition of the suite test

suite test
   edit ECF_HOME "$HOME/course"  # replace '$HOME' with the path to your home directory
   task t1
endsuite</pre>
</div>
<div class="line-block">
<div class="line">This file contains the <a class="reference internal" href="/wiki/display/ECFLOW/Glossary#term-suite-definition"><em class="xref std std-term">suite definition</em></a> of a <a class="reference internal" href="/wiki/display/ECFLOW/Glossary#term-suite"><em class="xref std std-term">suite</em></a> called test.</div>
<div class="line">This suite contains a single <a class="reference internal" href="/wiki/display/ECFLOW/Glossary#term-task"><em class="xref std std-term">task</em></a> called <strong>t1</strong>.</div>
<div class="line">Let us go through the lines one by one:</div>
</div>
<ol class="arabic simple">
<li><p class="first">This<li>This line is a comment line. Any characters between the # and the end of line are ignored</p>
</li>
<li><p class="first">The <li>The second line is empty</p>
</li>
<li><p class="first">This <li>This line defines a new <a class="reference internal" href="/wiki/display/ECFLOW/Glossary#term-suite"><em class="xref std std-term">suite</em></a> by the name of test.</p>
</li>
<li><p class="first">Here<li>Here we define a ecflow <a class="reference internal" href="/wiki/display/ECFLOW/Glossary#term-variable"><em class="xref std std-term">variable</em></a> called ECF_HOME.</p>
<p>ThisThis <a class="reference internal" href="/wiki/display/ECFLOW/Glossary#term-variable"><em class="xref std std-term">variable</em></a> defines the directory where all the unix files that will be used by the <a class="reference internal" href="/wiki/display/ECFLOW/Glossary#term-suite"><em class="xref std std-term">suite</em></a> test will reside.</p>
<p>ForFor the rest of the course all file names will be given relative to this directory.</p>
<p>BeBe sure to <strong>replace</strong> $HOME with the path to your home directory</p>
</li>
<li><p class="first">This <li>This defines a <a class="reference internal" href="/wiki/display/ECFLOW/Glossary#term-task"><em class="xref std std-term">task</em></a> named <strong>t1</strong></p>
</li>
<li><p class="first">The<li>The <a class="reference internal" href="/wiki/display/ECFLOW/Definition+file+Grammar#grammar-token-endsuite"><tt class="xref std std-token docutils literal"><span class="pre">endsuite</span></tt></a> finishes the definition of the <a class="reference internal" href="/wiki/display/ECFLOW/Glossary#term-suite"><em class="xref std std-term">suite</em></a> test</p>
</li>
</ol>
</div>
<div class="section" id="python-method">
<h2>Python<a<h2>Python Method<a class="headerlink" href="#python-method" title="Permalink to this headline">¶</a></h2>
<p>Alternatively<p>Enter enter the following python code into a file, i.e <tt class="file docutils literal"><span class="pre">test.py</span></tt> :</p>
<div class="highlight-python"><div class="highlight"><pre><span class="c">#!/usr/bin/env python2.7</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">ecflow</span> 
   
<span class="k">print</span> <span class="s">&quot;Creating suite definition&quot;</span>   
<span class="n">defs</span> <span class="o">=</span> <span class="n">ecflow</span><span class="o">.</span><span class="n">Defs</span><span class="p">()</span>
<span class="n">suite</span> <span class="o">=</span> <span class="n">defs</span><span class="o">.</span><span class="n">add_suite</span><span class="p">(</span><span class="s">&quot;test&quot;</span><span class="p">)</span>
<span class="n">suite</span><span class="o">.</span><span class="n">add_variable</span><span class="p">(</span><span class="s">&quot;ECF_HOME&quot;</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">getenv</span><span class="p">(</span><span class="s">&quot;HOME&quot;</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot;/course&quot;</span><span class="p">)</span>
<span class="n">suite</span><span class="o">.</span><span class="n">add_task</span><span class="p">(</span><span class="s">&quot;t1&quot;</span><span class="p">)</span>
</pre></div>
</div>
<p>Then run as a python script:</p>
<div class="highlight-python"><pre>python test.py</pre>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">All the following python examples should be run in the same way.</p>
</div>
<p><strong>What to do:</strong></p>
<ol class="arabic simple">
<li>Choose<li>Initially betweentry enteringboth plain text or python<and python examples. Later examples are only in python.</li>
<li>Type in the <a class="reference internal" href="/wiki/display/ECFLOW/Glossary#term-suite-definition"><em class="xref std std-term">suite definition</em></a> file.</li>
</ol>
</div>
</div>