The ARTIS model codebase. This repository contains the demo version and the full model.
This project uses Python 3.10.9 which can be downloaded here and RStudio which can be downloaded here.
It should take approximately 10 minutes to run this full installation.
NOTE: This protocol may not be successful for every individual local machine. The interaction in package versions and computer architecture (i.e. arm64 M1, M2 chips) may complicate this virtual environment set up. We are working on setting up a portable docker image to increase the reproducibility of this code.
- Open the artis-model repository in RStudio.
- Click on the terminal tab.
- Type
pwd
in the terminal. - Copy the result of the "pwd" terminal command.
- Type
python3 -m venv [RESULT FROM pwd]/venv
(ie.python3 -m venv /home/artis-model/venv
) - Type
source venv/bin/activate
in terminal. - Type
pip3 install qpsolvers
in terminal. - Type
pip3 install quadprog
in terminal. - Type
pip3 install cvxopt
in terminal. - Confirm you have successfully installed the packages qpsolvers, quadprog, cvxopt by running
pip list
. - Type
deactivate
in terminal. - Click on the Console tab.
Note: You only need to install the solvers the first time you run this code. Warnings about the latest version of pip may also appear during the installation - these are okay, but errors are not.
- Click "Build" on the build tab on the top right hand side corner of RStudio.
- Click on the dropdown arrow in the "Install" subtab within the "Build" window.
- Click the option "Configure Build Tools..."
- Make sure options mirror the image below and click OK.
Running the demo for the ARTIS model should take approximately 10 minutes. To run the demo for ARTIS run the 02-artis-pipeline.R
script and then run the 04-build-artis-timeseries.R
script.
The outputs of the demo will appear in the demo/outputs
directory. Within this folder demo/outputs/custom_ts
will contain all the final files that if run on the full model inputs would be used to create the results of the ARTIS research paper.
Please find below descriptions of main files:
demo/outputs/custom_ts/mid_custom_ts.csv
: This is the demo version of the main ARTIS trade records table.demo/outputs/custom_ts/summary_consumption_midpoint.csv
: This is the demo version of the main ARTIS seafood consumption records table.
The following diagrams describes how ARTIS trade records are obtained.
The following diagrams describe the how the codebase follows the workflow illustrated above.
- Platform: x86_64-apple-darwin17.0 (64-bit)
- Running under: macOS Ventura 13.3.1
- R version 4.2.2
- R packages:
- readxl 1.4.1
- janitor 2.1.0
- countrycode 1.4.0
- doParallel 1.0.17
- iterators 1.0.14
- foreach 1.5.2
- slam 0.1-50
- Matrix 1.5-1
- magrittr 2.0.3
- data.table 1.14.6
- forcats 0.5.2
- stringr 1.5.0
- dplyr 1.0.10
- purrr 1.0.1
- readr 2.1.3
- tidyr 1.2.1
- tibble 3.1.8
- ggplot2 3.4.0
- tidyverse 1.3.2
- reticulate 1.26
- Python version 3.10.9
- Python packages:
- cvxopt 1.3.0
- daqp 0.5.1
- ecos 2.0.12
- numpy 1.24.3
- osqp 0.6.2.post9
- pip 22.3.1
- qdldl 0.1.7
- qpsolvers 3.4.0
- quadprog 0.1.11
- scipy 1.10.1
- scs 3.2.3
- setuptools 65.6.3