Skip to content

Commit

Permalink
chore(deps): (Re-)install numpy as we are using it.
Browse files Browse the repository at this point in the history
This was an indirect dependency of iptocc and got removed when iptocc was removed from the pythonic requirements.
  • Loading branch information
drikusroor committed Jun 27, 2024
1 parent b5d601c commit bcd928a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion backend/experiment/rules/speech2song.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
class Speech2Song(Base):
""" Rules for a speech-to-song experiment """
ID = 'SPEECH_TO_SONG'

def __init__(self):
self.question_series = [
{
Expand Down
9 changes: 4 additions & 5 deletions backend/experiment/rules/util/practice.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


def get_practice_views(
session,
session,
intro_explainer,
first_trial_callback,
trial_callback,
Expand All @@ -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:
Expand Down Expand Up @@ -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()
Expand All @@ -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)

3 changes: 3 additions & 0 deletions backend/requirements.in/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ genbadge[coverage]

# Convert markdown to html
django-markup[all_filter_dependencies]

# Numpy
numpy
2 changes: 2 additions & 0 deletions backend/requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions backend/requirements/prod.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bcd928a

Please sign in to comment.