The goal of this process is to perform machine reading over the model codebase in order to automatically extract key metadata about:
First, recommended installation is to create a new conda environment and then intall from requirements.txt:
conda create --name=dmx python=3.8
conda activate dmx
conda install uvicorn
pip install -r requirements.txt
Docker Install and Run
docker build -t dmx .
docker run -p 80:80 dmx
python main.py --help
Clone or download the repository of interest. For example:
cd /tmp
git clone https://github.com/jataware/dummy-model.git
Next, analyze this repo with:
python main.py --repo="/tmp/dummy-model"
python main.py --url="https://github.com/jataware/dummy-model.git"
This creates and deletes a tempory folder 'tmp'.
The application produces a .yaml file with prefix 'dmx-' concatenated with the repo name.
Run API:
uvicorn api:app
http://127.0.0.1:8000/
Do not use --reload flag, since the app will download the repo to the api folder.
develop
branch]Note that Pythia is a highly abstracted Python version of the DSSAT model.
Default port for Docker is 80. Default port for Uvicorn is 8000. Examples given below assume the Uvicorn server is running at port 8000.
GET /docs
e.g. http://127.0.0.1:8000/docs
GET /
e.g. http://127.0.0.1:8000/
Returns
{"status":"running"}
GET /examine/${url}
e.g. http://127.0.0.1:8000/examine/?url=https://github.com/jataware/dummy-model.git
Parameter | Type | Description |
---|---|---|
url |
string |
Required. URL of GitHub repo |
Returns
yaml-formatted string