-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from VU-Cog-Sci/develop
Develop
- Loading branch information
Showing
15 changed files
with
406 additions
and
267 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,5 +114,6 @@ dmypy.json | |
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
.vscode | ||
**.iohpid | ||
**/.iohpid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
language: python | ||
sudo: false | ||
|
||
deploy: | ||
provider: pypi | ||
user: "lukassnoek" | ||
password: | ||
secure: "Your encrypted password" | ||
on: | ||
tags: true | ||
repo: VU-Cog-Sci | ||
|
||
env: | ||
global: | ||
- PIP_DEPS="pytest coveralls pytest-cov" | ||
|
||
python: | ||
- '3.6' | ||
|
||
install: | ||
- travis_retry pip install $PIP_DEPS | ||
#- travis_retry pip install -r requirements.txt | ||
- travis_retry pip install -e . | ||
|
||
script: | ||
#- flake8 --ignore N802,N806 `find . -name \*.py | grep -v setup.py | grep -v version.py | grep -v __init__.py | grep -v /doc/` | ||
- mkdir for_test | ||
- cd for_test | ||
- py.test --pyargs exptools2 --cov-report term-missing --cov=exptools2 | ||
|
||
after_success: | ||
- coveralls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# exptools2 | ||
Stimulus presentation for psychophysics experiments using PsychoPy. | ||
|
||
## Installation instructions | ||
- Clone repository and run `python setup.py install` | ||
- Make sure the requirements (see `setup.py` are installed) | ||
- Also install the `pylink` library (email Lukas for the actual package) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,54 @@ | ||
import sys | ||
sys.path.append('exptools2') | ||
from session import Session | ||
from trial import Trial | ||
from exptools2.session import Session | ||
from exptools2.trial import Trial | ||
from psychopy.visual import TextStim | ||
|
||
|
||
class TestTrial(Trial): | ||
""" Simple trial with text (trial x) and fixation. """ | ||
def __init__(self, session, trial_nr, phase_durations, phase_names=None, | ||
parameters=None, load_next_during_phase=None, verbose=True): | ||
super().__init__(session, trial_nr, phase_durations, phase_names, | ||
parameters, load_next_during_phase, verbose) | ||
def __init__(self, session, trial_nr, phase_durations, txt=None, **kwargs): | ||
super().__init__(session, trial_nr, phase_durations, **kwargs) | ||
self.txt = TextStim(self.session.win, txt) | ||
|
||
def draw(self): | ||
""" Draws stimuli """ | ||
if self.phase == 0: | ||
stim = TextStim(self.session.win, 'Trial %i' % (self.trial_nr)) | ||
stim.draw() | ||
self.txt.draw() | ||
else: | ||
self.session.default_fix.draw() | ||
|
||
super().draw() | ||
|
||
|
||
class TestSession(Session): | ||
""" Simple session with x trials. """ | ||
def __init__(self, settings_file=None, n_trials=10, eyetracker_on=False): | ||
def __init__(self, output_str, settings_file=None, n_trials=10, eyetracker_on=False): | ||
""" Initializes TestSession object. """ | ||
self.n_trials = n_trials | ||
super().__init__(settings_file, eyetracker_on) | ||
super().__init__(output_str, settings_file, eyetracker_on) | ||
|
||
def create_trials(self, durations=(.5, .5), timing='seconds'): | ||
self.trials = [] | ||
for trial_nr in range(self.n_trials): | ||
self.trials.append( | ||
TestTrial(session=self, | ||
trial_nr=trial_nr, | ||
phase_durations=durations, | ||
txt='Trial %i' % trial_nr, | ||
verbose=False, | ||
timing=timing) | ||
) | ||
|
||
def run(self): | ||
""" Runs experiment. """ | ||
self.create_trials() | ||
self.start_experiment() | ||
for trial_nr in range(self.n_trials): | ||
|
||
trial = TestTrial( | ||
session=self, | ||
trial_nr=trial_nr, | ||
phase_durations=(0.5, 0.5), | ||
verbose=True | ||
) | ||
for trial in self.trials: | ||
trial.run() | ||
|
||
trial.run() | ||
self.close() | ||
|
||
|
||
if __name__ == '__main__': | ||
|
||
session = TestSession(n_trials=10) | ||
session = TestSession('sub-01', n_trials=5) | ||
session.create_trials(durations=(.5, .5), timing='seconds') | ||
#session.create_trials(durations=(30, 30), timing='frames') | ||
session.run() |
This file was deleted.
Oops, something went wrong.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ window: | |
color: [0, 0, 0] | ||
fullscr: True | ||
winType: pyglet | ||
waitBlanking: True | ||
|
||
monitor: | ||
name: default | ||
|
Oops, something went wrong.