Working with Anduryl
Prerequisites
You can either install these programs separately or install Anaconda.
- Option 1: Anaconda
- Install Anaconda distribution
- Option 2: Install Separately
- Python3 or higher
- Jupyter Notebook
- You will use Python to install Jupyter
Anduryl Installation
- Plan where you want Anduryl installed.
- We suggest you install the module somewhere easily accessible like your Home folder.
- Terminology used:
- PARENT_FOLDER: This is the path to the folder that you want Anduryl installed into.
- This can be anywhere on your system, it will look similar to this (you can change this)
Windows:C:/Users/YOUR_NAME
Mac:/home/name
- This can be anywhere on your system, it will look similar to this (you can change this)
- PARENT_FOLDER: This is the path to the folder that you want Anduryl installed into.
- Download Anduryl. This can be done 2 ways, downloading it from your browser, or using the git command.
- Option 1: Browser
- Navigate to https://github.com/GBADsInformatics/anduryl-plus
- Click on the green
Code
button thenDownload ZIP
- Move the downloaded ZIP to the PARENT_FOLDER you would like Anduryl installed in.
- Right click the ZIP and click
Extract All
orExtract Here
- Rename the new
anduryl-plus-master
folder toanduryl
- Open your operating systems
Command Prompt
orTerminal
- Run
cd INSERT_PARENT_FOLDER_HERE
- Run
python -m anduryl
- Option 2: Git Command (requires git to be installed)
- Open your command prompt/terminal, then navigate to your PARENT_FOLDER.
- Run
cd INSERT_PARENT_FOLDER_HERE
- Run
- Run
git clone https://github.com/GBADsInformatics/anduryl-plus.git
- Rename
anduryl-plus
toanduryl
- To do so, run
mv anduryl-plus anduryl
- To do so, run
- Run
python -m anduryl
- Open your command prompt/terminal, then navigate to your PARENT_FOLDER.
- Option 1: Browser
Anduryl in Jupyter Notebook
Import Anduryl
- To import Anduryl, Jupyter needs to know where to find it. Add the block of code below to the top of your Jupyter Notebook to import the module.
Note: Change the code to your PARENT_FOLDER before you run it.
#Showing the system where to find Anduryl
import sys
anduryl_path = 'INSERT_PARENT_FOLDER_HERE' # Path to anduryl parent folder
if anduryl_path not in sys.path: sys.path.append(anduryl_path) # Add path to sys
import anduryl
Usage Examples
- To learn more about using Anduryl in Jupyter Notebook, visit Example Anduryl with scripting
Anduryl in R Studio
- Install the reticulate library to call python modules from R.
- In R, type
install.packages("reticulate")
- Follow the wizard to install reticulate
- In R, type
- Import reticulate and Anduryl by running the code below.
Note: Change the first line to your PARENT_FOLDERanduryl_path = 'INSERT_PARENT_FOLDER_HERE'
library("reticulate")
sys <- import("sys")
if (!anduryl_path %in% sys$path)(sys$path <- append(sys$path, anduryl_path))
anduryl <- import("anduryl") - Each time you load up R, you'll need to re-run step 2.
- Usage example:This code should output
proj <- anduryl$Project()
projMain project class.
Properties:
- assessments
- experts
- io
- items
- main_results
- results
Methods:
- add_results_from_settings
- calculate_decision_maker
- calculate_expert_robustness
- calculate_item_robustness
- initialize
- to_results
- To learn more about coding with Anduryl, visit Example Anduryl with scripting
- Note: because you will be coding in R, you will reference objects using
$
instead of.
- Ex.
anduryl$Project()
instead ofanduryl.Project()
- Ex.