Contributing#
Getting started#
Clone the repository using
git clone https://github.com/potassco/viasp.gitCreate and activate a conda environment
Install pip
conda install pipInstall viASP in editable mode
pip install -e viasp -e viasp/backend -e viasp/frontend
Developing the backend#
Simply edit the code in the backend folder
viasp/backend/srcRun viASP with a clingo program
viasp encoding.lpThe server’s log file is created in the working directory
./viasp.log
Developing the frontend#
Note
The frontend code is located at /frontend/src/lib.
Run a modified viASP script to initialize the server and generate a graph.
$ python viasp/examples/devquickstart.py encoding.lp
Leave the terminal open to keep the server running.
Move to frontend folder
$ cd viasp/frontend
Run
npm ito install dependency packagesRun
npm run startto serve the JavaScript at http://localhost:8050When done, run
npm run buildto build the project for production
Code your heart out!
Developing the documentation#
The documentation is written in reStructuredText and can be found in the docs folder. To build the documentation, install sphinx and the docs dependencies in a new conda environment.
$ conda create -n docs_env
$ conda activate docs_env
$ conda install pip
Then install the dependencies
$ pip install -r viasp/docs/requirements.txt
# optional, to use autodoc on current changes to the viasp command line:
$ pip install -e viasp -e viasp/backend -e viasp/frontend
To serve the current changes on a local server,
$ sphinx-autobuild viasp/docs viasp/docs/_build/html
To build the documentation,
$ sphinx-build -b html viasp/docs viasp/docs/_build/html
Changes to the documentation files on GitHub will automatically trigger a build on through ReadTheDocs page.