anchor.diff:    ng\_select may be handling large lists and one may want to do some testing
     before removing it.
   
  -- Move the logic of merging an instance with its metadata (currently handled in
  -  sifra.structural.\_merge\_data\_and\_metadata) to the javascript. The document
  -  produced by that method is heavy due to its repetativeness and would hence be
  -  slow to pass around over the net. The logic is straight forward and would be
  -  easy to implment in javascript given the 'metadata' and instance.
  -
  -## Required packages
  -
  -http://graphviz.org/download/[Graphviz]
  
positive.code: 
  ### Building the run environment using Docker
  
  The AWS and Docker configuration is now the preferred way to deploy and develop
   the application.
  
  *Building an AMI for dev machines*
  
  To be able to have a easily replicable and deployable 
  environment to run and test the code, we use AWS for 
  provisioning dev machines. A basic dev instance can be setup 
  using https://www.packer.io/intro/[Packer], by running the
  following instructions in the current directory:
  
  ```
  export AWS_ACCESS_KEY = <AWS ACCESS KEY>
  export AWS_SECRET_KEY = <AWS SECRET KEY>
  packer build "installation\build.json"
  ```
  
  To get the aws credentials follow this link:https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html[guide].
  
  *Running Docker*
  
  The packer command that creates the AWS instance will run a 
  shell script that will install Docker and clone the git repository
  from Github. The details of the script are in `build-sifra-box.sh`
  
  Creating the environment is done using the following commands:
  ```
  cd sifra
  docker build -t sifra -f 'installation/Dockerfile' .
  ```
  
  Find the container Id using:
  
  ```
  docker ps -a
  ```
  
  To run an interactive container you can use:
  
  ```
  docker start -i <CONTAINER ID>
  ```
  or, simply run:
  
  ```
  docker run -it -v "$(pwd):/sifra" --name sifra sifra
  ```
  
  This will give you a terminal inside the container in which you can execute
  commands. Inside the container you can find the current directory mapped at
  `/sifra`. You can modify files either within the container or the host and the
  changes will be available in both.
  
  For details of the commands see 
  https://geoscienceaustralia.github.io/sifra/ch03_installation.html[using docker]
  in the help documentation
  
  
  ### Building the run environment using Anaconda
  
  For simplicity of managing virtual environments and
  package requirements, https://docs.anaconda.com/anaconda/[Anaconda]
  is a good option.
  It is a free Python distribution, and comes with the ``conda`` tool
  which is both a package manager and environment manager. Instructions
  for installing ``Anaconda`` are here:
  <https://docs.anaconda.com/anaconda/install/>
  
  **Prerequisites:** You will need to install ``Graphviz`` for the
  drawing the system diagram through networkx and pygraphviz.
  Please visit: <http://www.graphviz.org/>
  and download the appropriate version for your operating system.
  Please follow the posted download instructions carefully.
  After installation you may need to update the PATH variable
  with the location of the Graphviz binaries.
  
  For windows systems you will need to install
  Microsoft Visual C++ Compiler for Python 2.7:
  <http://aka.ms/vcpython27>
  
  On Ubuntu you can
  
  ```
  apt-get update && apt-get install -y \
      build-essential pkg-config \
      graphviz libgraphviz-dev \
      xml2 libxml2-dev
  ```
  
  Some packages we need are not hosted in the main ``conda`` package
  repository. In such cases we will host them in our own user channel.
  We suggest adding the following channels to the default::
  
      $ conda config --add channels https://conda.anaconda.org/anaconda
      $ conda config --add channels https://conda.anaconda.org/marufr
  
  Run the following command to confirm the additional channels have
  been added:
  
      $ conda config --get channels
  
  **For OS X and Linux-64 systems:** It should be possible to set up a
  full run environment solely through the \*.yml environment specification
  file. For OS X run the following commands:
  
      $ conda env create -f environment_osx.yml
      $ source activate sifra_env
  
  For Linux-64 systems, the commands are identical, you will just need
  to use the environment specification file for Linux.
  
  **For Windows systems**, a similar process needs to be followed, with
  some exceptions. First run:
  
      $ conda env create -f environment_win64.yml
      $ activate sifra_env
  
  This will install most requirements except for ``igraph`` and
  ``pygraphviz``. Compiling these packages under windows can be very
  challenging. The simplest and most reliable options is to download
  the the appropriate wheels from Christoph Gohlke's unofficial page
  of Windows binaries:
  <http://www.lfd.uci.edu/~gohlke/pythonlibs/>
  
  For Windows 64 bit systems, you will need to download the ``wheels`` for
  link:http://www.lfd.uci.edu/~gohlke/pythonlibs/#python-igraph[python-igraph]
  and link:http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygraphviz[pygraphviz]:
  
  - ``python_igraph-0.7.1.post6-cp27-none-win_amd64.whl``
  - ``pygraphviz-1.3.1-cp27-none-win_amd64.whl``
  
  Install these downloaded ``wheels`` with pip:
  
      $ pip install <pkg_name>.whl
  
  
  ### Setting up a development Environment
  Recent development has been done mostly on an AWS instance in PyCharm. This
  requires tunnelling X11 through an SSH connection, which mostly works reasonably
  well. 
  
  The driver behind this is the authenticating proxy, which seems to break
  docker in our use-case. Others have been able to run docker containers within
  the GA network, but it was not considered a good use of development effort 
  to attempt this with SIFRA.
  
  PyCharm supports docker as detailed in the following links:
  
  - https://www.jetbrains.com/help/pycharm/docker.html[Pycharm Docker support]
  - https://blog.jetbrains.com/pycharm/2017/03/docker-compose-getting-flask-up-and-running/[Docker-Compose: Getting Flask up and running]
  
  The following direcotories must be marked as 'Sources Root' in PyCharm. 
  
  - sifra
  - sifra-api
  
  ## Running the Code
  
  Clone the repository onto your system. Detailed instructions can
  be found https://help.github.com/articles/cloning-a-repository/[here]
  
      $ git clone https://github.com/GeoscienceAustralia/sifra.git sifra
  
  The code needs a setup file for configuring the model and simulation scenario.
  It can be in any of three formats: `ini`, `conf`, or `json`. The code first
  converts any setup file to json first before running.
  
  **To run the code:** move into the root directory of `sifra` code, and use the
  following commmand format, supplying with the requisite configuration file.
  
      $ python sifra -s simulation_setup/scenario_ss_x.ini
  
  Sample configuration files are located in sifra\simulation_setup
  
  Depending on the scale of the model, and simulation parameters chosen,
  it may take between a few minutes and a few days to complete a run.
  
  ### Run Analysis on Previously Run Simulation Data
  
  To run the post-simulation analysis on the generated output data, we need to
  supply the setup file used to run the original simulation and the log file that
  stores the directory locations for the the stored output data. For example:
  
      $ python sifra/scenario_loss_analysis.py \
          -s simulation_setup/scenario_ss_x.ini \
          -d logs/sifralog_20180619_155612_dirs.json
  
  ### Testing
  
  
negative.code:   it. I went for the latter, which I think is the right choice, but did not
    have the time to make the API consistent throughout.
  
  - Consider whether a framework like http://redux.js.org/[Redux] would be useful.
  
  - Perhaps get rid of ng\_select. I started with this before realising how easy
  