Skip to content

Set Up Project

First, we need to set up our local AutoRA project.

Setup

Create Repository

To ease the setup process for this example, we provide a template repository that contains all the necessary files and configurations.

Clone Repository or Open it in GitHub Codespace

  • Once you created your own repository from the template, you can clone it to your local machine using git clone. However, we recommend using GitHub Codespaces for this example, as it provides a more streamlined development environment.

  • To open the repository in GitHub Codespaces, click on the Code button and select Create codespace on main. open_codespace.png

Set Up Environment

Once you cloned your repository or opened it in Codespaces, it is time to set up your environment. Here, we will use a Python virtual environment to manage dependencies.

Success

We recommend setting up your development environment using a manager like venv, which creates isolated python environments. Other environment managers, like virtualenv, pipenv, virtualenvwrapper, hatch, poetry, are available and will likely work, but will have different syntax to the syntax shown here.

Our packages are set up using virtualenv with pip

  • In the <project directory>, run the following command to create a new virtual environment in the .venv directory

python3 -m "venv" ".venv" 
venv.png

Hint

If you have multiple Python versions installed on your system, it may be necessary to specify the Python version when creating a virtual environment. For example, run the following command to specify Python 3.8 for the virtual environment.

python3.8 -m "venv" ".venv" 

  • Activate it by running
    source ".venv/bin/activate"
    

Install Dependencies

  • First, install the cookiecutter package using pip via
pip install cookiecutter

We will use this package to automatically configure our project folder structure.

  • Then we install some python dependencies:

    pip install -r requirements.txt
    

  • We will also need to install firebase-tools:

    npm install -g firebase-tools
    

We will use this package to deploy our firebase functions for storing data.

Set Up Project Folder with Coockiecutter

To establish an online closed-loop for AutoRA, there are two key components that need to be configured:

  1. AutoRA Workflow

    • This workflow can be executed locally, on a server, or using Cylc. It must have the ability to communicate with a website, allowing for the writing of new conditions and reading of observation data.
    • The AutoRA workflow can be customized by adding or removing AutoRA functions, such as AutoRA experimentalists or AutoRA theorists. It relies on an AutoRA Prolific Firebase runner to collect data from an online experiment hosted via Firebase and recruit participants via prolific.
  2. Website To Conduct Experiment:

    • The website serves as a platform for conducting experiments and needs to be compatible with the AutoRA workflow.
    • In this setup, we use Firebase to host on website.

To simplify the setup process, we provide a cookiecutter template that generates a project folder containing the following two directories:

  1. researcher_hub:

    • This directory includes a basic example of an AutoRA workflow.
  2. testing_zone:

    • This directory provides a basic example of a website served with Firebase, ensuring compatibility with the AutoRA workflow.
  3. Once you installed the packages above, you can create the project by running the following command in the root directory of your project:

cookiecutter https://github.com/AutoResearch/autora-user-cookiecutter

If cookiecutter is not recognized, you may need to run the following command:

python -m cookiecutter https://github.com/AutoResearch/autora-user-cookiecutter
  • You will be prompted to enter some information about your project. You can select single options by pressing SPACE and confirm your selection by pressing ENTER.
  • You may first enter a project name, e.g., "closed-loop-study".
  • Select yes to use advanced features.
  • You may select any theorist for automated model discovery. Here, we will select the autora[theorist-bms] option.
  • You may select any experimentalist for determining novel experiment conditions. Here, we will select the autora[experimentalist-model-disagreement] option.
  • Make sure to select the autora[experiment-runner-firebase-prolific] option
  • Select yes to set up a firebase experiment. When asked to install further packages (create-react-app@5.0.1), select yes (y). This may take some time.
  • Finally, select Sweetbean as project type.

  • Confirm that you have the following project folders:

project_structure.png

Next Steps

Next: Set up Firebase to host our experiment.