|
45 | 45 | { |
46 | 46 | "cell_type": "markdown", |
47 | 47 | "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." |
49 | 87 | ], |
50 | 88 | "metadata": { |
51 | 89 | "collapsed": false |
|
56 | 94 | "execution_count": null, |
57 | 95 | "outputs": [], |
58 | 96 | "source": [ |
| 97 | + "'''\n", |
| 98 | + "ALTERNATIVE - NOT RECOMMENDED\n", |
| 99 | + "'''\n", |
59 | 100 | "from one.api import ONE\n", |
60 | 101 | "one = ONE()\n", |
61 | 102 | "eid = '4ecb5d24-f5cc-402c-be28-9d0f7cb14b3a'\n", |
|
73 | 114 | "id": "0514237a", |
74 | 115 | "metadata": {}, |
75 | 116 | "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." |
79 | 121 | ] |
80 | 122 | }, |
81 | 123 | { |
|
0 commit comments