TRANSKRIBEERI 🔗
WEBVTT
NOTE
Transcription provided by Podhome.fm
Created: 7/6/2024 5:14:37 PM
Duration: 4330.099
Channels: 1
1
00:00:13.105 --> 00:00:22.730
Hello, and welcome to podcast. Init, the podcast about Python and the people who make it great. I would like to thank everyone who has donated to the show. Your contributions help us make the show sustainable.
2
00:00:23.830 --> 00:00:31.125
Hired is sponsoring us this week. If you're looking for a job as a developer or designer, then Hired will bring the opportunities to you. Sign up at hired.com/podcastinit
3
00:00:32.385 --> 00:00:33.765
to double your signing bonus.
4
00:00:34.500 --> 00:00:40.040
Once you land a job you can check out our other sponsor Linode for running your awesome new Python apps. Check them out at linode.com/podcastinnit
5
00:00:41.460 --> 00:00:57.550
and get and get a $20 credit to try out their fast and reliable Linux virtual service for your next project. You want to make sure your apps are error free, so give our last sponsor Rollbar a look. Rollbar is a service for tracking and aggregating your application errors so that you can find and fix the bugs in your application before your users notice they exist.
6
00:00:58.010 --> 00:00:59.715
Use the link rollbardot com/podcastinit
7
00:01:00.495 --> 00:01:04.195
to get 90 days and 300, 000 errors tracked for free on their Bootstrap plan.
8
00:01:04.735 --> 00:01:14.740
You can visit our site to subscribe to our show, sign up for our newsletter, read the show notes and get in touch. And by leaving a review on Itunes or Google Play Music, it becomes easier for other people to find us.
9
00:01:15.200 --> 00:01:17.619
You can also join our community. Visit discourse.pythonpodcast
10
00:01:18.665 --> 00:01:21.244
dotcom to help us grow and connect our wonderful audience.
11
00:01:21.625 --> 00:01:31.440
Your hosts as usual are Tobias Macey and Chris Patti. And today, we're interviewing Jonathan Pierce about PsychoPy, an open source application for the presentation and collection of stimuli for psychological experimentation.
12
00:01:32.380 --> 00:01:34.400
So, John, could you please introduce yourself?
13
00:01:35.335 --> 00:01:44.715
Hi. Yeah. I'm John Pierce. I'm a lecturer in psychology, an associate professor, I guess, in American terms, in, psychology at University of Nottingham in the UK.
14
00:01:45.480 --> 00:01:47.100
How did you get introduced to Python?
15
00:01:48.600 --> 00:01:49.900
Way back in 2002,
16
00:01:50.600 --> 00:01:54.915
I was a postdoc in a neuroscience lab, and I was using MATLAB
17
00:01:55.215 --> 00:01:59.635
to present stimuli and and, collect responses from participants.
18
00:02:00.330 --> 00:02:01.950
And I was not very
19
00:02:02.250 --> 00:02:04.590
sure about the direction MATLAB was going.
20
00:02:05.050 --> 00:02:08.670
In those days, they weren't clear if they were going to support Apple
21
00:02:09.295 --> 00:02:10.034
going forwards.
22
00:02:10.334 --> 00:02:17.110
In the end, they did,
Load full transcript
but but they were wondering whether or not they would ever support Macs or or or see support for their Macs.
23
00:02:18.070 --> 00:02:30.585
And I started hearing about Python as this other alternative that was free and and, you know, the cool kids were were having a play. But these were really early days for Python. Right? These were there was no matplotlib.
24
00:02:31.045 --> 00:02:32.105
There was no pandas.
25
00:02:32.805 --> 00:02:33.305
NumPy
26
00:02:33.685 --> 00:02:37.140
didn't exist. So there was a a debate between
27
00:02:37.440 --> 00:02:39.060
whether we should use num array
28
00:02:39.440 --> 00:02:40.420
or numeric.
29
00:02:41.040 --> 00:02:44.415
And and and later on, you know, the NumPy
30
00:02:44.795 --> 00:02:54.700
sort of came out of the the the burning embers of those 2. So it was really early days for Python. But what it had that that was really useful to me was it had OpenGL bindings.
31
00:02:55.480 --> 00:02:59.019
And so I could write my OpenGL code
32
00:02:59.535 --> 00:03:04.995
and get hardware accelerated graphics right there in a Python script. Whereas in MATLAB, I had to
33
00:03:05.535 --> 00:03:08.330
write MEX files, which is like a compiled
34
00:03:08.710 --> 00:03:11.050
bridge from from MATLAB to c.
35
00:03:11.830 --> 00:03:14.165
A bit like, I I guess the,
36
00:03:14.805 --> 00:03:16.344
I can't remember the name. The,
37
00:03:18.245 --> 00:03:21.704
a bit like, no. It wasn't c types. Anyway, compiled files
38
00:03:22.030 --> 00:03:27.090
that that you had to write for MATLAB, and I I didn't want to write those. MATLAB actually improved,
39
00:03:27.870 --> 00:03:30.290
in in many ways, and it did support Apple's,
40
00:03:31.465 --> 00:03:32.345
Apple Macs, and,
41
00:03:33.145 --> 00:03:40.125
they did get wrappers for various different things. But by the time MATLAB was getting better, I was already in love with the Python syntax,
42
00:03:40.570 --> 00:03:45.210
and I moved on. So so, yeah, it was early days, basically, and and,
43
00:03:46.090 --> 00:03:50.265
and I just kind of fell in love with the syntax of Python and decided this was a way to go.
44
00:03:51.705 --> 00:03:56.605
And can you start off by telling us what PsychoPy is and how the project got started?
45
00:03:58.400 --> 00:03:59.140
So in
46
00:04:00.000 --> 00:04:00.500
2003,
47
00:04:00.959 --> 00:04:10.375
I then moved to the UK and and got my own faculty position, and I was starting up my own lab. And PsychoPy then began so it started off as a proof of concept
48
00:04:10.675 --> 00:04:15.175
where I was trying to show other people, look. This is what I could do in trying to get other people to write it, to be honest.
49
00:04:15.480 --> 00:04:15.980
But
50
00:04:16.440 --> 00:04:21.180
when I moved to the UK, I started my own lab, and and this became the library
51
00:04:21.800 --> 00:04:26.795
that that my lab used for for Python script. So we would write code in other editors,
52
00:04:27.335 --> 00:04:29.275
and
then we would use the the PsychoPy
53
00:04:29.655 --> 00:04:30.155
library
54
00:04:30.695 --> 00:04:34.235
in order to, you know, provide some convenience functions for
55
00:04:34.600 --> 00:04:36.460
saving data, checking keyboards,
56
00:04:36.840 --> 00:04:38.540
presenting stimuli in a window.
57
00:04:39.080 --> 00:04:39.580
And
58
00:04:40.040 --> 00:04:46.045
gradually, that changed. So I put it online. It was on SourceForge as of 2, 002. But
59
00:04:46.825 --> 00:04:49.885
gradually, people were sort of sending me messages saying,
60
00:04:50.665 --> 00:04:53.965
hi. I saw your thing. I downloaded it. It was cool, but
61
00:04:54.320 --> 00:05:08.725
I don't understand. Where is it? I installed it, and it's not in my start menu. Right? Because it was a library, and people didn't know what that meant exactly. And and so people were struggling also to get all the dependencies from Python and that sort of thing. So I turned it into
62
00:05:09.345 --> 00:05:12.485
an app, which was basically just a code editor
63
00:05:13.010 --> 00:05:14.230
with all of its
64
00:05:14.930 --> 00:05:21.345
sort of dependencies built in, including its own copy of Python. So people install an app, they could write their PsychoPy
65
00:05:21.805 --> 00:05:35.650
scripts, which use the library, and get all of the dependencies built in. And then it was in their start menu, and they got it. Right? So so gradually, people started using that in the sort of 2, 005, 2, 006. We had a couple hundred users maybe, Python enthusiasts.
66
00:05:36.205 --> 00:05:42.145
And then the thing that started happening was that I was getting frustrated because I was teaching
67
00:05:42.765 --> 00:05:47.070
to undergraduates who didn't know how to program and wouldn't want to learn Python.
68
00:05:47.690 --> 00:05:52.750
I was teaching them how to use other software packages that use, like, a graphical interface,
69
00:05:53.405 --> 00:06:05.889
And and I started getting frustrated by that, and the students were frustrated by that too. So around 2008, 2009, I decided I was gonna write a graphical interface on top of this library that would
70
00:06:06.270 --> 00:06:08.930
write your script for you. You would build your experiment
71
00:06:09.470 --> 00:06:09.970
graphically,
72
00:06:10.425 --> 00:06:17.005
or you would write the script yourself if you wanted to. But but you could you could construct it graphically in the builder, and it would compile
73
00:06:17.465 --> 00:06:18.205
the Python
74
00:06:18.585 --> 00:06:20.285
syntax script for you
75
00:06:20.780 --> 00:06:28.800
from what your from your visual representation of your experiment. And and that was the thing that really sort of changed the numbers of PsychoPy,
76
00:06:29.645 --> 00:06:30.465
quite drastically.
77
00:06:30.765 --> 00:06:35.025
That enabled it to be used by an awful lot of people who who didn't want to learn a new language.
78
00:06:36.045 --> 00:06:38.465
And can the output of that builder,
79
00:06:39.099 --> 00:06:41.599
interface then be modified further?
80
00:06:42.539 --> 00:06:51.985
So you can compile it to a you can either just press run, or you can compile it to a script and hack the script, But, also, you can insert into it custom code
81
00:06:52.685 --> 00:07:00.490
of your own that can be executed at various different either on every screen refresh or just at the beginning of experiment, or wherever you like. And
82
00:07:01.110 --> 00:07:06.090
so you can customize it as well, which once you've compiled the script and hacked the script,
83
00:07:06.414 --> 00:07:10.435
you can't go back to the graphical interface from that. Right? So so,
84
00:07:11.134 --> 00:07:11.794
the way
85
00:07:12.335 --> 00:07:14.595
of providing something that you can
86
00:07:14.920 --> 00:07:17.180
edit code within the graphical interface
87
00:07:17.560 --> 00:07:22.940
was was that you got these inline code components as well. And all of this was possible because
88
00:07:23.825 --> 00:07:28.565
Python does great text handling. Right? So we could build a WX
89
00:07:29.425 --> 00:07:31.925
widgets application that would run on any
90
00:07:41.639 --> 00:07:54.789
and and it could just create the appropriate text because of because of the great text handling of Python. So that part was well, it took a lot of thinking, I guess. But but now when I look back at it, it all kind of just hangs together. It makes sense.
91
00:07:55.569 --> 00:07:59.590
So how does PsychoPy compare feature wise against some of the proprietary alternatives?
92
00:08:01.014 --> 00:08:04.955
So I think the key there is that Python and interpreted languages,
93
00:08:05.895 --> 00:08:09.115
and the open source world have meant that nowadays,
94
00:08:10.190 --> 00:08:12.530
software can be written by the people who use the software.
95
00:08:12.910 --> 00:08:13.810
Right? So
96
00:08:14.190 --> 00:08:15.730
I'm not a software engineer,
97
00:08:16.110 --> 00:08:16.610
and
98
00:08:17.285 --> 00:08:17.945
I know
99
00:08:18.805 --> 00:08:19.625
how an experiment
100
00:08:20.245 --> 00:08:25.040
should run. I know how a scientist will think of their experiment. I know even how an undergraduate,
101
00:08:25.900 --> 00:08:28.400
a very junior scientist, will think about their experiment.
102
00:08:28.780 --> 00:08:35.695
So I think in terms of ease of use, that's that's where we win. That's where that's where the open source community,
103
00:08:36.075 --> 00:08:36.575
where
104
00:08:37.035 --> 00:08:37.535
enthusiasts
105
00:08:37.835 --> 00:08:43.760
and users develop the software themselves, rather than the traditional model of trying communicate that to
106
00:08:44.140 --> 00:08:49.839
a professional software engineer who's never personally run an experiment and doesn't know what that means. Right? So
107
00:08:50.540 --> 00:08:51.680
so I can
108
00:08:52.565 --> 00:09:03.740
actually build the thing the way that I want it to run and the way that I think about
my experiment. And so I think that's that's where we win in terms of features. And in most other things, in terms of sort of high end features,
109
00:09:04.200 --> 00:09:12.705
yeah, we can do we can do a lot of the fancy stuff as well. Again, because of the nature of open source software and the fact that you've got lots of enthusiasts
110
00:09:13.245 --> 00:09:15.425
who are contributing, we've we've now got
111
00:09:15.860 --> 00:09:19.640
50, 60 people who've added some level of code,
112
00:09:20.100 --> 00:09:23.640
3 or 4 of us who've contributed a lot. And
113
00:09:24.254 --> 00:09:28.754
those are various different enthusiasts who will add some high end feature of their own. So,
114
00:09:29.454 --> 00:09:38.540
and and whereas commercial software can't just sort of, like, suddenly add this new thing really quickly and and have it out there. So in terms of features, we do really well, I think.
115
00:09:38.895 --> 00:09:40.115
And in terms of usability,
116
00:09:40.575 --> 00:09:48.640
that's that's where I think we're doing extremely well, to be honest. Where we don't do so well is is in bugs and,
117
00:09:49.020 --> 00:09:51.840
you know, reacting to that sort of thing.
118
00:09:52.220 --> 00:09:57.585
We're all busy, and and so and we're not professional sci computer scientists.
119
00:09:58.045 --> 00:10:12.790
So sometimes we've we've added features, but we've not been fixing the bugs for which we've got workarounds. Right? So I know I know that there's this annoying little glitch, but I know how to avoid it, and so I just do. And and so sometimes
120
00:10:13.165 --> 00:10:16.465
that's the downside of these sorts of projects versus a commercial enterprise.
121
00:10:16.925 --> 00:10:22.865
We understand the users better, but also we don't have as much time to fix bugs, and we don't spend
122
00:10:23.199 --> 00:10:25.300
hours and hours testing things.
123
00:10:25.680 --> 00:10:28.660
So that's I guess those are the those are the 2 main differences.
124
00:10:30.079 --> 00:10:43.330
In the documentation, you mentioned that the that your project is useful for the fields of psychophysics, cognitive neuroscience, and experimental psychology. And I'm wondering if you can provide some background into how those disciplines differ and,
125
00:10:43.710 --> 00:10:46.770
what constitutes an experiment for each of those fields respectively.
126
00:10:47.815 --> 00:10:48.535
Sure. Sure.
127
00:10:49.095 --> 00:10:49.595
So
128
00:10:49.975 --> 00:10:53.435
my own work is in vision science, and that's the psychophysics
129
00:10:54.214 --> 00:10:54.855
is this,
130
00:10:55.415 --> 00:10:57.760
this area of psychology where
131
00:10:58.140 --> 00:11:02.080
we treat the brain as basically it's like an engineering a physics project,
132
00:11:02.460 --> 00:11:13.615
and we we map its inputs and its outputs and and that sort of thing. It's a very dull area of psychology to many people, but that's what I do. And that's that's where PsychoPy has its origins was was presenting
133
00:11:14.170 --> 00:11:16.990
very precisely low level stimuli, visual
134
00:11:17.290 --> 00:11:18.510
things in my case.
135
00:11:18.890 --> 00:11:19.390
So
136
00:11:19.850 --> 00:11:33.850
measuring your ability to detect something that's barely visible, for instance, that sort of experiment. Then you've got lots of so cognitive psychology would have an experiment where, say, you would test someone's memory to a set of objects, and we'd measure
137
00:11:34.230 --> 00:11:36.330
what sort of things impair your memory
138
00:11:36.790 --> 00:11:39.770
and what things make you, I don't know, respond faster.
139
00:11:40.214 --> 00:11:40.714
So
140
00:11:42.055 --> 00:11:49.035
something and and linguistics blends into this as well. So something like the Stroop task is a task that's very,
141
00:11:49.830 --> 00:11:52.490
well known in this sort of field where you present
142
00:11:53.510 --> 00:11:54.730
the word red
143
00:11:55.270 --> 00:11:56.970
written in green text
144
00:11:58.024 --> 00:12:00.204
versus the word red written in red text.
145
00:12:00.665 --> 00:12:02.925
Sub subjects participants have to report
146
00:12:03.384 --> 00:12:04.764
the color of the letters,
147
00:12:05.390 --> 00:12:21.305
but they're slower to do that if the letters are spelling out the wrong word. Okay? So you're slower to respond that you've got red letters in front of you if the if the red letters say the word green. So that would be a sort of cognitive psychology or linguistics type of study.
148
00:12:21.685 --> 00:12:22.185
And,
149
00:12:22.780 --> 00:12:28.400
you know, again, it revolves around presenter stimulus, measure response, measure your reaction time to that stimulus.
150
00:12:29.180 --> 00:12:29.680
Neuroscience
151
00:12:30.464 --> 00:12:34.324
might be similar sorts of experiments, but now you're doing that in an MR scanner.
152
00:12:34.865 --> 00:12:36.805
So you're measuring the the fMRI,
153
00:12:37.860 --> 00:12:43.720
BOLD signal of of a participant while they see different stimuli. So there are various different sort of
154
00:12:44.635 --> 00:12:45.775
fields around,
155
00:12:46.315 --> 00:12:48.815
what what overall we'd call the behavioral sciences,
156
00:12:49.435 --> 00:12:53.375
and they all tend to link to the same sort of experiment
157
00:12:53.829 --> 00:13:05.935
where you present stimulus and you get a response. There's also social psychology where maybe you present images, and then you'd ask people to rate them, or you'd ask people's opinions in some sort of a way. And and, again, you can use
158
00:13:06.395 --> 00:13:07.055
the same
159
00:13:07.595 --> 00:13:08.095
software
160
00:13:08.395 --> 00:13:11.215
to to run all of those different sorts of studies.
161
00:13:12.399 --> 00:13:19.860
So do you find that your users who have no previous formal programming training come up to speed with PsychoPy quickly? And what are some of the challenges there?
162
00:13:20.825 --> 00:13:27.245
Yeah. For some of our users, that's that's a real challenge. For some, those in more neuroscience based areas,
163
00:13:28.000 --> 00:13:40.255
they are probably fairly used to programming because they'll need to do it for their analysis anyway, and they've been used to other things like MATLAB and and that sort of stuff. So so we've got a huge spread. People in psychology and people in linguistics
164
00:13:41.275 --> 00:13:44.415
are typically less likely to be programmers beforehand.
165
00:13:44.875 --> 00:13:45.375
And
166
00:13:45.860 --> 00:13:47.400
so we've got this quite broad
167
00:13:47.780 --> 00:13:52.200
church of people from from all different backgrounds, and that's where the graphical interface
168
00:13:52.820 --> 00:13:57.595
or the scripting interface really helps. So so if you prefer to code and have absolutely
169
00:13:58.135 --> 00:14:09.510
every every bit of control over every aspect of your experiment, then you should write your script yourself. Because the builder is gonna be trying to do things generally and can't implement every feature that you can write in code.
170
00:14:10.050 --> 00:14:18.605
But but then for those less technical users, they seem to be finding the builder interface very easy to use. And I think 1 of the nice things actually is that,
171
00:14:19.225 --> 00:14:20.204
along the way,
172
00:14:20.829 --> 00:14:28.769
they learn a little bit of the logic of programming as well. And and maybe they didn't intend to move, they didn't realize they're even doing that. But the builder
173
00:14:29.565 --> 00:14:33.264
is kind of set up. You know, it has objects and loops, and
174
00:14:33.565 --> 00:14:47.490
objects have parameters, and those can be repeated and and changed at various different times. You know, they're essentially learning the basics of programming, but they're doing it in a graphical interface rather than line by line of code. They're also as they start to make those experiments
175
00:14:48.415 --> 00:14:49.235
more advanced,
176
00:14:49.695 --> 00:14:58.750
they'll want to add in little snippets of code. And it might be the odd line or 2 that just, I don't know, makes the next stimulus depend on the previous response.
177
00:14:59.290 --> 00:15:00.910
And that's something that requires
178
00:15:01.690 --> 00:15:04.269
a line or 2 of Python code. So
179
00:15:04.665 --> 00:15:09.165
they're comfortable with adding a line or 2, and they don't consider that programming. There's nothing to
180
00:15:09.785 --> 00:15:14.820
be frightened off. But, you know, I think with a lot of people, if you tell them that they're going to learn programming,
181
00:15:15.280 --> 00:15:22.745
that's that's just too terrifying a task. Or if you tell them they're going to write a script, you know, it's it's too big a thing for them to imagine. Whereas if they
182
00:15:23.125 --> 00:15:29.330
start off just writing the odd line or 2 here and there and and learning to hack
a little bit, something that's already done,
183
00:15:29.950 --> 00:15:36.529
then they they get sort of eased in. I think we do both things. With the builder, we manage to support people
184
00:15:36.925 --> 00:15:40.545
who don't really program and who possibly never will. But also,
185
00:15:41.005 --> 00:15:45.920
we we sort of ease people in a little bit to to programming as well.
186
00:15:46.320 --> 00:15:48.500
I guess also, I mean, I now run
187
00:15:48.880 --> 00:15:54.725
quite a lot of workshops and and that sort of thing, and we spend a lot of time training people. I've taught people
188
00:15:55.025 --> 00:15:58.325
from right away from undergraduates, PhD students, and professors
189
00:15:58.705 --> 00:16:02.165
how to program in Python on to some level. And
190
00:16:02.750 --> 00:16:03.570
and I guess
191
00:16:04.190 --> 00:16:06.290
it comes back again to that thing that
192
00:16:06.750 --> 00:16:08.290
I'm not a hardcore
193
00:16:09.070 --> 00:16:11.250
computer science trained programmer.
194
00:16:11.595 --> 00:16:14.095
You know, my background, I did a degree in psychology.
195
00:16:14.555 --> 00:16:23.420
And and I can empathize a bit more with a novice programmer because I remember what it was like to be that. And and maybe it's a bit harder for a a more sophisticated
196
00:16:24.040 --> 00:16:32.865
programmer to be training people who who don't have that sort of a background. You know? They they can't imagine what it's like not to understand the difference between variable
197
00:16:33.404 --> 00:16:36.920
and a string and and and that sort of thing. So maybe
198
00:16:37.460 --> 00:16:39.080
it's my lack
199
00:16:39.620 --> 00:16:43.960
of computer science background that means we can we can do this a little bit better.
200
00:16:45.365 --> 00:16:53.465
That's great. I think it it it really speaks to 1 of Python's core strengths in that. It really seems like for whatever reason, whatever its attributes,
201
00:16:54.139 --> 00:16:55.440
the language really
202
00:16:55.820 --> 00:16:57.839
allows itself to be picked up
203
00:16:58.220 --> 00:17:02.079
comparatively easily, at least compared to other programming languages by folks
204
00:17:02.524 --> 00:17:08.145
whose, you know, primary occupation or or focus is not programming. So that's that's fantastic.
205
00:17:08.845 --> 00:17:12.649
My experience is that, you know, the very first the the starting point
206
00:17:12.950 --> 00:17:20.090
for quite a few users. It's easier when with an absolute beginner to teach them MATLAB for the first few
207
00:17:20.815 --> 00:17:21.315
hours,
208
00:17:21.855 --> 00:17:24.355
where they don't have to worry about
209
00:17:25.375 --> 00:17:35.310
things like was it an integer or a float. Right? They they it just does the right thing, and they don't have to think about different types. They don't have to import their libraries and that sort of thing.
210
00:17:35.635 --> 00:17:39.735
But very quickly, I think you're
right. That that after that first couple of hours,
211
00:17:40.115 --> 00:17:41.414
they get it. And then
212
00:17:42.035 --> 00:17:50.000
if you then try and show them about MATLAB, they get very frustrated that it can't do all of the things that they found so easy in Python. So,
213
00:17:50.300 --> 00:17:51.440
yeah, I I've
214
00:17:51.845 --> 00:17:53.705
I've had a great experience with
215
00:17:54.325 --> 00:17:55.304
teaching people
216
00:17:55.765 --> 00:17:56.265
Python.
217
00:17:56.645 --> 00:17:58.505
And if they've not learned a language before,
218
00:17:58.885 --> 00:18:01.625
they they get into Python usually fairly quickly.
219
00:18:02.789 --> 00:18:07.210
Yeah. And I think that your comment about having the ability to
220
00:18:07.590 --> 00:18:09.850
work against a known good
221
00:18:10.245 --> 00:18:32.675
piece of software and then just add some modifications here and there is definitely a great way to introduce people to some of the different concepts because they don't have to start off staring at a blank page and say, okay, well, where do I begin? Because it's already begun. They just need to continue it along, and then that will provide greater confidence when they do go back and have to start it with a blank slate.
222
00:18:33.160 --> 00:18:36.540
So the other thing that we do, all that this this within the application,
223
00:18:37.320 --> 00:18:41.900
as I say, I sort of provide this this code editor, you know, and it's not as
224
00:18:42.465 --> 00:18:42.965
sophisticated
225
00:18:43.504 --> 00:18:44.485
as, say,
226
00:18:44.865 --> 00:18:49.205
Spyder or, you know, lots of the other more professional dedicated editors.
227
00:18:50.070 --> 00:18:52.970
But it has a a menu that says demos.
228
00:18:53.429 --> 00:19:01.394
And it has a you know, they so users new to programming can look at the demos menu and and see a whole range of relatively small digestible
229
00:19:02.014 --> 00:19:04.674
demos that show 1 aspect of the software,
230
00:19:05.375 --> 00:19:09.290
in a in a unit. And there's a big green running man that says run. You know?
231
00:19:10.330 --> 00:19:10.830
So
232
00:19:11.530 --> 00:19:12.030
although
233
00:19:12.490 --> 00:19:14.750
a lot of users then will want to go on or
234
00:19:15.050 --> 00:19:18.350
or pre more experienced users from other programming language languages
235
00:19:18.735 --> 00:19:30.230
will want a more feature rich editor. To a new user, they get something that's very simple with a green running man, and it just works. That's that's the aim. So so it provides them again with a very simple
236
00:19:30.850 --> 00:19:43.485
inroad. And lots of other users, I'm sure, are just gonna use PsychoPy. Those sophisticated programmers will just use PsychoPy as a library, and they'll use their own Python installation and their own editors, and and and that's great too.
237
00:19:44.340 --> 00:19:49.000
Yeah. And I'm sure too that by having the demos, which are going
to tie into
238
00:19:49.460 --> 00:19:56.545
a discipline that they are familiar with, will make it easier for them to then understand what's actually happening in the Python code itself.
239
00:19:57.005 --> 00:20:01.505
Yeah. Yeah. So we've we've got a range of sort of from very small unitary
240
00:20:02.360 --> 00:20:06.700
things like how do I present a sound to sort of full fledged experiments.
241
00:20:07.480 --> 00:20:10.620
We've we've got quite a range of of levels there.
242
00:20:11.895 --> 00:20:18.075
And can you describe the internal architecture of PsychoPy and how you approach the design and how it's evolved over time?
243
00:20:19.560 --> 00:20:20.060
Yeah.
244
00:20:21.480 --> 00:20:24.780
So evolved over time is pretty much the key phrase there.
245
00:20:26.120 --> 00:20:35.245
Design is, there have been moments where we've really designed the architecture, but at the core, it's this library. That's that's the basic thing. So it's a library which has
246
00:20:35.705 --> 00:20:37.785
stimuli that might be visual or might be,
247
00:20:38.570 --> 00:20:44.990
there might be classes for handling your trials and saving your data and that sort of thing.
248
00:20:45.825 --> 00:20:49.845
The the key in terms of architecture, the key step was this
249
00:20:50.225 --> 00:20:56.139
development of the builder and and how that was going to work. So there was an abstraction layer
250
00:20:56.440 --> 00:21:04.139
that I started and that this was very much designed. So I started thinking about what are the key aspects of of an experiment,
251
00:21:05.275 --> 00:21:07.535
and how should that look in terms of
252
00:21:08.395 --> 00:21:10.095
a Python dictionary, essentially?
253
00:21:10.395 --> 00:21:17.330
And then how do we save that dictionary to a file, and how do we represent that dictionary visually? So what we've got is
254
00:21:17.870 --> 00:21:19.009
a an experiment
255
00:21:19.309 --> 00:21:22.605
can be built in terms of a number of components,
256
00:21:23.705 --> 00:21:30.045
like a text object or a keyboard or a image, and those get combined into routines.
257
00:21:30.760 --> 00:21:34.539
Those routines are basically just a list of components, but the component knows
258
00:21:34.840 --> 00:21:41.075
within that routine when it should start, when it should stop, and what its parameters are. Then we've got a sort of a flow
259
00:21:41.934 --> 00:21:45.554
that combines those routines in various different ways, and
260
00:21:46.500 --> 00:21:48.840
and that's essentially the whole thing. So
261
00:21:49.140 --> 00:21:52.279
so the flow is a list of routines
262
00:21:52.740 --> 00:22:03.165
that happen in a certain order, and that's all there is to it. It calls each routine and says, write your code. The routine then calls each of its components and says, write your code,
263
00:22:03.545 --> 00:22:06.420
and and then goes to the next routine
264
00:22:06.720 --> 00:22:08.500
in the flow list.
265
00:22:08.880 -->
00:22:14.740
So by having these units that are combined in various different ways, it turns out that you can
266
00:22:15.235 --> 00:22:17.095
make quite a rich structure
267
00:22:17.635 --> 00:22:23.975
of experiments. And you can have loops on the flow that cause something to repeat. And, of course, in terms of the Python code,
268
00:22:24.520 --> 00:22:25.340
that's just
269
00:22:25.640 --> 00:22:27.420
adding an indent level, essentially.
270
00:22:28.040 --> 00:22:28.540
And
271
00:22:28.920 --> 00:22:37.315
the end of the loop on your flow just de dense the code again, and we carry on to the next piece of code. So in terms of
272
00:22:37.615 --> 00:22:38.915
the graphical interface,
273
00:22:40.190 --> 00:22:46.210
writing the code, it was all relatively straightforward. There's this abstraction layer, which is a dictionary containing
274
00:22:46.669 --> 00:22:47.490
some lists.
275
00:22:48.110 --> 00:22:48.610
And
276
00:22:49.315 --> 00:22:59.429
that gets saved to a data file, and we we sort of created an an open standard not a data file. Sorry. We created an open standard sort of experiment file, which is an
277
00:22:59.809 --> 00:23:20.380
XML formatted file that essentially just stores these lists and dictionaries with their various parameter types. So that can be loaded into or potentially, I don't think anyone's written anything that has loaded these into other pieces of software. But that that's agnostic about what the software is that's using it. It could be loaded into another piece of software, and it literally just defines
278
00:23:21.235 --> 00:23:21.735
what
279
00:23:22.035 --> 00:23:24.934
sequences of stimuli and keyboard, etcetera,
280
00:23:25.235 --> 00:23:27.735
get used to create an experiment and how those
281
00:23:28.115 --> 00:23:28.615
iterate
282
00:23:28.995 --> 00:23:31.460
to create a full study. It's really a graphical interface
283
00:23:32.000 --> 00:23:35.140
that writes the code. So that that's that's the key part. Builder
284
00:23:35.840 --> 00:23:47.275
writes your script for you. And so and it literally writes a Python script. Going forwards, and we'll I think we'll come on to this later on. But going forwards, we're actually now having it output a JavaScript
285
00:23:48.054 --> 00:23:48.554
script
286
00:23:48.880 --> 00:23:49.540
instead. So
287
00:23:50.400 --> 00:24:00.664
we will be able to this this builder interface that defines your experiment doesn't need to care about what language the script is that it writes. It just has these chunks of code,
288
00:24:01.365 --> 00:24:04.904
and, those chunks of code be could be in any syntax you choose.
289
00:24:05.605 --> 00:24:09.170
So how easy is it to extend PsychoPy with new types of stimulus?
290
00:24:10.670 --> 00:24:13.410
Super easy. That's straightforward. Either in the library,
291
00:24:13.715 --> 00:24:20.535
you can add your own Python classes or subclass existing ones. That's all very straightforward.
292
00:24:20.980 --> 00:24:28.920
The rendering code is all pure OpenGL, so some people have, I don't know, done some transforms. For instance, they've got some particular
293
00:24:30.115 --> 00:24:30.615
unusual
294
00:24:31.154 --> 00:24:33.495
display, like a like a huge
295
00:24:34.034 --> 00:24:34.534
curved
296
00:24:35.154 --> 00:24:39.680
screen rather than a regular computer display. So they've had to
297
00:24:40.460 --> 00:24:51.414
subclass the window in order to add some alternative spatial transform to their window, for instance. So So all of those sorts of things are really easy to do. Or just adding a new stimulus, someone just recently contributed
298
00:24:51.794 --> 00:24:52.455
a new
299
00:24:52.835 --> 00:25:07.015
stimulus is essentially a visual button that people can click on within the regular Open GL screen. So all of those things can be added very easily in the library. But, also, in the builder, the builder is completely modular. You can add your own components,
300
00:25:07.555 --> 00:25:11.095
and all that a component needs is it needs to know what its
301
00:25:11.635 --> 00:25:23.715
pieces of code are that need to get executed at the beginning of the experiment, at the beginning of a trial, on every frame, at the end of a trial, etcetera. So it has 6 pieces of code. And if it knows what its
302
00:25:24.575 --> 00:25:26.035
initialization code is,
303
00:25:26.415 --> 00:25:29.235
then the builder will call that initialization
304
00:25:29.535 --> 00:25:32.150
code for each of the components in turn.
305
00:25:32.530 --> 00:25:34.950
And so all you've got to write for your new component
306
00:25:35.570 --> 00:25:38.550
is how how should my object be initialized,
307
00:25:39.215 --> 00:25:42.914
and and and you're done. So, yeah, it's it's really very extensible.
308
00:25:43.535 --> 00:25:46.115
And some people then go on and share those
309
00:25:46.500 --> 00:25:50.200
extensions that they've made with the rest of the community. I'm sure loads of other users
310
00:25:50.740 --> 00:25:52.760
are kind of shy to share their code,
311
00:25:53.140 --> 00:26:00.045
and they'll keep their component just in their own lab. And that's fine too. You know? So but it's being widely extended.
312
00:26:00.985 --> 00:26:05.860
That's great. So what are some interesting challenges you faced when implementing PsychoPy?
313
00:26:07.920 --> 00:26:25.520
The interesting intellectual challenge has been how do you create create this sort of abstraction of an experiment that isn't about lime so working out what that should look like in a way that's really general, and that would that would be easy enough that a 1st year undergraduate in psychology who's
314
00:26:25.900 --> 00:26:26.560
a technophobe
315
00:26:26.940 --> 00:26:29.360
can still create their study. But also
316
00:26:29.725 --> 00:26:31.345
that a professor in neuroscience
317
00:26:32.045 --> 00:26:33.025
is quite happy
318
00:26:33.325 --> 00:26:36.690
to use the software to
create their fancy experiment as well. So
319
00:26:37.250 --> 00:26:41.029
to to generate something that was sufficiently general that it could run
320
00:26:41.330 --> 00:26:46.765
a a real scientific study, but also sufficiently easy that a new user wasn't
321
00:26:47.385 --> 00:26:51.085
terrified. That that's been that's been the big interesting challenge,
322
00:26:51.625 --> 00:26:57.809
and and that's been a lot of fun trying to get those things right. The more frustrating challenges have been
323
00:26:58.190 --> 00:26:59.169
trying to support
324
00:27:00.285 --> 00:27:01.105
multiple platforms
325
00:27:01.885 --> 00:27:02.385
and
326
00:27:02.845 --> 00:27:07.185
trying to keep a track of all. So we have lots of dependencies. You know, I didn't want to write
327
00:27:07.649 --> 00:27:08.149
my
328
00:27:08.450 --> 00:27:09.830
own library for loading
329
00:27:10.210 --> 00:27:11.750
videos and and
330
00:27:12.529 --> 00:27:13.669
another 1 for
331
00:27:14.049 --> 00:27:20.355
presenting this, I don't know, other other sound stimulus or or something like that. So we we used a lot of other dependencies,
332
00:27:20.975 --> 00:27:25.770
and those keep changing. And that's that's quite frustrating that I spent a lot of time.
333
00:27:26.150 --> 00:27:30.570
Just each time that we provide the new distribution, the new large application,
334
00:27:31.645 --> 00:27:37.025
I have to go and dig through what's changed. And I don't know if pandas has changed its input,
335
00:27:37.805 --> 00:28:12.945
call or something like that, and then and something else has changed. It's, it's become 64 bit only or something. And so maintaining those has been quite hard, and I'm afraid we do have releases where we push out the package and and then someone comes in and says, oh, but the library has changed or there's some 1 of my dependencies has disappeared out of the package, and it's because I've had to rebuild everything from scratch at some point. That's been the hardest part and the most frustrating part as a as a developer, keeping on top of many different platforms, trying to test on all of the different platforms. So we do have a test suite, but a test suite
336
00:28:13.405 --> 00:28:17.040
only really works for the library. It's not very good for an application because
337
00:28:19.020 --> 00:28:19.520
testing
338
00:28:20.300 --> 00:28:22.240
the sequence of button clicks
339
00:28:22.540 --> 00:28:23.360
is is
340
00:28:23.980 --> 00:28:26.115
on on arbitrary display
341
00:28:26.575 --> 00:28:30.755
shapes is is a really hard thing to do. So a lot of the application
342
00:28:31.135 --> 00:28:31.615
side,
343
00:28:32.015 --> 00:28:40.650
isn't tested in the test suite. And and that means that, I'm afraid, sometimes we release things where I haven't gone and pressed all of the buttons
344
00:28:41.030 --> 00:28:41.530
on
345
00:28:42.154 --> 00:28:46.895
Linux and on Windows 7 and on Windows 10 and on Windows 10
346
00:28:47.274 --> 00:28:57.270
64 bit. You know what I mean? So sometimes we break things that way because I haven't been able to test all those things. That's that's quite frustrating for me and for the users.
347
00:28:58.130 --> 00:28:58.630
But
348
00:28:59.274 --> 00:29:03.855
but on the whole, I think I think the program the ship is gradually moving forwards, not backwards.
349
00:29:04.634 --> 00:29:11.150
That's great. I should point out that, I sometimes talk about I, but the other users and the other contributors
350
00:29:11.850 --> 00:29:15.230
are huge in this aspect. And and a lot of people
351
00:29:15.884 --> 00:29:18.304
will submit quick fixes. You know, they will
352
00:29:18.605 --> 00:29:30.220
users will notice that something's not working. And rather than saying it's broken, they will come back and say, hey. I've discovered that this doesn't work anymore, and I've I've dug around, and it's because
353
00:29:30.760 --> 00:29:32.940
pandas now needs this new argument.
354
00:29:33.405 --> 00:29:38.145
So here's the here's the change on GitHub, and and I can just do a pull
355
00:29:38.765 --> 00:29:54.495
from from their pull request on on GitHub. And and that has GitHub has made my life so much easier in terms of that sort of thing. And it means with it's really genuinely a community, so I I should stop using I altogether. It was I for about 7 years. And and now when you look at the contributions,
356
00:29:55.434 --> 00:30:10.794
some of the releases don't have any contributions from me at all. I just merely put it all together and and release it. So so, yeah, the community has grown really strong around it. Well, that that's a testament to your hard work on the project that made it a success that made people want to contribute. So
357
00:30:11.095 --> 00:30:13.115
1 thing real quick, you mentioned previously
358
00:30:13.450 --> 00:30:16.510
that in future releases, PsychoPy may emit JavaScript.
359
00:30:16.970 --> 00:30:25.375
Is that at least in part an attempt to deal with some of these difficulties into integrating third party multimedia libraries?
360
00:30:26.154 --> 00:30:28.095
That wasn't the aim of that,
361
00:30:28.400 --> 00:30:32.420
but it has crossed my mind that increasingly some of the problems,
362
00:30:32.880 --> 00:30:46.169
yeah, will get solved. And and so running a study online in a browser was something that people have been asking for that as a feature for a very long time, and I've always just written back and said, no. PsychoPy is about hardware accelerated
363
00:30:47.510 --> 00:30:52.410
graphics, and and it needs that in order that an interpreted language can do things
364
00:30:53.085 --> 00:31:03.100
in real time. And so timing precision is really important to us. We need to know, and most pieces of software wouldn't know, exactly when did your screen refresh, for instance.
365
00:31:03.400 --> 00:31:04.620
And we want to know,
366
00:31:04.920 --> 00:31:07.179
did I manage to get my stimulus drawn
367
00:31:07.880 --> 00:31:17.085
before the screen refresh occurred? Because if not, then our timing went wrong. So I basically always push back on these users that were requesting
368
00:31:17.545 --> 00:31:30.275
a web interface because I was just like, no. The the browser can't do that. It doesn't have the the graphics hardware, pardon me, to be able to perform at that level with that level of precision. So So I always just said no. And then relatively recently,
369
00:31:30.895 --> 00:31:40.370
WebGL has has changed all of that, and even Canvas to some extent in the HTML 5. Canvas code has has changed a lot of that, and you can actually now with WebGL,
370
00:31:40.670 --> 00:31:43.170
you can use Open GL shader language
371
00:31:43.725 --> 00:31:48.545
in a browser. It's it's it's crazy what you can do. And suddenly, all of that sort of
372
00:31:49.485 --> 00:31:49.985
performance
373
00:31:50.285 --> 00:31:53.769
issue that I thought we would have is disappearing. And
374
00:31:54.070 --> 00:32:00.809
the performance will probably never be quite so good in terms of how quickly you can get responses, and we'll never be able to connect to hardware
375
00:32:01.825 --> 00:32:05.845
like parallel ports and that sort of thing from a browser. But for an awful lot of studies,
376
00:32:06.305 --> 00:32:08.005
suddenly, the web actually
377
00:32:08.305 --> 00:32:09.285
has the performance
378
00:32:10.000 --> 00:32:15.140
that we might be looking for. So that it was that change that was really driving this this
379
00:32:15.920 --> 00:32:17.860
potential of creating JavaScript.
380
00:32:18.455 --> 00:32:28.340
But as a side issue, I've I've then started looking at the way that those things are done and and, particularly a library called pixie. Js that that I've been,
381
00:32:28.880 --> 00:32:33.620
looking into a lot lately. And, wow, it makes it makes all of that media stuff really easy.
382
00:32:34.240 --> 00:32:37.795
And and a lot of the things that have sometimes caused me a lot of pain
383
00:32:38.255 --> 00:32:42.915
might get a lot easier. But it will require quite a lot of testing as well. You know, when you ask a sound
384
00:32:43.215 --> 00:32:44.915
to be played in your browser,
385
00:32:45.250 --> 00:32:48.070
how long does it actually take for noise to come out of the speakers?
386
00:32:49.170 --> 00:32:55.125
That will take a lot of testing for us to know exactly how good it is. And and it it may be that the performance
387
00:32:55.825 --> 00:32:57.205
is still not that great,
388
00:32:57.825 --> 00:33:00.005
and we'll have to look into that a lot.
389
00:33:00.705 --> 00:33:03.960
And I imagine that by being able to target the browsers
390
00:33:04.340 --> 00:33:05.240
using the
391
00:33:05.700 --> 00:33:07.560
same builder interface,
392
00:33:08.180 --> 00:33:11.024
would potentially drastically increase the size
393
00:33:11.325 --> 00:33:23.110
of experiments that can be conducted because of the fact that you can just publish them to a website and have people interact with the experiment without necessarily having to be in a lab environment. Exactly. Yeah. It's a it's a game changer for 2 reasons, actually. 1 is because
394
00:33:26.745 --> 00:33:28.125
you can send an email around
395
00:33:28.505 --> 00:33:30.125
and get people to participate
396
00:33:30.505 --> 00:33:43.490
that you've never met, that you didn't have to bring into a lab and individually get them to sign off the forms and sit them down and explain the you know, you just send them an email. And so technologies like Mechanical Turk have been quite big recently
397
00:33:43.870 --> 00:33:45.250
in getting people
398
00:33:46.355 --> 00:33:54.695
to essentially be enrolled in a study and paid by Amazon via Mechanical Turk to be a participant in a study. And some of these studies are having
399
00:33:55.160 --> 00:33:56.860
tens of thousands of participants.
400
00:33:57.240 --> 00:34:07.325
Whereas if you're going to run those participants yourself in your lab, you'd have maybe a 100 if you've got enough time. So, yeah, it's it's a game changer from that perspective. But, also,
401
00:34:07.705 --> 00:34:14.150
it means that you can if we're running a study in a web browser, we can run a study on any device. Right now, PsychoPy
402
00:34:14.450 --> 00:34:16.630
needs something that will support
403
00:34:17.089 --> 00:34:21.270
Python and Piglet and OpenGL and all of those dependent libraries.
404
00:34:21.615 --> 00:34:24.974
And that means it won't run on an iPad, and it won't run on
405
00:34:25.615 --> 00:34:27.954
well, it will run on a tablet if you
406
00:34:28.414 --> 00:34:32.619
want to go and install Linux on your tablet or Windows, I guess, or Windows Surface.
407
00:34:32.920 --> 00:34:33.420
So
408
00:34:34.200 --> 00:34:37.020
suddenly, move it to a browser, move it to a website,
409
00:34:37.695 --> 00:34:47.570
and your existing experiment that you created in Builder can now be compiled to a website, but it can be run on any device, whether it's a phone, whether it's Android, whether it's iOS.
410
00:34:47.950 --> 00:34:53.490
All it needs is something that supports JavaScript and a web browser. So, yeah, it's a it's a game changer
411
00:34:53.835 --> 00:34:57.135
in many ways, and and it'll be very exciting to see
412
00:34:57.435 --> 00:34:59.295
how that how that pans out.
413
00:35:00.555 --> 00:35:05.420
Yeah. And I think another thing worth mentioning too is that by having that greater reach and,
414
00:35:05.819 --> 00:35:10.960
potentially much larger audience, I imagine it's easier to prove statistical significance
415
00:35:11.405 --> 00:35:14.705
and by the fact that you do have such a larger corpus of data to work with.
416
00:35:15.565 --> 00:35:17.345
You can dig around and find things
417
00:35:17.885 --> 00:35:24.930
more with with very large numbers. I'm a little bit concerned actually to some extent on that score because you could also find yourself,
418
00:35:25.710 --> 00:35:27.970
reporting a lot of noise, you know, or
419
00:35:28.270 --> 00:35:29.410
tiny, tiny effects,
420
00:35:30.350 --> 00:35:44.380
that wouldn't have been significant when you look at a few hundred people are significant in in tens of thousands of people. But, actually, if it's that small that you needed tens of thousands of people to measure it, maybe it's not big enough that we should be carrying. That's that's a that's a personal query.
421
00:35:44.839 --> 00:35:46.859
Yes. That's a scientific issue.
422
00:35:47.905 --> 00:35:57.670
In looking through the documentation, I noticed that you support a number of different formats for the output data, including pickle. I'm wondering what are some of the most popular analysis tools for users of PsychoPy.
423
00:35:58.850 --> 00:36:01.990
Yeah. Sure. So pickle file is
424
00:36:02.690 --> 00:36:04.870
something that we save as a sort of
425
00:36:05.545 --> 00:36:11.964
safety net, and it it contains an awful lot of it of information. So it contains a copy of your experiment,
426
00:36:12.984 --> 00:36:45.055
which pickle is sort of, a very it's literally a copy of the study that you ran as the data were were collected, and it's and it's the Python object just pickled. So that's a pretty useful thing that that can, for instance, be used later on to save out some of the other formats as well later on. So if you accidentally ruined your CSV file, which I think is what most people would use for their analysis, you can go back to the pickle file, recreate the CSV file from it because it's just a copy of your experiment. Or if you forgot 1 of the parameters
427
00:36:45.515 --> 00:36:57.585
of your study and you accidentally didn't save it in the in the CSV file, then you can go back and and dig out what the actual parameter was from the script that has been saved within your pickle. So that's a sort of a belt and braces
428
00:36:58.125 --> 00:37:03.025
kind of a data format that I suspect most people aren't using for for real analysis.
429
00:37:03.450 --> 00:37:06.990
Although you you can load up that pickle file, and you can
430
00:37:07.610 --> 00:37:08.350
use NumPy
431
00:37:08.650 --> 00:37:14.375
or pandas to go and analyze. I mean, the the data were then saved in NumPy arrays within that file.
432
00:37:14.835 --> 00:37:20.290
And and so you you could certainly use that that way if you like. We also output a CSV file,
433
00:37:20.910 --> 00:37:26.609
so a comp comma separated value file that most people would use. It's a trial by trial,
434
00:37:27.015 --> 00:37:27.755
what happened.
435
00:37:28.055 --> 00:37:29.115
But you have to
436
00:37:29.815 --> 00:37:36.395
tell the CSV file, or you have to tell PsychoPy what to put into the CSV file. So what what variables
437
00:37:37.320 --> 00:37:44.700
are of interest to you, and it's going to load those as headers in the file. So a builder will try and do that for you
438
00:37:45.465 --> 00:37:53.085
automatically, but but maybe there's something that you wanted to study within your experiment that you need to tell Builder that it needs to do manually.
439
00:37:53.600 --> 00:37:55.860
So, occasionally, people will get that wrong,
440
00:37:56.400 --> 00:38:03.895
and then that's where the log file comes in. So so that we also output a log file, which is just an automated
441
00:38:04.355 --> 00:38:04.855
stream
442
00:38:05.475 --> 00:38:05.975
of
443
00:38:06.515 --> 00:38:13.390
events happening in your study as it occurs. So I've just changed the stimulus to this. I've just done that. We've just started a new trial.
444
00:38:13.850 --> 00:38:15.470
Subject has just pressed this button.
445
00:38:16.250 --> 00:38:18.750
Now that's not always easy to analyze
446
00:38:19.805 --> 00:38:22.065
because it's a stream of way too much information.
447
00:38:22.365 --> 00:38:26.945
Just in chronological order, and it doesn't it doesn't know the semantics of your study. It's just,
448
00:38:27.430 --> 00:38:32.010
a chronological stream. But that's very useful if you've forgotten to do something
449
00:38:32.390 --> 00:38:34.730
that you can go back and check all of the details,
450
00:38:35.194 --> 00:38:52.215
and you could write a script that passed this nasty log file and and, you know, dug out the data that were critical to you, in most cases. So so we've got various there's also an Excel file, which which we basically don't recommend anyone use. You can save your data in an Excel file if you so desire.
451
00:38:52.755 --> 00:38:58.775
In terms of the what people are using for analysis, I guess a lot of our users would be in psychology, and they would be using SPSS.
452
00:38:59.560 --> 00:39:03.260
We would naturally try to encourage people to use either Python or R.
453
00:39:03.640 --> 00:39:05.740
So they might load their data in pandas,
454
00:39:06.535 --> 00:39:09.915
or they might load their data as a as a table in R.
455
00:39:10.455 --> 00:39:12.635
And and the CSV file is designed
456
00:39:13.255 --> 00:39:14.795
so that either of those packages
457
00:39:15.300 --> 00:39:23.460
would would allow you to to load your data in a very easy step and start doing start doing analysis on that. So so that's what I would,
458
00:39:24.020 --> 00:39:24.520
naturally
459
00:39:25.204 --> 00:39:30.984
imagine most people to do. Again, I used to do my analysis on the PQL file using NumPy arrays because
460
00:39:31.285 --> 00:39:32.825
CircaPy predates pandas.
461
00:39:33.260 --> 00:39:33.760
And
462
00:39:34.060 --> 00:39:37.500
so pandas was a was a new thing to me that I,
463
00:39:37.980 --> 00:39:39.920
I subsequently learned is really useful.
464
00:39:40.505 --> 00:39:45.725
Yeah. Pandas is a somewhat recent entry on the scene, though it seems to have gained a lot of,
465
00:39:46.345 --> 00:39:51.790
following because of the fact that it's fairly easy to use and 2 dimensional arrays are a fairly
466
00:39:52.250 --> 00:40:09.770
large portion of the problem space that people were using NumPy for. And it adds a lot of niceties on top of that in terms of the data frame format. And I was gonna ask if you've looked into the use of the feather library for being able to add that interoperability between Python and R for people who want to do their analysis
467
00:40:10.230 --> 00:40:11.210
in in R?
468
00:40:12.069 --> 00:40:14.329
I haven't, actually. I don't I haven't
469
00:40:14.685 --> 00:40:16.385
personally worked with the Feather Library
470
00:40:16.845 --> 00:40:22.305
at all. I haven't really used R myself. I'm I'm still using Python
471
00:40:22.829 --> 00:40:26.210
because I've now got all of my scripts that will do various
472
00:40:26.589 --> 00:40:29.809
scientific analyses, like bootstrapping or whatever and simulations
473
00:40:30.535 --> 00:40:31.275
in Python.
474
00:40:31.575 --> 00:40:34.795
I've never had the need then to go and learn R. So
475
00:40:35.255 --> 00:40:36.635
but it's something that
476
00:40:37.175 --> 00:40:38.715
a number of our other users
477
00:40:39.210 --> 00:40:46.190
are certainly using R a great deal, and and I suspect they will be digging around in Feather as well, but but I haven't got that far yet myself.
478
00:40:47.055 --> 00:40:59.589
And how is data input typically managed? I'm wondering if PsychoPy supports automated readings from test equipment or if it's something that's the responsibility of the people conducting the experiment to control the data input.
479
00:41:00.290 --> 00:41:02.470
Yeah. No. Typically, it comes from
480
00:41:03.175 --> 00:41:03.995
the experimenter
481
00:41:04.615 --> 00:41:07.515
writing the code to handle controls or whatever.
482
00:41:07.895 --> 00:41:09.435
A lot of it obviously is very
483
00:41:10.220 --> 00:41:10.720
straightforward.
484
00:41:11.100 --> 00:41:14.240
I mean, most of most of the inputs are coming from things like,
485
00:41:14.780 --> 00:41:17.520
keyboards and and microphones and and
486
00:41:18.055 --> 00:41:20.075
mice. So that's that's all
487
00:41:20.775 --> 00:41:21.515
easy enough.
488
00:41:22.215 --> 00:41:24.875
They might if if you've got some hardware like,
489
00:41:25.180 --> 00:41:28.400
I mentioned MRI before. So if you're doing an fMRI study,
490
00:41:28.940 --> 00:41:29.440
then
491
00:41:29.900 --> 00:41:34.079
you need to monitor probably the trigger pulses that the
492
00:41:35.025 --> 00:41:39.765
device is sending out. So a scanner will will send out a pulse every, say, 2 seconds
493
00:41:40.145 --> 00:41:41.445
to announce that it's
494
00:41:41.760 --> 00:41:45.620
just about to start creating a new image of the brain. And
495
00:41:46.080 --> 00:41:51.380
so you need to detect when those things occur. But those are relatively straightforward things. They're either
496
00:41:51.715 --> 00:41:55.015
a serial input or a parallel port import or
497
00:41:55.555 --> 00:41:58.215
a a keyboard sometimes that they'll they'll simulate
498
00:41:58.730 --> 00:41:59.950
pressing a key.
499
00:42:00.250 --> 00:42:00.750
So
500
00:42:01.290 --> 00:42:02.830
those are all relatively straightforward,
501
00:42:03.450 --> 00:42:06.910
and it does come down to the user writing writing their code
502
00:42:07.475 --> 00:42:09.335
to to interface with them.
503
00:42:09.875 --> 00:42:17.799
Depending on what sort of hardware, we might have them built in, and and for some, you might need to add your own. So eye tracking is another good example where
504
00:42:18.339 --> 00:42:23.160
we've got support for, I don't know, 6 or 7 different eye trackers.
505
00:42:24.019 --> 00:42:24.519
And
506
00:42:25.765 --> 00:42:30.825
if if you're using 1 of those, then you can plug into a sort of a unified API
507
00:42:31.445 --> 00:42:47.455
and, say, on each on each frame or on each trial, find out what the position of the eyes was at this point using 1 set of function calls. So we've got built in support for quite a few. But if you've got your own eye tracker that's different to 1 of those, then you might need to use your own custom Python code.
508
00:42:48.075 --> 00:42:50.015
Hopefully, your your hardware
509
00:42:50.315 --> 00:42:53.375
supplier will will support Python as well. So
510
00:42:53.730 --> 00:42:56.950
it it depends on what particular devices you're using.
511
00:42:59.330 --> 00:43:06.845
And I imagine that because of the fact that timing is of such critical importance in these experiments that it is certainly necessary
512
00:43:07.145 --> 00:43:10.525
to make sure that those data inputs are being fed through the PsychoPy
513
00:43:11.260 --> 00:43:15.200
program so that you can correlate the input times with the stimulus times?
514
00:43:15.660 --> 00:43:17.760
Yeah. So we've got
515
00:43:18.665 --> 00:43:19.165
essentially
516
00:43:20.265 --> 00:43:21.005
2 different
517
00:43:21.545 --> 00:43:25.565
ways of doing this, and and and 1 1 is just using the traditional
518
00:43:26.025 --> 00:43:26.525
Piglet
519
00:43:27.150 --> 00:43:30.450
sort of, which is the the graphical library that we use.
520
00:43:31.069 --> 00:43:41.434
It's like pygame for those who don't know. So we might be just, say, recording key presses using that, which is really easy to do, but isn't actually super precise. So so, typically,
521
00:43:41.734 --> 00:43:44.395
you'd be updating your stimulus on every frame,
522
00:43:45.010 --> 00:43:53.910
and that means you're tied to a refresh rate of, say, 60 hertz. So if you're checking the keyboard once per frame in in part of that
523
00:43:54.815 --> 00:43:56.675
flow of code, then,
524
00:43:57.055 --> 00:43:59.875
of course, you're only checking the keyboard every 16 milliseconds.
525
00:44:00.975 --> 00:44:01.475
And
526
00:44:02.210 --> 00:44:15.214
so there's there's an alternative system that we have, which is which is a a library called IO Hub, which is now really very much integrated in PsychoPy. It's it's really a part of PsychoPy. And that was
written by a contributor
527
00:44:15.515 --> 00:44:18.015
who comes from the eye tracking world, Sol Simpson.
528
00:44:18.395 --> 00:44:18.895
And
529
00:44:19.329 --> 00:44:22.390
he has written that to essentially be monitoring
530
00:44:22.690 --> 00:44:24.549
hardware in a separate process
531
00:44:25.010 --> 00:44:27.510
and passing g events back to
532
00:44:27.890 --> 00:44:28.710
the Python.
533
00:44:29.715 --> 00:44:33.895
Well, it is a Python process as well, but it's it's passing events
534
00:44:34.355 --> 00:44:35.495
back to the PsychoPy
535
00:44:36.275 --> 00:44:37.095
main process.
536
00:44:37.650 --> 00:44:39.270
And this avoids the the,
537
00:44:39.730 --> 00:44:46.310
global interpreter lock and allows you to to run your hardware acquisition, your data acquisition,
538
00:44:46.965 --> 00:44:48.505
and and outputs at times
539
00:44:49.285 --> 00:44:50.985
on a separate process, on a separate,
540
00:44:52.085 --> 00:44:59.370
core if you assuming that you've got a multi core machine. Now that has methods for synchronizing in both directions. Either
541
00:45:00.070 --> 00:45:09.645
either it can save its own data file, so it it also supports a a data format of its own based on HDF 5. And so it can stream data
542
00:45:10.105 --> 00:45:15.640
at a kilohertz, say, which is what some eye trackers will be using. It'll stream data at a kilohertz
543
00:45:16.099 --> 00:45:21.640
down to an HDF 5 file, but also you can pull it from the main PsychoPy process
544
00:45:22.005 --> 00:45:24.985
to get some snapshot of what's going on, for instance.
545
00:45:25.365 --> 00:45:25.865
So
546
00:45:26.165 --> 00:45:28.745
we have ways of of doing that. But using IOhub,
547
00:45:29.720 --> 00:45:31.820
you know, it's a lot more intensive,
548
00:45:32.760 --> 00:45:38.380
in terms of the the user has to work a little bit harder to to get that all working. It's it's
549
00:45:38.785 --> 00:45:39.525
more complicated.
550
00:45:39.825 --> 00:45:41.365
It's running a separate process
551
00:45:41.665 --> 00:45:44.245
and sending events backwards and forwards. So
552
00:45:44.625 --> 00:45:50.710
for simple studies, I think people still tend to use the the the basic get keys kind of calls,
553
00:45:51.250 --> 00:45:53.750
even though those aren't quite as,
554
00:45:54.130 --> 00:45:56.950
temporarily precise as as using IOhub.
555
00:45:58.244 --> 00:46:00.025
It, it strikes me that
556
00:46:00.405 --> 00:46:07.840
this kind of framework with all this eye tracking and millisecond scale input and rich visual display capabilities
557
00:46:08.460 --> 00:46:15.760
could also be really useful outside the field of psychology for things like UX researchers or things like that to
558
00:46:16.285 --> 00:46:19.345
test new input paradigms and the like?
559
00:46:20.444 --> 00:46:22.625
Yeah. I don't have statistics
560
00:46:23.005 --> 00:46:28.980
on where this is being used outside psychology, which I'd really like to know about, actually. Anyone who's
561
00:46:29.280 --> 00:46:30.180
using PsychoPy
562
00:46:30.720 --> 00:46:32.100
not in the world of academia,
563
00:46:32.565 --> 00:46:37.065
I'd really like to hear from you how you're using it because I it helps me to persuade
564
00:46:37.925 --> 00:46:39.385
people that this is a,
565
00:46:39.845 --> 00:46:41.945
a useful endeavor outside academia.
566
00:46:42.550 --> 00:46:46.250
Certainly, some people are using it in other things like in in clinical research
567
00:46:46.630 --> 00:46:47.130
and,
568
00:46:47.910 --> 00:46:48.970
in in developing
569
00:46:49.975 --> 00:46:52.555
hardware, I believe. But but my
570
00:46:53.335 --> 00:46:54.475
I get to track
571
00:46:54.775 --> 00:46:56.475
how many people are using PsychoPy,
572
00:46:57.080 --> 00:47:10.695
but not in what way. So so I I just don't have very much information about that. Certainly, I've been amazed at the variety of experiments and the variety of ways that people have have used it. I had in mind a very limited
573
00:47:10.995 --> 00:47:16.760
set of use, particularly for the builder. And people have gone way beyond what I ever imagined
574
00:47:17.220 --> 00:47:19.079
and creating quite elaborate studies
575
00:47:19.540 --> 00:47:21.960
that, I hadn't really pictured being done.
576
00:47:22.295 --> 00:47:26.955
What are some of the most interesting experiments that you're aware of having been conducted using cycle pi?
577
00:47:27.735 --> 00:47:30.075
Oh, goodness. That's that's a really hard question.
578
00:47:30.440 --> 00:47:41.895
Thousands of studies have been run, but I don't follow what they all are. So so that's a it's a very hard question to answer. 1 of the demos that we actually supply that I think is really fun is called the balloon analog risk task,
579
00:47:42.515 --> 00:47:45.975
and that's a a way of measuring your risk taking behavior
580
00:47:47.109 --> 00:47:52.010
by allowing you to blow up a a virtual visual balloon, and
581
00:47:52.550 --> 00:47:57.215
it will pop at some point. And the question is, how far do you keep on blowing it
582
00:47:57.515 --> 00:48:05.600
before it pops? You get more score the bigger the balloon gets. But if it pops, you get nothing. And so it's a way of measuring your risk taking
583
00:48:05.900 --> 00:48:06.880
by investigating
584
00:48:07.660 --> 00:48:16.464
how far you blow up this balloon. So that's actually just 1 of the demos in PsychoPy, and that's actually actually kind of, a neat way of showing the level of flexibility
585
00:48:16.765 --> 00:48:23.180
that that we have and the you know, it's an interactive study. It's not a traditional sort of I present a stimulus, I collect a response.
586
00:48:23.480 --> 00:48:30.059
You're you're growing this balloon. So that sort of demos a little bit the the range of things that can be done and and
587
00:48:30.455 --> 00:48:32.635
maybe 1 of the more interesting types of studies.
588
00:48:32.935 --> 00:48:42.309
There are also
things like the implicit association test or IAT. So PsychoPy is used a fair bit for that in in various different labs, which is
589
00:48:42.770 --> 00:48:44.549
a sort of test where you
590
00:48:45.010 --> 00:48:46.130
you're trying to understand
591
00:48:46.995 --> 00:48:48.195
someone has a,
592
00:48:48.515 --> 00:49:00.290
an overt opinion of a particular stimulus. They say that they like this thing or they dislike this thing, and you're trying to work out if that's true. So you can present images of various different stimuli, and you ask people to respond
593
00:49:00.830 --> 00:49:03.650
about likes and dislikes. And you measure essentially
594
00:49:04.215 --> 00:49:16.309
if you know that they're wanting to respond that they like this thing that what that they actually don't. You can measure the reaction time to their response in a in a speeded task, in a in a rapid stream of stimuli.
595
00:49:16.849 --> 00:49:34.960
When you're intending to respond 1 way, but actually you feel something different, then it delays your response. So that would be an implicit association test, and that's sort of 1 of the myriad things that PsychoPy is using. But, you know, it's it's being it's being used in so many different brain scanning
596
00:49:35.625 --> 00:49:38.765
studies or brain computer interface studies as well.
597
00:49:39.145 --> 00:49:40.125
So so people
598
00:49:40.825 --> 00:49:41.724
that are using
599
00:49:43.270 --> 00:49:49.050
while measuring EEG, so electrical signals on the scalp and trying to control the stimulus
600
00:49:49.785 --> 00:49:52.684
by using the electrical stimulus by using the electrical
601
00:49:53.224 --> 00:49:57.700
activity on the scalp. So that's called a brain computer interface and or BCI.
602
00:49:58.160 --> 00:49:59.700
Some people are certainly using Sakupai
603
00:50:00.000 --> 00:50:07.125
for that sort of thing as well because it can present stimuli very rapidly based on inputs. So there there are quite a range of different things.
604
00:50:08.145 --> 00:50:24.135
While I was reading through the docs, I found the page describing the integration with the open science framework for sharing and validating an experiment and collected data with other members of the field. I'm wondering if you can explain why that's beneficial to the researchers and compare it with other options such as GitHub for use within the sciences?
605
00:50:25.395 --> 00:50:26.615
Sure. So
606
00:50:26.915 --> 00:50:28.995
this is a new development for us,
607
00:50:29.555 --> 00:50:30.775
and it's an interesting,
608
00:50:31.880 --> 00:50:32.619
an interesting
609
00:50:33.000 --> 00:50:36.380
new direction. The idea is that when I run my study,
610
00:50:36.760 --> 00:50:44.665
a, I want to share it with my collaborators in other departments, say, b, I want to share it with other computers in my lab.
611
00:50:44.965 --> 00:50:45.465
And
612
00:50:46.005 --> 00:50:48.025
and, c, afterwards, I
613
00:50:48.559 --> 00:50:50.819
potentially want to share that with the rest of the world
614
00:50:51.119 --> 00:51:01.915
in a convenient way that other people can go and download my data. Now the question about whether so open science framework allows those sorts of facilities. It allows you to store data
615
00:51:02.375 --> 00:51:05.175
that either can be private to you and and
616
00:51:05.910 --> 00:51:07.290
but also can be
617
00:51:07.829 --> 00:51:11.530
exposed to the rest of the world if you want to share it and make it public. Now
618
00:51:12.069 --> 00:51:14.635
that I didn't find their interface
619
00:51:15.015 --> 00:51:21.035
all that intuitive, although that's what it has over GitHub. So the idea is that for a lot of scientists,
620
00:51:21.335 --> 00:51:23.115
GitHub is really written for coders,
621
00:51:23.560 --> 00:51:24.780
and they don't
622
00:51:25.080 --> 00:51:27.340
they don't know what Git is. So
623
00:51:27.800 --> 00:51:31.020
the idea for them of going getting a GitHub account
624
00:51:31.445 --> 00:51:32.905
and uploading something
625
00:51:33.205 --> 00:51:33.705
using
626
00:51:34.085 --> 00:51:44.550
a terminal tool, although I guess now there are graphical interfaces for that as well, that that would put off quite a few scientists that are less technically competent. So open science framework is sort of a way in
627
00:51:44.930 --> 00:51:47.510
particularly, it's come from from the field of psychology
628
00:51:48.130 --> 00:51:49.750
to allow people to
629
00:51:50.395 --> 00:51:50.895
upload,
630
00:51:51.275 --> 00:51:52.015
make public,
631
00:51:52.555 --> 00:51:53.535
share with collaborators
632
00:51:54.395 --> 00:51:56.335
their their experiments and their data.
633
00:51:57.250 --> 00:52:00.950
Now I say, I didn't actually find their their user interface
634
00:52:02.210 --> 00:52:03.270
super easy
635
00:52:03.650 --> 00:52:07.275
to to for a new big a new user. So
636
00:52:07.575 --> 00:52:09.035
they actually had provided
637
00:52:09.575 --> 00:52:13.674
some funding for us from the Center For Open Science, who wrote open science framework,
638
00:52:13.974 --> 00:52:15.674
to allow us to synchronize
639
00:52:16.260 --> 00:52:17.080
files directly
640
00:52:17.620 --> 00:52:18.680
from within PsychoPy.
641
00:52:19.300 --> 00:52:20.440
And so
642
00:52:20.820 --> 00:52:26.035
you can now go to the projects menu as as of the new version that was just released, yesterday,
643
00:52:26.494 --> 00:52:26.994
1.841.
644
00:52:27.615 --> 00:52:29.714
You can go to the projects menu.
645
00:52:30.174 --> 00:52:30.914
You can
646
00:52:31.220 --> 00:52:33.480
take a folder from your local machine,
647
00:52:33.860 --> 00:52:41.355
and you can create a project on Open Science Framework based on that folder, and you can just press sync, and it will keep those
648
00:52:41.895 --> 00:52:45.515
projects in sync. You can also search for it from another computer
649
00:52:46.135 --> 00:52:46.635
and
650
00:52:47.010
--> 00:52:49.910
download that project. And, again, you can just do syncing
651
00:52:50.370 --> 00:52:50.870
from
652
00:52:51.330 --> 00:53:00.954
1 machine to another within your lab. And then at some point, if you want to, you can go to open science framework and and click a button to make that public. So it's about trying to
653
00:53:01.494 --> 00:53:02.555
enable users
654
00:53:03.340 --> 00:53:04.800
who are a bit less
655
00:53:05.180 --> 00:53:06.800
tech aware or or
656
00:53:07.420 --> 00:53:11.520
or don't want to have to learn lots of different interfaces and lots of different technologies.
657
00:53:11.975 --> 00:53:22.370
They've got the hang of PsychoPy. There's a menu that says projects. They can go to that menu and either search for an existing experiment. That's what I'm hoping in the longer term is that people will make their experiments
658
00:53:22.830 --> 00:53:23.810
available online.
659
00:53:24.350 --> 00:53:26.850
Other users will be able to go and search for,
660
00:53:27.230 --> 00:53:28.290
show me an existing
661
00:53:29.055 --> 00:53:29.555
implementation
662
00:53:30.015 --> 00:53:32.035
of the implicit association test.
663
00:53:33.295 --> 00:53:39.180
And then I can download that and build my work on that, and it will speed up science. That's the idea.
664
00:53:40.280 --> 00:53:49.075
And I imagine too that it will increase the transparency and repeatability of some of those experiments too, while at the same time creating
665
00:53:49.375 --> 00:53:53.640
the provenance for the data so that it's easier to go back and understand
666
00:53:53.940 --> 00:53:58.840
where the statistics come from when you're publishing the results of your experiment.
667
00:53:59.655 --> 00:54:08.155
That's that's definitely a great goal scientifically for Center For Open Science. And for me, I would love to see that happen. I don't think that's what's driving the individual
668
00:54:08.880 --> 00:54:11.060
scientist who's wanting to upload their data.
669
00:54:11.360 --> 00:54:13.940
So so right now, that isn't having people
670
00:54:14.320 --> 00:54:17.220
examine your data and look for flaws isn't an incentive
671
00:54:17.595 --> 00:54:18.495
to most scientists.
672
00:54:19.115 --> 00:54:23.215
But but being able to share it and encourage so in reality,
673
00:54:23.595 --> 00:54:25.055
getting other people to
674
00:54:25.435 --> 00:54:25.935
see
675
00:54:26.520 --> 00:54:30.780
your experiment and your original code and build their study on it,
676
00:54:31.080 --> 00:54:40.684
that improves the visibility of your work and gets more people to base their study on your work, which means you get more citations for your paper. So that is an incentive for a scientist
677
00:54:41.065 --> 00:54:44.125
that they should be aware of. They they should be trying to increase
678
00:54:44.570 --> 00:54:45.550
spin off projects
679
00:54:45.930 --> 00:54:46.910
from their work.
680
00:54:47.290 --> 00:54:51.390
And and this allow publicly sharing your code, as well as your data,
681
00:54:51.755 --> 00:54:58.655
allows allows people to create spin off projects more easily. And that that is something that that scientists should care about,
682
00:54:59.059 --> 00:55:01.319
whether or not they do it for the altruistic
683
00:55:01.700 --> 00:55:08.735
reason that they want science to progress well. And and, you know, it's all very good of you to to feel that you want,
684
00:55:09.195 --> 00:55:12.655
people to be able to examine your data and look for flaws. People
685
00:55:13.275 --> 00:55:17.510
in reality, it's a lot of effort, often to to make your data available
686
00:55:17.810 --> 00:55:21.670
in a format that other people like and and all that sort of thing. So
687
00:55:22.130 --> 00:55:26.285
people are often quite shy of doing that, unless there's
688
00:55:26.585 --> 00:55:31.085
a a clear incentive. So I try to focus a bit more on why it's good for the scientist,
689
00:55:31.625 --> 00:55:38.020
on the individual scientist, as well as the fact that I, of of course, I do believe that it's good for science as a field as well.
690
00:55:38.720 --> 00:55:43.335
Do you have a road map of features that you'd like to add to PsychoPy, or is it largely driven
691
00:55:43.635 --> 00:55:47.175
by contributions from practitioners who are extending it to suit their needs?
692
00:55:48.355 --> 00:55:51.815
Both. Very much both. There are lots of things that I would love to add
693
00:55:52.309 --> 00:55:54.569
and haven't had time to do. So
694
00:55:54.869 --> 00:55:56.970
PsychoPy's development has been
695
00:55:57.510 --> 00:55:58.569
driven by
696
00:55:59.645 --> 00:56:01.105
either things that my lab
697
00:56:01.485 --> 00:56:06.785
currently needs, and and I want to get in there, and all that a contributor's lab needs.
698
00:56:07.250 --> 00:56:14.630
And and so they're going to go and add that feature because they need it for their study right now. And that's the best way,
699
00:56:15.015 --> 00:56:20.875
in many cases for things to be added. There are lots of other things that I would love to add, and if I had time, I would.
700
00:56:21.415 --> 00:56:21.915
But
701
00:56:22.535 --> 00:56:24.155
my priority has to be with,
702
00:56:24.630 --> 00:56:33.210
you know, my PhD student and and and and that sort of thing. So it's there's a there's a mixture going on. There's also an issue that although
703
00:56:33.645 --> 00:56:39.745
I would love to add a certain feature so right now, I'm in discussion with someone who's wanting to contribute
704
00:56:40.685 --> 00:56:41.185
stereo
705
00:56:42.010 --> 00:56:42.510
displays
706
00:56:42.970 --> 00:56:43.470
and
707
00:56:44.170 --> 00:56:44.750
and enable
708
00:56:45.050 --> 00:56:45.550
PsychoPy
709
00:56:46.410 --> 00:56:56.434
to support, you know, shutter goggles and that sort of thing better without without the user having to write particularly hard code. So how do we make that easy for the user,
and how do we support
710
00:56:56.974 --> 00:56:57.795
8 different
711
00:56:58.095 --> 00:56:59.154
forms of stereo
712
00:57:00.000 --> 00:57:17.045
outputs from from a graphics card. Now I'm not the right guy to write that code because I don't have any of that stereo kit. I don't have a TV with shutter goggles that allows me to to work on them. And my lab isn't doing that sort of study. So it's never going to be the top of my priority list,
713
00:57:17.960 --> 00:57:20.540
and it would be very hard for me to go and test that rigorously.
714
00:57:21.080 --> 00:57:26.540
What we need is a user who runs those sorts of studies, who knows more about that technology,
715
00:57:27.545 --> 00:57:31.085
and who needs it in their next study. That's the way that the
716
00:57:31.465 --> 00:57:37.005
the code gets best written. And that's exactly what we've got going on right now is that there's someone coming to us.
717
00:57:37.480 --> 00:57:40.220
They've been using this sort of technology for a long time,
718
00:57:40.520 --> 00:57:41.020
and
719
00:57:41.400 --> 00:57:48.525
they know how to implement it. Well, you know, maybe with a little bit of support from me about how does the PsychoPy engine
720
00:57:48.825 --> 00:57:53.965
currently render things so that we we need to talk a little bit about how to interface
721
00:57:54.720 --> 00:57:57.060
his module with mine. That's fine.
722
00:57:57.680 --> 00:58:01.700
But that's that's the way that most of the code has sort of evolved.
723
00:58:02.434 --> 00:58:06.694
Or take for instance, the rating scale. You know, that came from Jeremy Gray,
724
00:58:07.234 --> 00:58:10.454
and I've never done a study that involved a rating scale,
725
00:58:11.450 --> 00:58:13.310
but he does them all the time. So
726
00:58:14.330 --> 00:58:19.790
he he wanted to have this stimulus available to make it easier for him to run his studies. And that's how it got contributed.
727
00:58:20.555 --> 00:58:23.535
There is a road map as well, though. And there are things that I
728
00:58:23.915 --> 00:58:25.535
do very much intend to,
729
00:58:26.795 --> 00:58:28.735
get done, either me or
730
00:58:29.080 --> 00:58:29.580
someone.
731
00:58:30.600 --> 00:58:32.380
Or, ideally, as we get bigger,
732
00:58:33.000 --> 00:58:34.620
we will hopefully have
733
00:58:35.320 --> 00:58:38.540
funding options, and we will have ways that we can pay
734
00:58:38.905 --> 00:58:41.085
people. So far, we've had very,
735
00:58:41.545 --> 00:58:44.204
very small amounts of money from a few places
736
00:58:44.585 --> 00:58:47.724
that are willing to contribute to to our open science drive.
737
00:58:48.069 --> 00:58:52.650
But 1 of those things is is absolutely the the development of web based experiments
738
00:58:52.950 --> 00:58:57.450
and the building of the JavaScript library. Again, I'm not the right guy to write that code.
739
00:58:57.785 --> 00:58:59.245
That's not something I've
740
00:58:59.705 --> 00:59:06.525
known much
about. I've not worked very much on that. So I would have to learn a great deal about JavaScript to write that myself.
741
00:59:07.250 --> 00:59:13.990
But we can we can get other people, probably hire other people. So we've been working with a company called elixir.com,
742
00:59:15.684 --> 00:59:19.145
and they've been writing the the sort of JavaScript library,
743
00:59:20.005 --> 00:59:22.730
that's the equivalent of the PsychoPy
744
00:59:23.030 --> 00:59:24.089
Python library.
745
00:59:24.390 --> 00:59:24.890
So
746
00:59:25.270 --> 00:59:26.569
that is something that will,
747
00:59:27.109 --> 00:59:28.490
for sure, be happening,
748
00:59:28.869 --> 00:59:30.410
and, hopefully, that will be
749
00:59:30.955 --> 00:59:36.015
over the next year or so. We'll we we've we've got that in a proof of concept right now.
750
00:59:36.395 --> 00:59:36.895
And,
751
00:59:37.355 --> 00:59:40.760
over the next year, I'm sure we'll we'll be supporting
752
00:59:41.700 --> 00:59:43.800
full experiments in a browser
753
00:59:44.420 --> 00:59:47.000
using open science framework to save your data
754
00:59:47.725 --> 00:59:49.185
and and using builder
755
00:59:49.645 --> 00:59:56.305
to generate the the web files that you need to do that. 1 of the things that we that I'm really keen on is
756
00:59:57.210 --> 00:59:57.710
making
757
00:59:58.810 --> 01:00:03.550
builder better at detecting when a user is about to do something that's not wise.
758
01:00:04.570 --> 01:00:05.470
So right now,
759
01:00:06.295 --> 01:00:08.875
you could ask builder to draw your stimulus
760
01:00:09.575 --> 01:00:10.715
smaller than a pixel
761
01:00:11.655 --> 01:00:14.155
or 4 meters to the right of your screen
762
01:00:14.615 --> 01:00:15.015
or,
763
01:00:16.320 --> 01:00:19.380
with an invisible texture, and PsychoPy won't complain.
764
01:00:19.760 --> 01:00:20.580
It will just
765
01:00:21.200 --> 01:00:22.820
fail to draw anything. Right?
766
01:00:23.120 --> 01:00:23.620
And
767
01:00:23.935 --> 01:00:32.675
to the user who gets no stimulus appear on their screen, that's confusing. So 1 of the things that PsychoPy needs to do is detect
768
01:00:33.309 --> 01:00:40.369
and do an integrity check of your experiment and say, you know, it looks like your stimulus is about to be drawn smaller than a pixel.
769
01:00:41.305 --> 01:00:45.484
Do is that really what you wanted to do? And just provide little warnings like that.
770
01:00:46.185 --> 01:00:47.724
That that sort of code,
771
01:00:48.190 --> 01:00:51.570
again, it's the sort of thing that because my lab doesn't need it because
772
01:00:51.950 --> 01:00:55.490
experienced users know what's going wrong and they won't make those mistakes,
773
01:00:55.870 --> 01:00:57.250
it's hard to make a priority,
774
01:00:57.605 --> 01:01:02.505
but it's something that I feel is really important that will prevent people from making silly errors,
775
01:01:03.125 --> 01:01:14.170
including me. I make silly errors in my own
experiments as well. And and I would like to warn me, oh, you're about to do that thing again that you've done a 1000000 times before, and you still haven't learned that that's wrong.
776
01:01:14.645 --> 01:01:16.805
So that's that's 1 step that's that's,
777
01:01:17.365 --> 01:01:19.705
another thing that's important for the future.
778
01:01:20.325 --> 01:01:25.780
Improving precision is always 1 more thing that we we're always trying to work to get
779
01:01:26.080 --> 01:01:27.780
faster playing of the sounds,
780
01:01:28.080 --> 01:01:32.340
faster rendering of of large movies, especially as we go to HD
781
01:01:32.785 --> 01:01:33.605
movies increasingly,
782
01:01:34.385 --> 01:01:38.005
we've got to improve the precision and performance of a lot of aspects of PsychoPy.
783
01:01:38.305 --> 01:01:40.244
And and that's something that's just a constant,
784
01:01:41.200 --> 01:01:43.380
aspect that we're always trying to improve.
785
01:01:45.359 --> 01:01:51.885
So are there any questions that we didn't ask that you think we should have or any other topics that you'd like to cover before we close out?
786
01:01:54.425 --> 01:01:55.325
No. I think
787
01:01:55.789 --> 01:01:59.329
1 of the things that I find interesting is this question about
788
01:01:59.869 --> 01:02:03.809
open source development versus the traditional commercial world and and
789
01:02:04.415 --> 01:02:08.035
software engineers versus academic engineers, but we ended up talking about that anyway.
790
01:02:09.615 --> 01:02:15.230
Do you want to talk any more about things like so 1 of the things that PsychoPy does that maybe
791
01:02:15.610 --> 01:02:18.510
is unusual is this tracking of users, and it's
792
01:02:18.810 --> 01:02:20.910
it's hard for an open source project
793
01:02:21.465 --> 01:02:22.845
to persuade people
794
01:02:23.465 --> 01:02:23.965
to
795
01:02:24.505 --> 01:02:26.365
to fund it and to persuade
796
01:02:26.745 --> 01:02:29.165
you know, in my case, I've got a job as an academic,
797
01:02:29.480 --> 01:02:31.740
but I have to persuade people that
798
01:02:32.040 --> 01:02:34.140
that's a useful use of my time.
799
01:02:34.440 --> 01:02:38.940
I'm not always making discoveries, but I'm making software tools that other people
800
01:02:39.245 --> 01:02:40.625
can use to make discoveries.
801
01:02:41.085 --> 01:02:49.850
And and so sometimes it can be hard to express and and and and persuade people that these projects are important.
802
01:02:50.550 --> 01:02:54.650
And that's something that's that's fairly close to my heart as well.
803
01:02:55.664 --> 01:02:58.565
Sometimes getting people to fund a project, they're like,
804
01:02:58.865 --> 01:03:05.710
but why would we fund it? It's not going to make any money. Or or academics, you know, my seniors would be saying,
805
01:03:06.090 --> 01:03:10.945
but why are you doing this and not just paying a software engineer to write the software for you?
806
01:03:11.825 --> 01:03:14.325
So or why are you just not using something off the shelf?
807
01:03:15.025 --> 01:03:19.925
So those are sort of topics that I that are close to my heart, and then that's why I ended up writing.
808
01:03:20.650 --> 01:03:21.790
So as PsychoPy
809
01:03:22.410 --> 01:03:23.310
gets launched,
810
01:03:24.010 --> 01:03:27.710
it pings a website, and that's what allows us to collect usage data.
811
01:03:28.095 --> 01:03:31.155
So we track how many unique IP addresses
812
01:03:31.695 --> 01:03:33.555
launch the application every month.
813
01:03:33.935 --> 01:03:40.090
And and that helps us a little bit to to go to potential funders and to go to
814
01:03:40.790 --> 01:03:44.490
my superiors and say, look. This is an important thing. We've got
815
01:03:44.875 --> 01:03:46.015
12, 000 users.
816
01:03:46.474 --> 01:03:49.135
And and so that's kind of an interesting
817
01:03:50.234 --> 01:03:51.535
topic in a way,
818
01:03:52.119 --> 01:03:57.099
But I don't know if that's something that that I don't know how to frame that as a question that you would want to include.
819
01:03:57.800 --> 01:04:02.195
You did a perfect job there. And I think that too that brings out a good point that
820
01:04:02.575 --> 01:04:05.715
as software becomes a more integral piece of
821
01:04:06.095 --> 01:04:14.440
academic endeavors, that I think that we are probably gonna start to see the paradigm shift a little bit away from the publish or perish
822
01:04:14.740 --> 01:04:18.759
or at least recognizing that developing software is a form of publishing
823
01:04:19.345 --> 01:04:21.205
as is evidenced by the fact that,
824
01:04:21.665 --> 01:04:33.210
a lot of these scientific open source projects are actually cited in academic works. I know that you've got a citation reference in the documentation for PsychoPy and similarly for things like SunPy and AstroPy.
825
01:04:34.635 --> 01:04:39.135
Yeah. That's but that's 1 of the interesting things is trying to find track those users where
826
01:04:39.435 --> 01:04:48.260
the citation count on that paper is, I don't know, something like 6 5, 600 people, something like that. But I know that monthly, there are 12, 000 users.
827
01:04:49.200 --> 01:04:52.945
So so, you know, there's a there's an order of magnitude discrepancy there
828
01:04:53.825 --> 01:04:54.625
that that is,
829
01:04:55.665 --> 01:04:59.365
that is interesting. And and presumably, it's that citations will follow on
830
01:04:59.745 --> 01:05:03.869
gradually later or people are using the software for all sorts of other endeavors.
831
01:05:04.170 --> 01:05:06.589
And when I mentioned earlier on about wanting to know about
832
01:05:07.130 --> 01:05:07.630
nonacademic
833
01:05:08.009 --> 01:05:09.950
uses, it's because in the UK,
834
01:05:10.655 --> 01:05:12.435
this, by many classifications,
835
01:05:12.974 --> 01:05:15.555
doesn't actually count as having any impact.
836
01:05:15.855 --> 01:05:22.650
So the UK counts impact of a scientific of a
of an academic endeavor as when it affects society
837
01:05:22.950 --> 01:05:27.210
outside academia or when it raises money. And because I don't sell it
838
01:05:27.785 --> 01:05:30.285
and because the people using it are academics,
839
01:05:31.385 --> 01:05:47.525
tens of thousands of users don't count as any impact, which is a so having 1 person using it in the clinic for for nonacademic use but to find patients counts a lot more, it turns out, than tens of thousands of people teaching their students.
840
01:05:47.984 --> 01:05:49.585
So so we've got these,
841
01:05:50.305 --> 01:05:50.805
broken
842
01:05:51.299 --> 01:05:52.279
kind of incentives
843
01:05:52.819 --> 01:05:54.519
in many ways, and and
844
01:05:54.900 --> 01:06:03.645
and those those are frustrating for me. Those are those are topics that I find interesting. Let's put it that way. This this comes back to a recurring theme that we've seen on our podcast.
845
01:06:04.585 --> 01:06:11.839
If you're using a piece of open source and you love it and you, you know, it's making your life a better place and you're enhancing your job performance,
846
01:06:12.539 --> 01:06:27.505
tell the right you know, the people who are in charge of that project about it. Drop them an email. It, you know, it it takes 5 minutes to say, hey. Thank you very much. I'm using it for blah blah blah. And it means so much to people like like Jonathan here slaving away,
847
01:06:28.029 --> 01:06:29.890
building this this incredible stuff.
848
01:06:31.069 --> 01:06:32.930
Yeah. Yeah. Very much. And and certainly,
849
01:06:34.109 --> 01:06:35.970
it while writing papers,
850
01:06:36.345 --> 01:06:39.964
like journal articles versus writing software, I I found it interesting
851
01:06:40.505 --> 01:06:54.305
when I go to a conference that I do get people come up and say, oh, you're the guy who writes sci fi. That's great. I love that. That's brilliant. And it's really nice. And no one's ever come up to me and said, hey. You're the guy who wrote that paper on adaptation to PLAD visual stimuli.
852
01:06:55.005 --> 01:06:56.385
And I really love that paper.
853
01:06:56.685 --> 01:06:58.785
So, yeah, it is it is motivating
854
01:06:59.165 --> 01:06:59.665
having
855
01:07:00.210 --> 01:07:01.349
individuals come up
856
01:07:01.730 --> 01:07:03.750
and and say that they like your work. And
857
01:07:04.450 --> 01:07:07.109
that actually, for a lot of open source developers,
858
01:07:07.605 --> 01:07:09.465
is I think what drives them. You know,
859
01:07:10.005 --> 01:07:17.385
they they like to feel that even though they're not being recognized financially or or in terms of, other
860
01:07:17.750 --> 01:07:21.770
other more tangible methods. Hearing people say they like your software,
861
01:07:22.230 --> 01:07:24.329
is definitely what gets a lot of us out of bed.
862
01:07:25.135 --> 01:07:34.435
And on that note, what are some of the best ways for people to get in touch with you and let them know about their use of PsychoPy or follow what you're up to and how things are going with the project?
863
01:07:35.170 --> 01:07:37.670
We've just recently switched actually to
864
01:07:37.970 --> 01:07:40.790
from from a Google group to Discourse.
865
01:07:41.170 --> 01:07:42.550
So Discourse is
866
01:07:42.875 --> 01:07:43.694
an open
867
01:07:44.075 --> 01:07:48.015
source forum product, and and we've now got a a forum
868
01:07:48.714 --> 01:07:49.775
on discourse.psychopi.org.
869
01:07:51.115 --> 01:07:52.015
That's been brilliant.
870
01:07:53.089 --> 01:08:00.150
That's that's something that I I hadn't realized actually how much we needed a forum rather than just a Google email list.
871
01:08:01.035 --> 01:08:03.695
So, actually, that's the best place to get in touch with the group.
872
01:08:04.715 --> 01:08:05.115
And,
873
01:08:05.515 --> 01:08:06.255
yeah, that's
874
01:08:06.715 --> 01:08:10.860
if you're writing your own open source projects and or or just wanting
875
01:08:11.240 --> 01:08:14.140
an online discussion, I would also recommend having a look at Discourse
876
01:08:14.520 --> 01:08:16.860
because it's a it's a pretty awesome package.
877
01:08:17.325 --> 01:08:20.145
Yeah. That's what we're using for our forum for the podcast.
878
01:08:20.525 --> 01:08:22.125
Okay. Yeah. It's it's,
879
01:08:22.605 --> 01:08:24.785
it's really neat. It does everything right.
880
01:08:25.350 --> 01:08:25.850
Yeah.
881
01:08:26.230 --> 01:08:30.330
And and from our perspective, it does things like if a user
882
01:08:30.710 --> 01:08:31.610
starts typing,
883
01:08:32.469 --> 01:08:49.610
a new post, but it looks kind of similar to a question that's already been answered, then they get a very clear flag saying, have you looked at this post? Because it's quite similar to what you've just written, which hopefully means that that we are having to answer fewer questions that people will find existing answers instead. So things like that is really neat.
884
01:08:50.425 --> 01:08:57.725
So with that, I'll move us on into the picks. And my pick today is the book, hackers, heroes of the computer revolution by Steven Levy.
885
01:08:58.110 --> 01:09:08.845
I listened to it a week or 2 back and thoroughly enjoyed it. It's a interesting way to get some of the history of early computing and how it,
886
01:09:09.305 --> 01:09:14.525
how people who were working outside of the intended frameworks of the hardware,
887
01:09:15.370 --> 01:09:20.750
sort of pushed the pushed the industry forward and introduced a lot of new innovations
888
01:09:21.130 --> 01:09:24.795
that might not otherwise have happened. So definitely worth a look for people
889
01:09:25.594 --> 01:09:28.895
who are not who who who who weren't there to experience it firsthand.
890
01:09:29.755 --> 01:09:34.175
So definitely recommend giving that a read or a listen. And with that, I'll pass it to you, Chris.
891
01:09:34.670 --> 01:09:38.050
That's a great book. I read it decades ago. Man, I'm old.
892
01:09:39.870 --> 01:09:42.190
My pick this week is a,
893
01:09:42.510 --> 01:09:43.970
an iOS application.
894
01:09:44.655 --> 01:09:47.715
Unfortunately, there's no Android version right now. It's called Castro,
895
01:09:48.335 --> 01:10:01.960
and it has really just made my podcast listening life a much much better place rather than using the model of you subscribe to these podcasts and therefore you will listen to every episode that they produce in order.
896
01:10:02.340 --> 01:10:15.830
It treats it almost like an RSS reader like Feedly or something like that, where you have an inbox and new episodes are presented to you, and you can tell it this podcast is just so good just just queue it don't even, you know, don't even bother.
897
01:10:16.210 --> 01:10:17.110
But for others
898
01:10:17.410 --> 01:10:31.010
you can say, you know, put it into my inbox and let me choose and you can say, oh, that that episode is interesting, add it to the front of the queue or the back of the queue or archive it and episodes that you archive don't just go away forever. You can go back and leaf through your archives
899
01:10:31.550 --> 01:10:42.575
to see if there's something you actually do wanna listen to. It's just great. The interface is phenomenal, and, and I really love it. And that's my pick. John, what do you have for us or picks today, if anything?
900
01:10:43.080 --> 01:10:47.099
I I think mine would would I'm just gonna go back to discourse.
901
01:10:47.880 --> 01:10:50.300
My my pick of the week would be discourse
902
01:10:50.835 --> 01:10:52.855
for for forums, and and
903
01:10:53.395 --> 01:10:56.055
discourse is a is a a a great,
904
01:10:56.435 --> 01:10:58.775
forum package, open source,
905
01:10:59.860 --> 01:11:04.360
really well written. It does everything right, and they're also very responsive developers.
906
01:11:05.060 --> 01:11:05.960
When we found
907
01:11:06.385 --> 01:11:12.885
some issues and had questions, they were they were really good at getting back to us as well. So for any other open source developers
908
01:11:13.800 --> 01:11:17.740
or people just wanting a forum in general, I would really recommend you check out Discourse.
909
01:11:18.520 --> 01:11:20.860
Yeah. And they've also made it really easy to
910
01:11:21.355 --> 01:11:30.360
get it installed and upgraded and self host it, as well as having a hosted offering as if if you are not inclined to run your own server for it.
911
01:11:31.320 --> 01:11:41.804
So we really appreciate you taking the time out of your day to tell us about your work on PsychoPy. It's definitely sounds like a really interesting project and I hope you enjoy the rest of your day. Thank you very much.