The Higher Education and Research forge

Home My Page Projects Code Snippets Project Openings EMULSION public releases
Summary Activity Surveys SCM Listes Sympa

SCM Repository

index 3035f9e..00b7a70 100644 (file)
@@ -49,22 +49,25 @@ working with a <strong>bash</strong> shell. If you are not sure, typing: <code c
 the documentation of your shell to adapt the commands below.</p>
 </dd>
 <dt>Language</dt>
-<dd><p class="first">EMULSION is written in Python3 (version 3.6 or higher). In what
+<dd><p class="first">EMULSION is written in <strong>Python 3</strong> (version 3.6 or higher). In what
 follows, we assume that <code class="docutils literal notranslate"><span class="pre">python3</span></code> and <code class="docutils literal notranslate"><span class="pre">pip3</span></code> refer to your
 Python3 installation. If not, replace them by your own
 configuration in the commands below (e.g. with Windows:
 respectively <code class="docutils literal notranslate"><span class="pre">python.exe</span></code> and <code class="docutils literal notranslate"><span class="pre">pip.exe</span></code>).</p>
-<p class="last">To install Python on your system, please consult <a class="reference external" href="https://www.python.org/downloads/">Python website</a></p>
+<p class="last">To install Python on your system, please consult
+<a class="reference external" href="https://www.python.org/downloads/">Python website</a>. When
+installing on Windows, check the box “Add Python 3.x to PATH” to
+make python commands available from the terminal.</p>
 </dd>
 </dl>
 </div>
-<div class="section" id="install-with-pip">
-<h2>Install with <code class="docutils literal notranslate"><span class="pre">pip</span></code><a class="headerlink" href="#install-with-pip" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="install-with-pip-recommended">
+<h2>Install with <code class="docutils literal notranslate"><span class="pre">pip</span></code> (recommended)<a class="headerlink" href="#install-with-pip-recommended" title="Permalink to this headline">¶</a></h2>
 <div class="section" id="linux-and-macos">
 <h3>Linux and MacOS:<a class="headerlink" href="#linux-and-macos" title="Permalink to this headline">¶</a></h3>
 <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo pip3 install emulsion
 init_emulsion
-<span class="nb">source</span> <span class="nv">$HOME</span>/.basrc
+<span class="nb">source</span> <span class="nv">$HOME</span>/.bashrc
 </pre></div>
 </div>
 <p>Depending on how you installed Python, <code class="docutils literal notranslate"><span class="pre">sudo</span></code> is sometimes
@@ -72,8 +75,10 @@ optional.</p>
 <p>The second command (<code class="docutils literal notranslate"><span class="pre">init_emulsion</span></code>) initializes command-line
 completion (available with a bash shell, under Linux or MacOS), which allows
 to use <code class="docutils literal notranslate"><span class="pre">TAB</span></code> key to get suggestions on what is expected (options,
-files, parameters…) in the command.</p>
-<p>When installing with <code class="docutils literal notranslate"><span class="pre">pip</span></code>, <a class="reference external" href="https://sourcesup.renater.fr/emulsion-public">documentation</a>
+files, parameters…) in the command. It also creates (or modifies)
+the environment variable named <code class="docutils literal notranslate"><span class="pre">PYTHONPATH</span></code> to make EMULSION able to
+find code add-ons located in the same directory as your models.</p>
+<p>EMULSION <a class="reference external" href="https://sourcesup.renater.fr/emulsion-public">documentation</a>
 is provided on-line.</p>
 </div>
 <div class="section" id="windows">
@@ -81,56 +86,29 @@ is provided on-line.</p>
 <p>Open a terminal (“Command Prompt” or “Windows Power Shell”), then
 type:</p>
 <div class="highlight-batch notranslate"><div class="highlight"><pre><span></span>pip.exe install emulsion
-setx PYTHONPATH <span class="s2">&quot;</span><span class="nv">%PYTHONPATH%</span><span class="s2">;.&quot;</span>
 </pre></div>
 </div>
-</div>
-</div>
-<div class="section" id="install-with-git">
-<h2>Install with <code class="docutils literal notranslate"><span class="pre">git</span></code><a class="headerlink" href="#install-with-git" title="Permalink to this headline">¶</a></h2>
-<p>This procedure assumes that you have <code class="docutils literal notranslate"><span class="pre">git</span></code> already
-<a class="reference external" href="https://git-scm.com/downloads">installed on your system</a>.
-It is provided here for Linux or MacOS.</p>
-<ol class="arabic">
-<li><p class="first">Install (or update) required packages</p>
-<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo pip3 install numpy scipy matplotlib pandas <span class="s1">&#39;sympy&lt;1.3&#39;</span> mpmath
-sudo pip3 install networkx docopt jinja2 textx
-sudo pip3 install sortedcontainers tqdm pyyaml colorama
-sudo pip3 install bokeh sqlalchemy utm
-</pre></div>
-</div>
-</li>
-<li><p class="first">Clone the EMULSION repository</p>
-<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>git clone https://git.renater.fr/emulsion-public.git
-<span class="nb">cd</span> emulsion-public
+<p>To make EMULSION able to find code add-ons in the directory where your model
+files are located, you must declare (or modify) an environment
+variable named <code class="docutils literal notranslate"><span class="pre">PYTHONPATH</span></code> to add the current directory (“<code class="docutils literal notranslate"><span class="pre">.</span></code>”).</p>
+<p>To do so, you can use the graphical interface (from System
+Preferences), or the terminal. The syntax depends on the kind of
+terminal you are using:</p>
+<blockquote>
+<div><ul>
+<li><p class="first">with the “Command Prompt” (<code class="docutils literal notranslate"><span class="pre">cmd.exe</span></code>), type:</p>
+<div class="highlight-batch notranslate"><div class="highlight"><pre><span></span>setx PYTHONPATH <span class="s2">&quot;.;</span><span class="nv">%PYTHONPATH%</span><span class="s2">&quot;</span>
 </pre></div>
 </div>
 </li>
-<li><p class="first">Add the local directory and <code class="docutils literal notranslate"><span class="pre">src</span></code> directory to your <code class="docutils literal notranslate"><span class="pre">PYTHONPATH</span></code> environment
-variable.</p>
-<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">echo</span> <span class="s2">&quot;export PYTHONPATH=</span><span class="k">$(</span><span class="nb">pwd</span><span class="k">)</span><span class="s2">/src:.&quot;</span> &gt;&gt;<span class="nv">$HOME</span>/.bashrc
+<li><p class="first">with “Windows Power Shell”, type:</p>
+<div class="highlight-batch notranslate"><div class="highlight"><pre><span></span>setx PYTHONPATH <span class="s2">&quot;.;$Env:PYTHONPATH&quot;</span>
 </pre></div>
 </div>
 </li>
-<li><p class="first">Install command-line completion (optional but very convenient).</p>
-<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">echo</span> <span class="s2">&quot;source </span><span class="k">$(</span><span class="nb">pwd</span><span class="k">)</span><span class="s2">/src/emulsion/scripts/emulsion-completion.sh&quot;</span> &gt;&gt;<span class="nv">$HOME</span>/.bashrc
-</pre></div>
-</div>
-<p>Command-line completion (available with a bash shell, under Linux
-or MacOS) allows to use <code class="docutils literal notranslate"><span class="pre">TAB</span></code> key to get suggestions on what is
-expected (options, files, parameters…) in the command.</p>
-</li>
-<li><p class="first">Create command <code class="docutils literal notranslate"><span class="pre">emulsion</span></code>:</p>
-<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">echo</span> <span class="s2">&quot;alias emulsion=&#39;python3 -m emulsion&#39;&quot;</span> &gt;&gt;<span class="nv">$HOME</span>/.bashrc
-</pre></div>
-</div>
-</li>
-<li><p class="first">Force the shell to update your init file:</p>
-<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">source</span> <span class="nv">$HOME</span>/.bashrc
-</pre></div>
+</ul>
+</div></blockquote>
 </div>
-</li>
-</ol>
 </div>
 <div class="section" id="install-third-party-software">
 <h2>Install third-party software<a class="headerlink" href="#install-third-party-software" title="Permalink to this headline">¶</a></h2>
@@ -158,9 +136,20 @@ and update the <code class="docutils literal notranslate"><span class="pre">PATH
 installed the executable files (especially <code class="docutils literal notranslate"><span class="pre">dot.exe</span></code>).
 For instance, if <code class="docutils literal notranslate"><span class="pre">dot.exe</span></code> is located in
 <code class="docutils literal notranslate"><span class="pre">C:\Program</span> <span class="pre">Files</span> <span class="pre">(x86)\Graphviz\bin</span></code>, just type:</p>
-<div class="highlight-batch notranslate"><div class="highlight"><pre><span></span>setx PATH <span class="s2">&quot;</span><span class="nv">%PATH%</span><span class="s2">;C:\Program Files (x86)\Graphviz\bin&quot;</span>
+<blockquote>
+<div><ul>
+<li><p class="first">in the “Command Prompt”:</p>
+<div class="highlight-batch notranslate"><div class="highlight"><pre><span></span>setx PATH <span class="s2">&quot;C:\Program Files (x86)\Graphviz\bin;</span><span class="nv">%PATH%</span><span class="s2">&quot;</span>
 </pre></div>
 </div>
+</li>
+<li><p class="first">in “Windows Power Shell”:</p>
+<div class="highlight-batch notranslate"><div class="highlight"><pre><span></span>setx PATH <span class="s2">&quot;C:\Program Files (x86)\Graphviz\bin;$Env:PATH&quot;</span>
+</pre></div>
+</div>
+</li>
+</ul>
+</div></blockquote>
 </div>
 </div>
 <div class="section" id="test-your-installation">
@@ -173,12 +162,12 @@ emulsion run --plot quickstart.yaml --view-model --silent
 </pre></div>
 </div>
 <p>This should produce the following output:</p>
-<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Simulation</span> <span class="n">level</span><span class="p">:</span> <span class="n">herd</span>
-<span class="n">Generated</span> <span class="n">state</span> <span class="n">machine</span> <span class="n">diagram</span> <span class="n">img</span><span class="o">/</span><span class="n">Quickstart_age_group_machine</span><span class="o">.</span><span class="n">png</span>
-<span class="n">Generated</span> <span class="n">state</span> <span class="n">machine</span> <span class="n">diagram</span> <span class="n">img</span><span class="o">/</span><span class="n">Quickstart_life_cycle_machine</span><span class="o">.</span><span class="n">png</span>
-<span class="n">Generated</span> <span class="n">state</span> <span class="n">machine</span> <span class="n">diagram</span> <span class="n">img</span><span class="o">/</span><span class="n">Quickstart_health_state_machine</span><span class="o">.</span><span class="n">png</span>
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Simulation</span> <span class="n">level</span><span class="p">:</span><span class="n">herd</span>
+<span class="n">Generated</span> <span class="n">state</span> <span class="n">machine</span> <span class="n">diagram</span> <span class="n">img</span><span class="o">/</span><span class="n">Quickstart_age_group_machine</span><span class="o">.</span><span class="n">svg</span>
+<span class="n">Generated</span> <span class="n">state</span> <span class="n">machine</span> <span class="n">diagram</span> <span class="n">img</span><span class="o">/</span><span class="n">Quickstart_life_cycle_machine</span><span class="o">.</span><span class="n">svg</span>
+<span class="n">Generated</span> <span class="n">state</span> <span class="n">machine</span> <span class="n">diagram</span> <span class="n">img</span><span class="o">/</span><span class="n">Quickstart_health_state_machine</span><span class="o">.</span><span class="n">svg</span>
 <span class="mi">100</span><span class="o">%|*************************************************************|</span> <span class="mi">10</span><span class="o">/</span><span class="mi">10</span>
-<span class="n">Simulation</span> <span class="n">finished</span> <span class="ow">in</span> <span class="mf">9.48</span> <span class="n">s</span>
+<span class="n">Simulation</span> <span class="n">finished</span> <span class="ow">in</span> <span class="mf">12.37</span> <span class="n">s</span>
 <span class="n">Outputs</span> <span class="n">stored</span> <span class="ow">in</span> <span class="n">outputs</span><span class="o">/</span><span class="n">counts</span><span class="o">.</span><span class="n">csv</span>
 <span class="n">Outputs</span> <span class="n">plot</span> <span class="ow">in</span> <span class="n">file</span><span class="p">:</span> <span class="n">img</span><span class="o">/</span><span class="n">Quickstart</span><span class="o">.</span><span class="n">html</span>
 </pre></div>
@@ -282,6 +271,52 @@ emulsion run --plot quickstart.yaml --view-model --silent
 <img alt="../_images/Quickstart_MSEIRQ.png" class="align-left" src="../_images/Quickstart_MSEIRQ.png" />
 <img alt="../_images/Quickstart_others.png" class="align-left" src="../_images/Quickstart_others.png" />
 </div>
+<div class="section" id="alternative-install-with-git">
+<h2>Alternative: install with <code class="docutils literal notranslate"><span class="pre">git</span></code><a class="headerlink" href="#alternative-install-with-git" title="Permalink to this headline">¶</a></h2>
+<p>This procedure assumes that you have <code class="docutils literal notranslate"><span class="pre">git</span></code> already
+<a class="reference external" href="https://git-scm.com/downloads">installed on your system</a>.
+It is provided here for Linux or MacOS.</p>
+<ol class="arabic">
+<li><p class="first">Install (or update) required packages</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>sudo pip3 install numpy scipy matplotlib pandas <span class="s1">&#39;sympy==1.1.1&#39;</span> mpmath
+sudo pip3 install networkx docopt jinja2 textx
+sudo pip3 install sortedcontainers tqdm pyyaml colorama
+sudo pip3 install bokeh sqlalchemy utm
+</pre></div>
+</div>
+</li>
+<li><p class="first">Clone the EMULSION repository</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>git clone https://git.renater.fr/emulsion-public.git
+<span class="nb">cd</span> emulsion-public
+</pre></div>
+</div>
+</li>
+<li><p class="first">Add the local directory and <code class="docutils literal notranslate"><span class="pre">src</span></code> directory to your <code class="docutils literal notranslate"><span class="pre">PYTHONPATH</span></code> environment
+variable.</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">echo</span> <span class="s2">&quot;export PYTHONPATH=</span><span class="k">$(</span><span class="nb">pwd</span><span class="k">)</span><span class="s2">/src:.&quot;</span> &gt;&gt;<span class="nv">$HOME</span>/.bashrc
+</pre></div>
+</div>
+</li>
+<li><p class="first">Install command-line completion (optional but very convenient).</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">echo</span> <span class="s2">&quot;source </span><span class="k">$(</span><span class="nb">pwd</span><span class="k">)</span><span class="s2">/src/emulsion/scripts/emulsion-completion.sh&quot;</span> &gt;&gt;<span class="nv">$HOME</span>/.bashrc
+</pre></div>
+</div>
+<p>Command-line completion (available with a bash shell, under Linux
+or MacOS) allows to use <code class="docutils literal notranslate"><span class="pre">TAB</span></code> key to get suggestions on what is
+expected (options, files, parameters…) in the command.</p>
+</li>
+<li><p class="first">Create command <code class="docutils literal notranslate"><span class="pre">emulsion</span></code>:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">echo</span> <span class="s2">&quot;alias emulsion=&#39;python3 -m emulsion&#39;&quot;</span> &gt;&gt;<span class="nv">$HOME</span>/.bashrc
+</pre></div>
+</div>
+</li>
+<li><p class="first">Force the shell to update your init file:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">source</span> <span class="nv">$HOME</span>/.bashrc
+</pre></div>
+</div>
+</li>
+</ol>
+</div>
 </div>
 
 
@@ -305,12 +340,11 @@ emulsion run --plot quickstart.yaml --view-model --silent
 <ul class="current">
 <li class="toctree-l1 current"><a class="current reference internal" href="#">Installation</a><ul>
 <li class="toctree-l2"><a class="reference internal" href="#requirements">Requirements</a></li>
-<li class="toctree-l2"><a class="reference internal" href="#install-with-pip">Install with <code class="docutils literal notranslate"><span class="pre">pip</span></code></a><ul>
+<li class="toctree-l2"><a class="reference internal" href="#install-with-pip-recommended">Install with <code class="docutils literal notranslate"><span class="pre">pip</span></code> (recommended)</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="#linux-and-macos">Linux and MacOS:</a></li>
 <li class="toctree-l3"><a class="reference internal" href="#windows">Windows</a></li>
 </ul>
 </li>
-<li class="toctree-l2"><a class="reference internal" href="#install-with-git">Install with <code class="docutils literal notranslate"><span class="pre">git</span></code></a></li>
 <li class="toctree-l2"><a class="reference internal" href="#install-third-party-software">Install third-party software</a><ul>
 <li class="toctree-l3"><a class="reference internal" href="#linux">Linux</a></li>
 <li class="toctree-l3"><a class="reference internal" href="#macos">MacOS</a></li>
@@ -318,6 +352,7 @@ emulsion run --plot quickstart.yaml --view-model --silent
 </ul>
 </li>
 <li class="toctree-l2"><a class="reference internal" href="#test-your-installation">Test your installation</a></li>
+<li class="toctree-l2"><a class="reference internal" href="#alternative-install-with-git">Alternative: install with <code class="docutils literal notranslate"><span class="pre">git</span></code></a></li>
 </ul>
 </li>
 <li class="toctree-l1"><a class="reference internal" href="Getting_started.html">Getting started with EMULSION</a></li>