From aa612a9aafa918da77632d51461a27abf3e49274 Mon Sep 17 00:00:00 2001 From: Younes Strittmatter Date: Sun, 1 Dec 2024 00:39:42 -0500 Subject: [PATCH 1/6] docs: update sweetbean notebook to use newest version --- .../notebooks/sweetbean.ipynb | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/docs/examples/closed-loop-basic/notebooks/sweetbean.ipynb b/docs/examples/closed-loop-basic/notebooks/sweetbean.ipynb index 94ee0a52a..1d9deb6c6 100644 --- a/docs/examples/closed-loop-basic/notebooks/sweetbean.ipynb +++ b/docs/examples/closed-loop-basic/notebooks/sweetbean.ipynb @@ -30,7 +30,7 @@ "outputs": [], "source": [ "%%capture\n", - "!pip install git+https://github.com/AutoResearch/sweetbean" + "!pip install sweetbean" ] }, { @@ -82,22 +82,22 @@ "metadata": {}, "outputs": [], "source": [ - "from sweetbean.stimulus import TextStimulus\n", + "from sweetbean.stimulus import Text\n", "\n", - "introduction_welcome = TextStimulus(text='Welcome to our perception experiment.

\\\n", + "introduction_welcome = Text(text='Welcome to our perception experiment.

\\\n", " Press the SPACE key to continue.',\n", " choices=[' '])\n", "\n", - "introduction_pictures = TextStimulus(text='Each picture contains two sets of dots, one left and one right.

\\\n", + "introduction_pictures = Text(text='Each picture contains two sets of dots, one left and one right.

\\\n", " Press the SPACE key to continue.',\n", " choices=[' '])\n", "\n", - "introduction_responses = TextStimulus(text='You have to indicate whether the two sets contain an equal number of dots.

\\\n", + "introduction_responses = Text(text='You have to indicate whether the two sets contain an equal number of dots.

\\\n", " Press the y-key for yes (equal number) and
the n-key for no (unequal number).

\\\n", " Press the SPACE key to continue.',\n", " choices=[' '])\n", "\n", - "introduction_note = TextStimulus(text='Note: For each picture, you have only 2 seconds to respond, so respond quickly.

\\\n", + "introduction_note = Text(text='Note: For each picture, you have only 2 seconds to respond, so respond quickly.

\\\n", " You can only respond with the y and n keys while the dots are shown.

\\\n", " Press the SPACE key to BEGIN the experiment.',\n", " choices=[' '])" @@ -116,7 +116,7 @@ "metadata": {}, "outputs": [], "source": [ - "from sweetbean.sequence import Block\n", + "from sweetbean import Block\n", "\n", "# create a list of instruction stimuli for the instruction block\n", "introduction_list = [introduction_welcome,\n", @@ -144,7 +144,7 @@ "outputs": [], "source": [ "# create a text stimulus shown at the end of the experiment\n", - "instruction_exit = TextStimulus(duration=3000,\n", + "instruction_exit = Text(duration=3000,\n", " text='Thank you for participating in the experiment.',\n", " )\n", "\n", @@ -177,10 +177,10 @@ "metadata": {}, "outputs": [], "source": [ - "from sweetbean.stimulus import FixationStimulus\n", + "from sweetbean.stimulus import Fixation\n", "\n", "duration = 1500 # the duration is given in ms\n", - "fixation = FixationStimulus(duration)" + "fixation = Fixation(duration)" ] }, { @@ -203,15 +203,15 @@ "metadata": {}, "outputs": [], "source": [ - "from sweetbean.parameter import TimelineVariable\n", - "from sweetbean.stimulus import RandomDotPatternsStimulus\n", + "from sweetbean.variable import TimelineVariable\n", + "from sweetbean.stimulus import RandomDotPatterns\n", "\n", "# define the stimuli features as timeline variables\n", - "dot_stimulus_left = TimelineVariable('dots_left', [40, 70])\n", - "dot_stimulus_right = TimelineVariable('dots_right', [40, 70])\n", + "dot_stimulus_left = TimelineVariable('dots_left')\n", + "dot_stimulus_right = TimelineVariable('dots_right')\n", "\n", "# We can use these variables in the stimuli declaration:\n", - "rdp = RandomDotPatternsStimulus(\n", + "rdp = RandomDotPatterns(\n", " duration=2000,\n", " number_of_oobs=[dot_stimulus_left, dot_stimulus_right],\n", " number_of_apertures=2,\n", @@ -242,7 +242,7 @@ "metadata": {}, "outputs": [], "source": [ - "from sweetbean.sequence import Block, Experiment, sequence_to_image\n", + "from sweetbean import Block, Experiment\n", "\n", "# define the sequence of events within a trial\n", "event_sequence = [fixation, rdp]\n", @@ -293,7 +293,7 @@ "\n", "The function below compiles the code above into a single function, and returns a web-based (JavaScript) experiment, written in ``jsPsych``.\n", "\n", - "The function takes a timeline, containing a sequence of trials, as input, along with the two levels for the dot stimuli." + "The function takes a timeline, containing a sequence of trials, as input." ] }, { @@ -302,29 +302,29 @@ "metadata": {}, "outputs": [], "source": [ - "from sweetbean.stimulus import TextStimulus, FixationStimulus, RandomDotPatternsStimulus\n", - "from sweetbean.sequence import Block, Experiment, sequence_to_image\n", - "from sweetbean.parameter import TimelineVariable\n", + "from sweetbean.stimulus import Text, Fixation, RandomDotPatterns\n", + "from sweetbean import Block, Experiment\n", + "from sweetbean.variable import TimelineVariable\n", "\n", - "def stimulus_sequence(timeline, num_dots_1, num_dots_2):\n", + "def stimulus_sequence(timeline):\n", "\n", " # INSTRUCTION BLOCK\n", "\n", " # generate several text stimuli that serve as instructions\n", - " introduction_welcome = TextStimulus(text='Welcome to our perception experiment.

\\\n", + " introduction_welcome = Text(text='Welcome to our perception experiment.

\\\n", " Press the SPACE key to continue.',\n", " choices=[' '])\n", "\n", - " introduction_pictures = TextStimulus(text='Each picture contains two sets of dots, one left and one right.

\\\n", + " introduction_pictures = Text(text='Each picture contains two sets of dots, one left and one right.

\\\n", " Press the SPACE key to continue.',\n", " choices=[' '])\n", "\n", - " introduction_responses = TextStimulus(text='You have to indicate whether the two sets contain an equal number of dots.

\\\n", + " introduction_responses = Text(text='You have to indicate whether the two sets contain an equal number of dots.

\\\n", " Press the y-key for yes (equal number) and
the n-key for no (unequal number).

\\\n", " Press the SPACE key to continue.',\n", " choices=[' '])\n", "\n", - " introduction_note = TextStimulus(text='Note: For each picture, you have only 2 seconds to respond, so respond quickly.

\\\n", + " introduction_note = Text(text='Note: For each picture, you have only 2 seconds to respond, so respond quickly.

\\\n", " You can only respond with the y and n keys while the dots are shown.

\\\n", " Press the SPACE key to BEGIN the experiment.',\n", " choices=[' '])\n", @@ -342,7 +342,7 @@ " # EXIT BLOCK\n", "\n", " # create a text stimulus shown at the end of the experiment\n", - " instruction_exit = TextStimulus(duration=3000,\n", + " instruction_exit = Text(duration=3000,\n", " text='Thank you for participating in the experiment.',\n", " )\n", "\n", @@ -355,14 +355,14 @@ " # TASK BLOCK\n", "\n", " # define fixation cross\n", - " fixation = FixationStimulus(1500)\n", + " fixation = Fixation(1500)\n", "\n", " # define the stimuli features as timeline variables\n", - " dot_stimulus_left = TimelineVariable('dots_left', [num_dots_1, num_dots_2])\n", - " dot_stimulus_right = TimelineVariable('dots_right', [num_dots_1, num_dots_2])\n", + " dot_stimulus_left = TimelineVariable('dots_left')\n", + " dot_stimulus_right = TimelineVariable('dots_right')\n", "\n", " # We can define a stimulus as a function of those stimulus features\n", - " rdp = RandomDotPatternsStimulus(\n", + " rdp = RandomDotPatterns(\n", " duration=2000,\n", " number_of_oobs=[dot_stimulus_left, dot_stimulus_right],\n", " number_of_apertures=2,\n", From 36c2f78c39fc447bc425da7272fc70585db2025d Mon Sep 17 00:00:00 2001 From: Younes Strittmatter Date: Sun, 1 Dec 2024 00:45:20 -0500 Subject: [PATCH 2/6] docs: update sweetbean example to use the newest version --- docs/examples/closed-loop-basic/experiment.md | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/docs/examples/closed-loop-basic/experiment.md b/docs/examples/closed-loop-basic/experiment.md index be30ee5e2..49b4d1a76 100644 --- a/docs/examples/closed-loop-basic/experiment.md +++ b/docs/examples/closed-loop-basic/experiment.md @@ -114,42 +114,42 @@ Here, we will generate such a web experiment using [SweetBean](https://autoresea - Within your current environment, make sure to install the latest version of SweetBean directly from the GitHub repository: ```shell -pip install git+https://github.com/AutoResearch/sweetbean +pip install sweetbean ``` The following function generates JavaScript code for a web-based experiment. The experiment corresponds to a sequence of stimuli, thereby we call it ``stimulus_sequence``. It returns a string that contains the JavaScript code for the experiment. -Note that the function receives as input a ``timeline`` specifying a sequence of timeline variables. This timeline corresponds to the trial sequence generated by the SweetPea program above. In addition, the function takes as input the two stimulus intensities, ``num_dots_1`` and ``num_dots_2``, corresponding to the number of dots under consideration for the experiment. +Note that the function receives as input a ``timeline`` specifying a sequence of timeline variables. This timeline corresponds to the trial sequence generated by the SweetPea program above. !!! hint If you want to tinker with the SweetBean code just for this example, you can open the corresponding notebook in Google Colab by clicking the following badge: [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/AutoResearch/autora/docs/examples/closed-loop-basic/notebooks/sweetbean.ipynb) ```python -from sweetbean.stimulus import TextStimulus, FixationStimulus, RandomDotPatternsStimulus -from sweetbean.sequence import Block, Experiment, sequence_to_image -from sweetbean.parameter import TimelineVariable +from sweetbean.stimulus import Text, Fixation, RandomDotPatterns +from sweetbean import Block, Experiment +from sweetbean.variable import TimelineVariable -def stimulus_sequence(timeline, num_dots_1, num_dots_2): +def stimulus_sequence(timeline): # INSTRUCTION BLOCK # generate several text stimuli that serve as instructions - introduction_welcome = TextStimulus(text='Welcome to our perception experiment.

\ + introduction_welcome = Text(text='Welcome to our perception experiment.

\ Press the SPACE key to continue.', choices=[' ']) - introduction_pictures = TextStimulus(text='Each picture contains two sets of dots, one left and one right.

\ + introduction_pictures = Text(text='Each picture contains two sets of dots, one left and one right.

\ Press the SPACE key to continue.', choices=[' ']) - introduction_responses = TextStimulus(text='You have to indicate whether the two sets contain an equal number of dots.

\ + introduction_responses = Text(text='You have to indicate whether the two sets contain an equal number of dots.

\ Press the y-key for yes (equal number) and
the n-key for no (unequal number).

\ Press the SPACE key to continue.', choices=[' ']) - introduction_note = TextStimulus(text='Note: For each picture, you have only 2 seconds to respond, so respond quickly.

\ + introduction_note = Text(text='Note: For each picture, you have only 2 seconds to respond, so respond quickly.

\ You can only respond with the y and n keys while the dots are shown.

\ Press the SPACE key to BEGIN the experiment.', choices=[' ']) @@ -167,7 +167,7 @@ def stimulus_sequence(timeline, num_dots_1, num_dots_2): # EXIT BLOCK # create a text stimulus shown at the end of the experiment - instruction_exit = TextStimulus(duration=3000, + instruction_exit = Text(duration=3000, text='Thank you for participating in the experiment.', ) @@ -180,14 +180,14 @@ def stimulus_sequence(timeline, num_dots_1, num_dots_2): # TASK BLOCK # define fixation cross - fixation = FixationStimulus(1500) + fixation = Fixation(1500) # define the stimuli features as timeline variables - dot_stimulus_left = TimelineVariable('dots left', [num_dots_1, num_dots_2]) - dot_stimulus_right = TimelineVariable('dots right', [num_dots_1, num_dots_2]) + dot_stimulus_left = TimelineVariable('dots left') + dot_stimulus_right = TimelineVariable('dots right') # We can define a stimulus as a function of those stimulus features - rdp = RandomDotPatternsStimulus( + rdp = RandomDotPatterns( duration=2000, number_of_oobs=[dot_stimulus_left, dot_stimulus_right], number_of_apertures=2, @@ -235,20 +235,20 @@ First, we define the instruction block, which consists of a series of text stimu ```python # generate several text stimuli that serve as instructions - introduction_welcome = TextStimulus(text='Welcome to our perception experiment.

\ + introduction_welcome = Text(text='Welcome to our perception experiment.

\ Press the SPACE key to continue.', choices=[' ']) - introduction_pictures = TextStimulus(text='Each picture contains two sets of dots, one left and one right.

\ + introduction_pictures = Text(text='Each picture contains two sets of dots, one left and one right.

\ Press the SPACE key to continue.', choices=[' ']) - introduction_responses = TextStimulus(text='You have to indicate whether the two sets contain an equal number of dots.

\ + introduction_responses = Text(text='You have to indicate whether the two sets contain an equal number of dots.

\ Press the y-key for yes (equal number) and
the n-key for no (unequal number).

\ Press the SPACE key to continue.', choices=[' ']) - introduction_note = TextStimulus(text='Note: For each picture, you have only 2 seconds to respond, so respond quickly.

\ + introduction_note = Text(text='Note: For each picture, you have only 2 seconds to respond, so respond quickly.

\ You can only respond with the y and n keys while the dots are shown.

\ Press the SPACE key to BEGIN the experiment.', choices=[' ']) @@ -273,7 +273,7 @@ Similarly, we can define instructions for the end of the experiment. In this cas # EXIT BLOCK # create a text stimulus shown at the end of the experiment - instruction_exit = TextStimulus(duration=3000, + instruction_exit = Text(duration=3000, text='Thank you for participating in the experiment.', ) @@ -291,22 +291,22 @@ Next, we define the task block. This block consists of the experimental trials, # TASK BLOCK # define fixation cross - fixation = FixationStimulus(1500) + fixation = Fixation(1500) ``` -The random dot pattern stimulus is parameterized by two stimulus features, ``dot_stimulus_left`` and ``dot_stimulus_right``, which correspond to the number of dots in the left and right stimulus, respectively. These stimulus features are defined as ``TimelineVariable`` objects. These objects are updated based on the timeline, i.e., the trial sequence, provided to the function. The ``TimelineVariable`` object takes as input the name of the variable and the possible values that the variable can take. In this case, the possible values are given by ``num_dots_1`` and ``num_dots_2``. +The random dot pattern stimulus is parameterized by two stimulus features, ``dot_stimulus_left`` and ``dot_stimulus_right``, which correspond to the number of dots in the left and right stimulus, respectively. These stimulus features are defined as ``TimelineVariable`` objects. These objects are updated based on the timeline, i.e., the trial sequence, provided to the function. The ``TimelineVariable`` object takes as input the name of the variable. ```python # define the stimuli features as timeline variables - dot_stimulus_left = TimelineVariable('dots left', [num_dots_1, num_dots_2]) - dot_stimulus_right = TimelineVariable('dots right', [num_dots_1, num_dots_2]) + dot_stimulus_left = TimelineVariable('dots left') + dot_stimulus_right = TimelineVariable('dots right') ``` Next, we define the random dot pattern stimulus, as a ``RandomDotPatternsStimulus`` object, which is shown for 2000ms (``duration=2000``). It consists of two set of dots (``number_of_apertures=2``), which are parameterized by the two timeline variables ``number_of_oobs=[dot_stimulus_left, dot_stimulus_right]``. Finally, we allow participants to record a response on each stimulus, indicating whether the dots match or not by pressing the respective keys for `y` and `n` (``choices=["y", "n"]``) ```python # We can define a stimulus as a function of those stimulus features - rdp = RandomDotPatternsStimulus( + rdp = RandomDotPatterns( duration=2000, number_of_oobs=[dot_stimulus_left, dot_stimulus_right], number_of_apertures=2, From c1b2d448f358a37a36c065e56a8018fee0ac09fb Mon Sep 17 00:00:00 2001 From: Younes Strittmatter Date: Sun, 1 Dec 2024 00:54:48 -0500 Subject: [PATCH 3/6] docs: update sweetbean example to use newest version --- docs/examples/closed-loop-basic/experiment.md | 10 +++------- docs/examples/closed-loop-basic/testingzone.md | 11 +++-------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/docs/examples/closed-loop-basic/experiment.md b/docs/examples/closed-loop-basic/experiment.md index 49b4d1a76..369f2f5b3 100644 --- a/docs/examples/closed-loop-basic/experiment.md +++ b/docs/examples/closed-loop-basic/experiment.md @@ -351,13 +351,7 @@ Head over to the `testing_zone` folder: cd testing_zone ``` -Next, install the dependency for the dot stimulus jsPsych plugin: - -```shell -npm install @jspsych-contrib/plugin-rok -``` - -Also make sure to include the following lines in the `main.js` file in `testing_zone/src/design`: +Make sure to include the following lines in the `main.js` file in `testing_zone/src/design`: ```javascript import jsPsychRok from '@jspsych-contrib/plugin-rok' global.jsPsychRok = jsPsychRok @@ -377,6 +371,8 @@ Your ``main.js`` file should now look like this: ```javascript import { initJsPsych } from 'jspsych'; import 'jspsych/css/jspsych.css' +import 'sweetbean/dist/style/main.css'; +import 'sweetbean/dist/style/bandit.css'; import htmlKeyboardResponse from '@jspsych/plugin-html-keyboard-response'; import jsPsychRok from '@jspsych-contrib/plugin-rok' diff --git a/docs/examples/closed-loop-basic/testingzone.md b/docs/examples/closed-loop-basic/testingzone.md index 380808a76..0179311d3 100644 --- a/docs/examples/closed-loop-basic/testingzone.md +++ b/docs/examples/closed-loop-basic/testingzone.md @@ -80,16 +80,11 @@ firebase init 8. Don't set up automatic builds and deploys with GitHub. Enter `N` and press ENTER. 9. Don't overwrite the index.html file if the question pops up. -## Install jspsych -- Next, we install jspsych (still within the ``testing_zone`` folder): +## Install sweetbean +- Next, we install sweetbean (still within the ``testing_zone`` folder): ```shell -npm install jspsych@7.3.1 +npm install sweetbean ``` -- and a minimal package: -```shell -npm install @jspsych/plugin-html-keyboard-response -``` - ## Build And Deploy To Firebase The testing zone folder already contains a default web-based experiment. To serve this web-experiment on the internet, you must build and deploy it to Firebase. We will repeat this step later once we deploy our actual experiment. From 90f45c69c15ae9697136007825f0d35aa63391c0 Mon Sep 17 00:00:00 2001 From: Younes Strittmatter Date: Sun, 1 Dec 2024 01:15:19 -0500 Subject: [PATCH 4/6] docs: update sweetbean example to use newest version --- docs/examples/closed-loop-basic/experiment.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/examples/closed-loop-basic/experiment.md b/docs/examples/closed-loop-basic/experiment.md index 369f2f5b3..3aa90a551 100644 --- a/docs/examples/closed-loop-basic/experiment.md +++ b/docs/examples/closed-loop-basic/experiment.md @@ -231,7 +231,7 @@ Below, we elaborate a bit more on the code. However, if you are already familiar SweetBean organizes events into event sequences, and event sequences into blocks. Event sequences may correspond to trials, and blocks correspond to a sequence of experiment trials. -First, we define the instruction block, which consists of a series of text stimuli that provide instructions to the participants. Each text stimulus is defined as a ``TextStimulus`` object. The ``TextStimulus`` object takes as input the text to be displayed and the choices that the participant can make. The choices are defined as a list of keys that the participant can press to continue to the next instruction. In this case, the participant can continue by pressing the ``SPACE`` key. +First, we define the instruction block, which consists of a series of text stimuli that provide instructions to the participants. Each text stimulus is defined as a ``Text`` object. The ``Text`` object takes as input the text to be displayed and the choices that the participant can make. The choices are defined as a list of keys that the participant can press to continue to the next instruction. In this case, the participant can continue by pressing the ``SPACE`` key. ```python # generate several text stimuli that serve as instructions @@ -302,7 +302,7 @@ The random dot pattern stimulus is parameterized by two stimulus features, ``dot dot_stimulus_right = TimelineVariable('dots right') ``` -Next, we define the random dot pattern stimulus, as a ``RandomDotPatternsStimulus`` object, which is shown for 2000ms (``duration=2000``). It consists of two set of dots (``number_of_apertures=2``), which are parameterized by the two timeline variables ``number_of_oobs=[dot_stimulus_left, dot_stimulus_right]``. Finally, we allow participants to record a response on each stimulus, indicating whether the dots match or not by pressing the respective keys for `y` and `n` (``choices=["y", "n"]``) +Next, we define the random dot pattern stimulus, as a ``RandomDotPatterns`` object, which is shown for 2000ms (``duration=2000``). It consists of two set of dots (``number_of_apertures=2``), which are parameterized by the two timeline variables ``number_of_oobs=[dot_stimulus_left, dot_stimulus_right]``. Finally, we allow participants to record a response on each stimulus, indicating whether the dots match or not by pressing the respective keys for `y` and `n` (``choices=["y", "n"]``) ```python # We can define a stimulus as a function of those stimulus features From 563b9ce28696bc5b6fa106e0f3839c0d7cb4cbf8 Mon Sep 17 00:00:00 2001 From: Younes Strittmatter Date: Sun, 1 Dec 2024 01:30:57 -0500 Subject: [PATCH 5/6] docs: fix colab links --- docs/examples/closed-loop-basic/experiment.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/examples/closed-loop-basic/experiment.md b/docs/examples/closed-loop-basic/experiment.md index 3aa90a551..de8989f57 100644 --- a/docs/examples/closed-loop-basic/experiment.md +++ b/docs/examples/closed-loop-basic/experiment.md @@ -31,7 +31,7 @@ Here, we will generate such a sequence of trials using [SweetPea](https://sites. !!! hint If you want to tinker with the SweetPea code just for this example, you can open the corresponding notebook in Google Colab by clicking the following badge: - [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/AutoResearch/autora/docs/examples/closed-loop-basic/notebooks/sweetpea.ipynb) + [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/AutoResearch/autora/blob/main/docs/examples/closed-loop-basic/notebooks/sweetpea.ipynb) The following function generates an experimental sequence of at least ``min_trials`` trials. Each trial consists of two conditions: the number of dots in the first set (``num_dots_1``) and the number of dots in the second set (``num_dots_2``). The function ``trial_sequence`` returns a list of dictionaries, where each dictionary represents a trial of a counterbalanced experiment sequence @@ -64,7 +64,7 @@ def trial_sequence(num_dots_1, num_dots_2, min_trials): - To execute the script you will also need to ``pip install sweetpea`` in your virtual environment. - Make sure to add ``sweetpea`` as a dependency in the ``requirements.txt`` file within the ``researcher_hub`` folder. -Below, we elaborate a bit more on the code. However, if you are already familiar with SweetPea, you may skip the "Explanation" section. Alternatively, you can gain an intuition for the code in the corresponding notebook: [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/AutoResearch/autora/docs/examples/closed-loop-basic/notebooks/sweetpea.ipynb). +Below, we elaborate a bit more on the code. However, if you are already familiar with SweetPea, you may skip the "Explanation" section. Alternatively, you can gain an intuition for the code in the corresponding notebook: [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/AutoResearch/autora/blob/main/docs/examples/closed-loop-basic/notebooks/sweetpea.ipynb). ### Code Explanation @@ -124,7 +124,7 @@ Note that the function receives as input a ``timeline`` specifying a sequence of !!! hint If you want to tinker with the SweetBean code just for this example, you can open the corresponding notebook in Google Colab by clicking the following badge: - [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/AutoResearch/autora/docs/examples/closed-loop-basic/notebooks/sweetbean.ipynb) + [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/AutoResearch/autora/blob/main/docs/examples/closed-loop-basic/notebooks/sweetbean.ipynb) ```python from sweetbean.stimulus import Text, Fixation, RandomDotPatterns @@ -223,7 +223,7 @@ Once both functions are integrated both functions, your researcher hub should co ![researcher_hub.png](img/researcher_hub.png) -Below, we elaborate a bit more on the code. However, if you are already familiar with SweetBean, you may skip the "Explanation" section. Alternatively, you can gain an intuition for the code in the corresponding notebook: [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/AutoResearch/autora/docs/examples/closed-loop-basic/notebooks/sweetbean.ipynb). +Below, we elaborate a bit more on the code. However, if you are already familiar with SweetBean, you may skip the "Explanation" section. Alternatively, you can gain an intuition for the code in the corresponding notebook: [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/AutoResearch/autora/blob/main/docs/examples/closed-loop-basic/notebooks/sweetbean.ipynb). From 974b03eb6739b54174556a9e4ea9aa0cd59f0336 Mon Sep 17 00:00:00 2001 From: Younes Strittmatter Date: Sun, 1 Dec 2024 01:32:24 -0500 Subject: [PATCH 6/6] docs: fix typos in notebook --- docs/examples/closed-loop-basic/notebooks/sweetbean.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/examples/closed-loop-basic/notebooks/sweetbean.ipynb b/docs/examples/closed-loop-basic/notebooks/sweetbean.ipynb index 1d9deb6c6..09c231a05 100644 --- a/docs/examples/closed-loop-basic/notebooks/sweetbean.ipynb +++ b/docs/examples/closed-loop-basic/notebooks/sweetbean.ipynb @@ -6,7 +6,7 @@ "source": [ "# Generating Stimulus Sequences for a Closed-Loop Psychophysics Study\n", "\n", - "In this example, we use SweetPea to generate an experimental sequence for a same-different Psychophysics experiment. In this experiment, each trials has the following sequence of events:\n", + "In this example, we use SweetBean to generate an experimental sequence for a same-different Psychophysics experiment. In this experiment, each trials has the following sequence of events:\n", "- a fixation cross is displayed for 1500 ms\n", "- a set of two dot stimuli is displayed, one on the left and one on the right for 200ms. Each set contains a certain number of dots and the participant has to indicate whether the numbers of dots in the two sets are the same or different by pressing `y` or `n`.\n", "\n", @@ -64,9 +64,9 @@ "source": [ "## Instruction Block\n", "\n", - "Many experiment require instructions that tell the participants what to do.\n", + "Many experiments require instructions that tell the participants what to do.\n", "\n", - "Creating instructions in SweetPea is quite simple. First, we define a number of text stimuli that the participant sees. Then, we specify the order of the text stimuli within a block of instructions." + "Creating instructions in SweetBean is quite simple. First, we define a number of text stimuli that the participant sees. Then, we specify the order of the text stimuli within a block of instructions." ] }, {