Seafood-Globalization-Lab / artis-model

The ARTIS model codebase
Creative Commons Zero v1.0 Universal
1 stars 0 forks source link

ARTIS Model

The ARTIS model codebase. This repository contains the demo version and the full model.

Installation Guide

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.

Creating python virtual environment

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.

  1. Open the artis-model repository in RStudio.
  2. Click on the terminal tab.
  3. Type pwd in the terminal.
  4. Copy the result of the "pwd" terminal command.
  5. Type python3 -m venv [RESULT FROM pwd]/venv (ie. python3 -m venv /home/artis-model/venv)
  6. Type source venv/bin/activate in terminal.
  7. Type pip3 install qpsolvers in terminal.
  8. Type pip3 install quadprog in terminal.
  9. Type pip3 install cvxopt in terminal.
  10. Confirm you have successfully installed the packages qpsolvers, quadprog, cvxopt by running pip list.
  11. Type deactivate in terminal.
  12. 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.

R installation instructions

  1. Click "Build" on the build tab on the top right hand side corner of RStudio.
  2. Click on the dropdown arrow in the "Install" subtab within the "Build" window.
  3. Click the option "Configure Build Tools..."
  4. Make sure options mirror the image below and click OK.

    drawing

  5. Click on the dropdown arrow in the "Install" subtab and select the option "Clean and Install"

Running the model demo

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.

Outputs

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:

Methods and Workflow

High level overview

The following diagrams describes how ARTIS trade records are obtained.

Disaggregating Trade Records Aggregating Trade Records back up Consumption Workflow

Code workflows

The following diagrams describe the how the codebase follows the workflow illustrated above.

Cleaning data diagram Mass balance solutions Creating ARTIS codeflow

System Requirements