Skip to content

Commit

Permalink
add technical documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pjamesjoyce committed May 24, 2017
1 parent c71cc43 commit c2cc10c
Show file tree
Hide file tree
Showing 19 changed files with 135 additions and 78 deletions.
4 changes: 3 additions & 1 deletion docs/1_installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ Finally, install lcopt via pip::

pip install lcopt

.. _bw2_setup_step:

-----------------------------------------------------
Running the analyses in LcoptInteract with brightway2
Setting up brightway2 for lcopt
-----------------------------------------------------

To use the interactive analysis feature, you need to set up brightway2 to play nicely with lcopt.
Expand Down
4 changes: 2 additions & 2 deletions docs/2_use.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Probably the best way to use lcopt is via a jupyter notebook. This gives you mor

.. highlight:: console

``cd`` into whatever folder you want your notebooks and lcopt models to be stored in, then start jupyter e.g.:
``cd`` into whatever folder you want your notebooks and lcopt models to be stored in, then start jupyter e.g.::

activate lcopt
cd C:\Users\pjjoyce\Documents\01_Lcopt_models
Expand Down Expand Up @@ -72,7 +72,7 @@ Running the GUI via each of the options above launches a Flask server that gives

When your model's ready you can export it to SimaPro as a .csv file and the parameter sets you've created as an Excel file (Note: you need SimaPro developer to import the parameter sets from the Excel file).

To run the analyses interactively using brightway2 there's an additional setup step. See below.
To run the analyses interactively using brightway2, make sure you've completed the additional setup step (:ref:`bw2_setup_step`).

The 'QUIT' button in the top right hand corner will shut down the Flask server and tell you to close the window.

Expand Down
10 changes: 5 additions & 5 deletions docs/3_technical.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
Technical Documentation
=======================

.. automodule:: lcopt
:members:
:undoc-members:

.. automodule:: lcopt.model

.. autoclass:: LcoptModel(name=[randomly_generated_string], load=False)
:members:

.. automodule:: lcopt.utils
:members:
:undoc-members:
Binary file modified docs/_build/doctrees/1_installation.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/2_use.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/3_technical.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/index.doctree
Binary file not shown.
6 changes: 3 additions & 3 deletions docs/_build/html/1_installation.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ <h2>Basic Installation<a class="headerlink" href="#basic-installation" title="Pe
</pre></div>
</div>
</div>
<div class="section" id="running-the-analyses-in-lcoptinteract-with-brightway2">
<h2>Running the analyses in LcoptInteract with brightway2<a class="headerlink" href="#running-the-analyses-in-lcoptinteract-with-brightway2" title="Permalink to this headline"></a></h2>
<div class="section" id="setting-up-brightway2-for-lcopt">
<span id="bw2-setup-step"></span><h2>Setting up brightway2 for lcopt<a class="headerlink" href="#setting-up-brightway2-for-lcopt" title="Permalink to this headline"></a></h2>
<p>To use the interactive analysis feature, you need to set up brightway2 to play nicely with lcopt.</p>
<p>Lcopt needs to set up its own brightway project template so that it can create a new brightway project for each of your models using this template.</p>
<div class="section" id="step-1-download-the-ecoinvent-3-3-cutoff-database-ecoinvent-license-required">
Expand Down Expand Up @@ -137,7 +137,7 @@ <h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Installation</a><ul>
<li><a class="reference internal" href="#basic-installation">Basic Installation</a></li>
<li><a class="reference internal" href="#running-the-analyses-in-lcoptinteract-with-brightway2">Running the analyses in LcoptInteract with brightway2</a><ul>
<li><a class="reference internal" href="#setting-up-brightway2-for-lcopt">Setting up brightway2 for lcopt</a><ul>
<li><a class="reference internal" href="#step-1-download-the-ecoinvent-3-3-cutoff-database-ecoinvent-license-required">Step 1. Download the Ecoinvent 3.3 cutoff database (Ecoinvent license required)</a></li>
<li><a class="reference internal" href="#step-2a-run-the-setup-utility-in-a-jupyter-notebook-python-shell">Step 2a. Run the setup utility in a jupyter notebook/python shell</a></li>
<li><a class="reference internal" href="#step-2b-download-lcopt-bw2-setup-py-and-use-that-instead">Step 2b. Download lcopt_bw2_setup.py and use that instead</a></li>
Expand Down
11 changes: 6 additions & 5 deletions docs/_build/html/2_use.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ <h2>Launching the lcopt GUI<a class="headerlink" href="#launching-the-lcopt-gui"
<h3>Option 1. Jupyter notebooks <em>(More complicated, more powerful)</em><a class="headerlink" href="#option-1-jupyter-notebooks-more-complicated-more-powerful" title="Permalink to this headline"></a></h3>
<p>Probably the best way to use lcopt is via a jupyter notebook. This gives you more access to the inner workings if you need to get at something you can&#8217;t see in the GUI.</p>
<p><code class="docutils literal"><span class="pre">cd</span></code> into whatever folder you want your notebooks and lcopt models to be stored in, then start jupyter e.g.:</p>
<blockquote>
<div>activate lcopt
cd C:UserspjjoyceDocuments01_Lcopt_models
jupyter notebook</div></blockquote>
<div class="highlight-console"><div class="highlight"><pre><span></span><span class="go">activate lcopt</span>
<span class="go">cd C:\Users\pjjoyce\Documents\01_Lcopt_models</span>
<span class="go">jupyter notebook</span>
</pre></div>
</div>
<p>This will fire up the jupyter notebook server in your browser.
Create a new notebook, give it a meaningful name.</p>
<p>Then in the first cell import lcopt:</p>
Expand Down Expand Up @@ -105,7 +106,7 @@ <h3>Option 2. lcopt_launcher.py <em>(Simpler, only access to GUI)</em><a class="
<h2>LCOPT INTERACT - the GUI<a class="headerlink" href="#lcopt-interact-the-gui" title="Permalink to this headline"></a></h2>
<p>Running the GUI via each of the options above launches a Flask server that gives you a nice UI to interact with the models. You can add processes, link them together, add biosphere and technosphere exchanges, and create parameter sets and functions using your parameters. It should be pretty intuitive, if you get stuck, try the &#8216;more info...&#8217; buttons.</p>
<p>When your model&#8217;s ready you can export it to SimaPro as a .csv file and the parameter sets you&#8217;ve created as an Excel file (Note: you need SimaPro developer to import the parameter sets from the Excel file).</p>
<p>To run the analyses interactively using brightway2 there&#8217;s an additional setup step. See below.</p>
<p>To run the analyses interactively using brightway2, make sure you&#8217;ve completed the additional setup step (<a class="reference internal" href="1_installation.html#bw2-setup-step"><span class="std std-ref">Setting up brightway2 for lcopt</span></a>).</p>
<p>The &#8216;QUIT&#8217; button in the top right hand corner will shut down the Flask server and tell you to close the window.</p>
<p>If you&#8217;re running from a jupyter notebook, this frees up the notebook again so you can run any commands you need to.</p>
<p>One useful command is <code class="docutils literal"><span class="pre">model.save()</span></code> which will save any unsaved changes (you can also save by clicking on the save button in LcoptInteract, but in case you forget you can use <code class="docutils literal"><span class="pre">model.save()</span></code>)</p>
Expand Down

0 comments on commit c2cc10c

Please sign in to comment.