/ABM_AMRO

Repository for agent based model for anti microbial resistance

Primary LanguageC++MIT LicenseMIT

ABM_AMRO

Agent Based Model repository for antimicrobial resistance

Figure of a collection of agents interacting

Setup

You can install the package via pip:

pip install git+https://github.com/RodrigoZepeda/ABM_AMRO

To install the development version:

pip install git+https://github.com/RodrigoZepeda/ABM_AMRO@dev

You can also download the repository and build locally with:

python setup.py build_ext -i

Troubleshooting installation

OSX

Mac users require an installation of libomp. This can be done with homebrew via

brew install libomp

If this is the first time you hear of homebrew you can check this tutorial.

Ubuntu

Linux users require an installation of openmp. In Ubuntu you can do it with:

apt install libomp-dev

Setting your compiler path for installation

You might have more than one compiler in your computer. The suggested ones are gcc for Linux and Windows and clang for OSX. You can install using your favourite compiler by passing the flag CC before pip:

CC=/path/to/your/gcc pip install git+https://github.com/RodrigoZepeda/ABM_AMRO

To find the path of your compiler you can do where gcc (or the compiler you want) in Windows or which gcc (or the compiler you want) in Unix.

Request support

You can raise an issue to report installation issues. Make sure to include the results of:

pip install --verbose git+https://github.com/RodrigoZepeda/ABM_AMRO

Windows (version >= 8 and 64 bit)

⚠️ I don't have Windows. I haven't tested it on Windows then.

Apparently, you might need a C++ compiler different from the native Windows one. You can download one following this instructions. If you are using R with Rtools you probably already have one (try gcc --help).

The recommended way for Windows is to use the Windows Subsystem for Linux

Windows Subsystem for Linux

  1. Go to Powershell and write:
wsl --install
  1. Download Ubuntu from the Microsoft Store

  2. Open Ubuntu and follow the instructions entering a new username (all in lowercase letters)

Enter new UNIX username: your_username
  1. Enter a password for the system
New password: [your_secret_password_invisibly]
  1. Update the Ubuntu server
sudo apt update
sudo apt upgrade
  1. Install other tools
sudo apt install build-essential git libomp-dev
  1. Install miniconda
mkdir -p ~/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm -rf ~/miniconda3/miniconda.sh
~/miniconda3/bin/conda init bash
  1. Exit the terminal and reopen it
exit
  1. Create a new environment:
conda create -n AMRO
  1. Go to the environment:
conda activate AMRO
  1. Install pip:
conda install -y pip
  1. Install the package!
pip install git+https://github.com/RodrigoZepeda/ABM_AMRO

Developing on VSCODE for Windows WSL

  1. Download the WSL Extension
  2. In VSCode press F1 and choose WSL: Connect to WSL using Distro in New Window
  3. Select the distro (Ubuntu)
  4. Select the interpreter CTRL + Shift + P > Python Select Interpreter > AMRO
  5. Start coding

Add files

To add new files into your Ubuntu machine, from the WSL terminal do:

explorer.exe .

to open the Window's explorer and know where your virtual machine lies

Install other packages

From the VSCode terminal with WSL you can install packages with conda or pip

conda install pandas
pip install session_info

Run Jupyter

  1. Open a ipynb file and install the extensions
  2. You might also need to Select the interpreter via CTRL + Shift + P > Python Select Interpreter > AMRO

Tutorials

Go to the tutorial/ folder for tutorials

Contributing

Go to How to contribute to learn more on the package's philosophy.