You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/index.md
+14-15Lines changed: 14 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,55 +80,54 @@ Other dependecies include:
80
80
81
81
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:
82
82
83
-
>docker build -t pybox .
83
+
docker build -t pybox .
84
84
85
85
After this has completed [which may take some time], type the following to see your new image listed:
86
86
87
-
>docker images
87
+
docker images
88
88
89
89
To create and run a new container based on this image, with a name 'project_pybox', type:
90
90
91
-
>docker run --name=project_pybox -it pybox
91
+
docker run --name=project_pybox -it pybox
92
92
93
93
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:
94
94
95
-
>cd /Code/Git_repos/PyBox/
95
+
cd /Code/Git_repos/PyBox/
96
96
97
97
Lets run the default simulation:
98
98
99
-
>python Gas_simulation.py
99
+
python Gas_simulation.py
100
100
101
101
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:
102
102
103
-
>exit
103
+
exit
104
104
105
105
You are now back in your original 'host' operating system. To list all available containers, type:
106
106
107
-
>docker ps -a
107
+
docker ps -a
108
108
109
109
You should see how long ago you exited our 'project_pybox' container. Lets restart this container. To do this type the following:
110
110
111
-
>docker start project_pybox
112
-
>docker exec -it project_pybox bash
111
+
docker start project_pybox
112
+
docker exec -it project_pybox bash
113
113
114
114
We are back in! Lets exit again:
115
115
116
-
>exit
116
+
exit
117
117
118
118
To remove the container, you can type:
119
119
120
-
>docker rm project_pybox
121
-
120
+
docker rm project_pybox
121
+
122
122
To remove the image on which the container is based, which was built from our Dockerfile, type:
123
123
124
-
> docker rmi pybox
125
-
124
+
docker rmi pybox
126
125
127
126
## Folder structure and running the model <aname="Folder-Structure"></a>
128
127
129
128
If you are happy all dependencies are installed and working, to run PyBox 'out of the box', type the following in the root directory:
130
129
131
-
>python Gas_simulation.py
130
+
python Gas_simulation.py
132
131
133
132
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.
0 commit comments