diff --git a/backend/experiment/rules/speech2song.py b/backend/experiment/rules/speech2song.py index 2de84bbd5..7cf31b9e3 100644 --- a/backend/experiment/rules/speech2song.py +++ b/backend/experiment/rules/speech2song.py @@ -24,7 +24,7 @@ class Speech2Song(Base): """ Rules for a speech-to-song experiment """ ID = 'SPEECH_TO_SONG' - + def __init__(self): self.question_series = [ { diff --git a/backend/experiment/rules/util/practice.py b/backend/experiment/rules/util/practice.py index 43004242c..81dddb8fe 100644 --- a/backend/experiment/rules/util/practice.py +++ b/backend/experiment/rules/util/practice.py @@ -7,7 +7,7 @@ def get_practice_views( - session, + session, intro_explainer, first_trial_callback, trial_callback, @@ -30,7 +30,7 @@ def get_practice_views( trial_condition = get_trial_condition_block(session, 2) previous_results = session.result_set.order_by('-created_at') if not results_count: - # first practice trial + # first practice trial return trial_callback(session, trial_condition, difficulty) last_result = previous_results.first() if results_count < 4: @@ -116,7 +116,7 @@ def start_experiment_explainer(): def get_trial_condition_block(session, n_trials_per_block): - """ make a list of n_trials_per_blocks conditions, of which one is catch (=1) + """ make a list of n_trials_per_blocks conditions, of which one is catch (=1) store updates in the session.json_data field """ json_data = session.load_json_data() @@ -132,9 +132,8 @@ def get_trial_condition_block(session, n_trials_per_block): def get_trial_condition(n_choices): - """ get randomized trial condition + """ get randomized trial condition return an integer between 0 and n_choices-2 """ options = np.arange(n_choices) return np.random.choice(options) - \ No newline at end of file diff --git a/backend/requirements.in/base.txt b/backend/requirements.in/base.txt index c964ce6df..e2d075a60 100644 --- a/backend/requirements.in/base.txt +++ b/backend/requirements.in/base.txt @@ -33,3 +33,6 @@ genbadge[coverage] # Convert markdown to html django-markup[all_filter_dependencies] + +# Numpy +numpy diff --git a/backend/requirements/dev.txt b/backend/requirements/dev.txt index fc27ca334..ff5b4aeb5 100644 --- a/backend/requirements/dev.txt +++ b/backend/requirements/dev.txt @@ -67,6 +67,8 @@ mccabe==0.7.0 # via # flake8 # pylint +numpy==2.0.0 + # via -r requirements.in/base.txt packaging==23.2 # via build pillow==10.3.0 diff --git a/backend/requirements/prod.txt b/backend/requirements/prod.txt index 346b13765..0ca5039f6 100644 --- a/backend/requirements/prod.txt +++ b/backend/requirements/prod.txt @@ -48,6 +48,8 @@ idna==3.7 # via requests markdown==3.5.2 # via django-markup +numpy==2.0.0 + # via -r requirements.in/base.txt packaging==24.1 # via gunicorn pillow==10.3.0