|
| 1 | +# Installation |
| 2 | + |
| 3 | +## Requirements |
| 4 | + |
| 5 | +Python >=3.7 is required. Support on Python 3.11 is limited. |
| 6 | + |
| 7 | +## Installation using pip |
| 8 | + |
| 9 | +Use pip to install the latest version of Modelspec (plus dependencies) from [PyPI](https://pypi.org/project/modelspec): |
| 10 | +``` |
| 11 | +pip install modelspec |
| 12 | +``` |
| 13 | + |
| 14 | +## Installation from source |
| 15 | +To install the modelspec package from [source](https://github.com/ModECI/modelspec) and run it locally: |
| 16 | + |
| 17 | +### 1) Create a virtual environment (e.g. called `modelspec-env`) |
| 18 | +``` |
| 19 | +pip install virtualenv |
| 20 | +virtualenv modelspec-env |
| 21 | +``` |
| 22 | + |
| 23 | +### 2) Activate the virtual environment |
| 24 | +``` |
| 25 | +source modelspec-env/bin/activate |
| 26 | +``` |
| 27 | + |
| 28 | +### 3) Clone this repository |
| 29 | +``` |
| 30 | +git clone https://github.com/ModECI/modelspec.git |
| 31 | +``` |
| 32 | + |
| 33 | +### 4) Change to the directory |
| 34 | +``` |
| 35 | +cd modelspec |
| 36 | +``` |
| 37 | + |
| 38 | +### 5) Install the package |
| 39 | +``` |
| 40 | +pip install . |
| 41 | +``` |
| 42 | + |
| 43 | +Alternatively, to install modelspec plus optional dependencies: |
| 44 | + |
| 45 | +``` |
| 46 | +pip install .[all] |
| 47 | +``` |
| 48 | + |
| 49 | +## Generating modelspec documentation offline |
| 50 | + |
| 51 | +Here is a walkthrough on how to generate the modelspec documentation offline |
| 52 | + |
| 53 | +### Requirements |
| 54 | + |
| 55 | +The documentation is generated using [Sphinx](https://www.sphinx-doc.org). Make is also required. For **Windows** installation of Make, see [here](https://stackoverflow.com/questions/32127524/how-to-install-and-use-make-in-windows). For **Mac** installation of Make, see [here](https://formulae.brew.sh/formula/make) |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | +#### 1) Create a virtual environment with python |
| 60 | +``` |
| 61 | +# install virtual environment |
| 62 | +
|
| 63 | +pip install virtualenv |
| 64 | +
|
| 65 | +# create & activate a virtual environment for your current or preferred python version |
| 66 | +
|
| 67 | +python -m virtualenv modelspec-env |
| 68 | +modelspec-env\Scripts\activate |
| 69 | +``` |
| 70 | + |
| 71 | +#### 2) Clone modelspec repository from GitHub into your local machine |
| 72 | +``` |
| 73 | +git clone https://github.com/ModECI/modelspec.git |
| 74 | +``` |
| 75 | + |
| 76 | +#### 3) Change into the modelspec directory |
| 77 | +``` |
| 78 | +cd modelspec |
| 79 | +``` |
| 80 | + |
| 81 | +#### 4) Install all modelspec package into the virtual environment |
| 82 | +``` |
| 83 | +pip install .[all] |
| 84 | +``` |
| 85 | + |
| 86 | +#### 5) Change directory into sphinx folder |
| 87 | +``` |
| 88 | +# for windows |
| 89 | +cd docs\sphinx |
| 90 | +
|
| 91 | +# for Mac/Linux |
| 92 | +cd docs/sphinx |
| 93 | +``` |
| 94 | + |
| 95 | +#### 6) Create offline documentation in sphinx folder |
| 96 | +``` |
| 97 | +# To allow a fresh start when making the documentation |
| 98 | +make clean |
| 99 | +
|
| 100 | +# To make the documentation |
| 101 | +make html |
| 102 | +``` |
| 103 | + |
| 104 | +#### 7) Change directory into html folder and run the documentation offline |
| 105 | +``` |
| 106 | +# for Windows go into build\html folder and double click on the index.html file, or: |
| 107 | +
|
| 108 | +cd build\html |
| 109 | +index.html |
| 110 | +
|
| 111 | +# for Mac, go into build/html folder and double click on the index.html file or: |
| 112 | +cd build/html |
| 113 | +open index.html |
| 114 | +``` |
| 115 | + |
| 116 | +The documentation will open up in your browser automatically or right click on the file and open in any browser of your choice. |
0 commit comments