Skip to content

Commit 529c576

Browse files
committed
Remove ubuntu image from Dockerfile, explicitly install THOR into Python environment, minor clarification tweaks to README.md
1 parent d62e4de commit 529c576

2 files changed

Lines changed: 42 additions & 10 deletions

File tree

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
FROM ubuntu:latest
21
FROM continuumio/miniconda3
32
MAINTAINER Joachim Moeyens <moeyensj@gmail.com>
43

@@ -17,7 +16,8 @@ RUN mkdir projects \
1716
&& cd projects \
1817
&& git clone https://github.com/moeyensj/thor.git --depth=1
1918

20-
# Create Python 3.6 conda environment and install requirements
19+
# Create Python 3.6 conda environment and install requirements, then install THOR
2120
RUN cd projects/thor \
2221
&& conda install -c defaults -c conda-forge -c astropy --file requirements.txt python=3.6 --y \
23-
&& python -m ipykernel install --user --name thor_py36 --display-name "THOR (Python 3.6)"
22+
&& python -m ipykernel install --user --name thor_p36 --display-name "THOR (Python 3.6)" \
23+
&& python setup.py install

README.md

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,58 @@ Warning: The THOR code is still in very active development.
1313

1414
The corresponding notebook repository can be found at: https://github.com/moeyensj/thor_notebooks
1515

16+
We recommend installing the code along one of two installation paths: either a source code installation, or an installation via docker.
17+
1618
### Source
17-
Clone this repository using either `ssh` or `https`.
19+
Clone this repository using either `ssh` or `https`. Once cloned and downloaded, `cd` into the repository.
20+
21+
To install THOR in its own `conda` enviroment please do the following:
22+
23+
```conda create -n thor_py36 -c defaults -c conda-forge -c astropy --file requirements.txt python=3.6```
1824

19-
To create a `conda` environment in which to run the code:
20-
```conda create -n thor_py36 -c defaults -c conda-forge -c astropy --file requirements.txt python=3.6```
25+
Or, to install THOR in a pre-existing `conda` environment called `env`:
2126

22-
To install pre-requisite software into a `conda` enviroment named env:
2327
```conda activate env```
24-
```conda install -c defaults -c conda-forge --file requirements.txt```
28+
```conda install -c defaults -c conda-forge -c astropy --file requirements.txt```
29+
30+
Or, to install pre-requisite software using `pip`:
2531

26-
To install pre-requisite software using pip:
2732
```pip install -r requirements.txt```
2833

29-
Once pre-requisites have been installed:
34+
Once pre-requisites have been installed using either one of the tree options above, then:
35+
3036
```python setup.py install```
3137

38+
You should now be able to start Python and import THOR.
39+
```
40+
┌─(thor_py36)[~]
41+
└─▪ python
42+
Python 3.6.9 (default, Jul 30 2019, 19:07:31)
43+
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
44+
Type "help", "copyright", "credits" or "license" for more information.
45+
>>> import thor
46+
>>>
47+
```
48+
3249
### Docker
3350

3451
A Docker container with the latest version of the code can be pulled using:
52+
3553
```docker pull moeyensj/thor:latest```
3654

3755
To run the container:
56+
3857
```docker run -it moeyensj/thor:latest```
58+
59+
The THOR code is installed the /projects directory, and is by default also installed in the container's Python installation.
60+
To access the code in Python:
61+
```
62+
(base) root@202110177eee:/# python
63+
Python 3.6.9 |Anaconda, Inc.| (default, Jul 30 2019, 19:07:31)
64+
[GCC 7.3.0] on linux
65+
Type "help", "copyright", "credits" or "license" for more information.
66+
>>> import thor
67+
>>>
68+
```
69+
70+
**If you would like to run Jupyter Notebook or Juptyter Lab with THOR please see the installation instructions in the THOR notebooks repository.**

0 commit comments

Comments
 (0)