Skip to content

Commit

Permalink
Update index.md
Browse files Browse the repository at this point in the history
  • Loading branch information
loftytopping committed Jun 18, 2018
1 parent 3cd1d68 commit 53c48af
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,55 +80,54 @@ Other dependecies include:

If you would like to run PyBox within a Docker container, I have provided a Dockerfile that will automatically build all dependencies within a new container based on the Ubuntu:16.04 image. To build the new image, assuming you have Docker installed, run the following command in the directory of the supplied Dockerfile:

> docker build -t pybox .
docker build -t pybox .

After this has completed [which may take some time], type the following to see your new image listed:

> docker images
docker images

To create and run a new container based on this image, with a name 'project_pybox', type:

> docker run --name=project_pybox -it pybox
docker run --name=project_pybox -it pybox

This will take you in to the container. So, lets run the gas phase model in PyBox whilst you are there. Change directory to where PyBox is located:

> cd /Code/Git_repos/PyBox/
cd /Code/Git_repos/PyBox/

Lets run the default simulation:

> python Gas_simulation.py
python Gas_simulation.py

Dont worry about the error message regarding the Matplotlib plots. This is a result of working in a Docker container. For those of you not familiar with Docker commands, lets leave the container. Type:

> exit
exit

You are now back in your original 'host' operating system. To list all available containers, type:

> docker ps -a
docker ps -a

You should see how long ago you exited our 'project_pybox' container. Lets restart this container. To do this type the following:

> docker start project_pybox
> docker exec -it project_pybox bash
docker start project_pybox
docker exec -it project_pybox bash

We are back in! Lets exit again:

> exit
exit

To remove the container, you can type:

> docker rm project_pybox
docker rm project_pybox
To remove the image on which the container is based, which was built from our Dockerfile, type:

> docker rmi pybox
docker rmi pybox

## Folder structure and running the model <a name="Folder-Structure"></a>

If you are happy all dependencies are installed and working, to run PyBox 'out of the box', type the following in the root directory:

> python Gas_simulation.py
python Gas_simulation.py

If you are not in a Docker container, you will see a plot displaying the concentration of two compounds over time. To understand what this simulation has actually done, let us now discuss the repository structure.

Expand Down

0 comments on commit 53c48af

Please sign in to comment.