|
1 |
| -# allagash |
2 |
| -A spatial optmization library |
| 1 | +# Allagash [](https://github.com/apulverizer/allagash/actions) |
| 2 | +A spatial optimization library for covering problems |
| 3 | + |
| 4 | +### Running Locally |
| 5 | +1. Clone the repo `git clone [email protected]:apulverizer/allagash.git` |
| 6 | +2. Create the conda environment `conda env create --file environment.yml` |
| 7 | +3. Activate the new environment `conda activate allagash` |
| 8 | +4. Install allagash locally `pip install -e ./src --no-deps` |
| 9 | +5. Install a solver that is supported by [Pulp](https://github.com/coin-or/pulp) |
| 10 | + 1. [GLPK](https://www.gnu.org/software/glpk/) |
| 11 | + 2. [COIN-OR CBC](https://github.com/coin-or/Cbc) |
| 12 | + 3. [CPLEX](https://www.ibm.com/analytics/cplex-optimizer) |
| 13 | + 4. [Gurobi](https://www.gurobi.com/) |
| 14 | +6. Launch jupyter notebook `jupyter notebook` |
| 15 | + |
| 16 | +You should now be able to run the example notebooks. |
| 17 | + |
| 18 | +### Installing with pip |
| 19 | + |
| 20 | +You can install Allagash using `pip` but may need to manually configure certain dependencies if using Windows. |
| 21 | + |
| 22 | +1. Run `pip install allagash` |
| 23 | + |
| 24 | +### Running Tests Locally |
| 25 | +1. Run tests `pytest --nbval` |
| 26 | + |
| 27 | +### Building Documentation |
| 28 | +1. From the repo directory run `sphinx-build -b html ./src-doc ./docs -a` |
| 29 | + |
| 30 | +This will deploy html documentation to the docs folder. |
| 31 | + |
| 32 | +### Running with Docker |
| 33 | +You can build the local docker image that includes Allagash, Python, Jupyter, GLPK, and COIN-OR CBC. |
| 34 | + |
| 35 | +1. Builder the docker image `docker build . -t apulverizer/allagash:latest` |
| 36 | +2. Launch Jupyter notebook `docker run -i -t --user=allagash -p 8888:8888 apulverizer/allagash:latest /bin/bash -c "jupyter notebook --ip='*' --port=8888 --no-browser"` |
| 37 | + |
| 38 | +You should now be able to run the example notebooks. |
| 39 | + |
| 40 | +You can test the notebooks as well by running `docker run --user=allagash apulverizer/allagash:latest /bin/bash -c "py.test --nbval"` |
| 41 | + |
| 42 | +If you'd like to mount a directory of local data/files into the container, you can add `-v <your-local-dir>:/home/allagash/<dir-name>` when running `docker run` |
| 43 | + |
| 44 | +### Running Tests with Docker |
| 45 | +You can build a docker container that will run the tests (mounted into the container) |
| 46 | + |
| 47 | +1. `docker build . --file build.Dockerfile --tag apulverizer/allagash:build` |
| 48 | +2. `docker run --user=allagash -v $PWD/tests:/home/allagash/tests -v $PWD/src-doc:/home/allagash/src-doc apulverizer/allagash:build /bin/bash -c "py.test --nbval"` |
0 commit comments