Skip to content

Commit 93967fd

Browse files
committed
Merge branch 'docs' into develop
2 parents bc379a4 + ac75f05 commit 93967fd

File tree

1 file changed

+46
-4
lines changed

1 file changed

+46
-4
lines changed

examples/loading_data/loading_trials_data.ipynb

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,45 @@
4545
{
4646
"cell_type": "markdown",
4747
"source": [
48-
"## Loading a session's trials"
48+
"## Loading a single session's trials\n",
49+
"\n",
50+
"If you want to load the trials data for a single session, we recommend you use the `SessionLoader`:"
51+
],
52+
"metadata": {
53+
"collapsed": false
54+
}
55+
},
56+
{
57+
"cell_type": "code",
58+
"execution_count": null,
59+
"outputs": [],
60+
"source": [
61+
"'''\n",
62+
"RECOMMENDED\n",
63+
"'''\n",
64+
"from brainbox.io.one import SessionLoader\n",
65+
"from one.api import ONE\n",
66+
"one = ONE()\n",
67+
"eid = '4ecb5d24-f5cc-402c-be28-9d0f7cb14b3a'\n",
68+
"sl = SessionLoader(eid=eid, one=one)\n",
69+
"sl.load_trials()\n",
70+
"\n",
71+
"# The datasets are attributes of the sl.trials, for example probabilityLeft :\n",
72+
"probabilityLeft = sl.trials['probabilityLeft']\n",
73+
"# Find all of them using:\n",
74+
"sl.trials.keys()"
75+
],
76+
"metadata": {
77+
"collapsed": false,
78+
"pycharm": {
79+
"name": "#%%\n"
80+
}
81+
}
82+
},
83+
{
84+
"cell_type": "markdown",
85+
"source": [
86+
"For completeness, we present below how to load the trials object using the `one.load_object` method, however we recommend you use the code above and use the `SessionLoader` instead."
4987
],
5088
"metadata": {
5189
"collapsed": false
@@ -56,6 +94,9 @@
5694
"execution_count": null,
5795
"outputs": [],
5896
"source": [
97+
"'''\n",
98+
"ALTERNATIVE - NOT RECOMMENDED\n",
99+
"'''\n",
59100
"from one.api import ONE\n",
60101
"one = ONE()\n",
61102
"eid = '4ecb5d24-f5cc-402c-be28-9d0f7cb14b3a'\n",
@@ -73,9 +114,10 @@
73114
"id": "0514237a",
74115
"metadata": {},
75116
"source": [
76-
"## Loading a subject's trials\n",
77-
"This loads all trials data for a given subject (all session trials concatenated) into a DataFrame.\n",
78-
"The subjectTraining table contains the training statuses."
117+
"## Loading all the sessions' trials for a single subject at once\n",
118+
"If you want to study several sessions for a single subject, we recommend you use the `one.load_aggregate` method rather than downloading each trials data individually per session.\n",
119+
"This methods loads all the trials data `subjectTrials` for a given subject into a single DataFrame (i.e. all session trials are concatenated).\n",
120+
"You can use the same method to load the `subjectTraining` table, which contains the training statuses."
79121
]
80122
},
81123
{

0 commit comments

Comments
 (0)