You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Note that the `!`, at the beginning of the command, means that it is not a python command but that it belongs to the shell (*i.e.,* the interface to the Linux operating system used by the Google Colab servers).\n",
52
+
"\n",
53
+
"To avoid having too many messages, we redirect the output to a log file (`output.log`).\n",
54
+
"\n",
55
+
"The whole installation process which requires the loading of several libraries not preinstalled by Colab takes less than 1 minute.\n"
56
+
]
57
+
},
58
+
{
59
+
"cell_type": "markdown",
60
+
"metadata": {
61
+
"id": "jr26EpTDRj7C",
62
+
"pycharm": {
63
+
"name": "#%% md\n"
64
+
}
65
+
},
66
+
"source": [
67
+
"If you want to try our latest development version instead of the stable version, use the following command. Using the development version is recommended to take advantage of the latest improvements and bug fixes:"
"The recommended way of loading SpectroChemPy in the notebook namespace is as follows:"
96
+
]
97
+
},
98
+
{
99
+
"cell_type": "code",
100
+
"execution_count": null,
101
+
"metadata": {
102
+
"id": "a1_yv0dzH3bk",
103
+
"pycharm": {
104
+
"name": "#%%\n"
105
+
}
106
+
},
107
+
"outputs": [],
108
+
"source": [
109
+
"import spectrochempy as scp"
110
+
]
111
+
},
112
+
{
113
+
"cell_type": "markdown",
114
+
"metadata": {
115
+
"id": "ayLWe5pMdqqr",
116
+
"pycharm": {
117
+
"name": "#%% md\n"
118
+
}
119
+
},
120
+
"source": [
121
+
"### Importing experimental data\n",
122
+
"\n",
123
+
"Let's show a first example. In the following cell we read experimental data aquired on an IR spectrometer in the `OMNC (spg)` format and stored in our example repository on GitHub: [spectrochempy_data/testdata](https://github.com/spectrochempy/spectrochempy_data/tree/master/testdata).\n",
124
+
"\n",
125
+
"We simply specified the relative path with respect to the `testdata` folder, *i.e.,* `\"irdata/nh4y-activation.spg\"`."
126
+
]
127
+
},
128
+
{
129
+
"cell_type": "code",
130
+
"execution_count": null,
131
+
"metadata": {
132
+
"id": "cpZeUpPns2dx",
133
+
"pycharm": {
134
+
"name": "#%%\n"
135
+
}
136
+
},
137
+
"outputs": [],
138
+
"source": [
139
+
"_ = scp.read(\"irdata/nh4y-activation.spg\")"
140
+
]
141
+
},
142
+
{
143
+
"cell_type": "markdown",
144
+
"metadata": {
145
+
"id": "Tg0t6oVWuM_s",
146
+
"pycharm": {
147
+
"name": "#%% md\n"
148
+
}
149
+
},
150
+
"source": [
151
+
"It is worth to note that the data are downloaded from the remote repository and stored locall in the ``datadir`` default directory. As it is stored locally, if for some reason we need to download it again, it will be faster as no connection with the remote server need to be established again.\n",
152
+
"\n",
153
+
"The local path for the default directory is easily retrieved from the `preferences`:"
154
+
]
155
+
},
156
+
{
157
+
"cell_type": "code",
158
+
"execution_count": null,
159
+
"metadata": {
160
+
"pycharm": {
161
+
"name": "#%%\n"
162
+
},
163
+
"id": "FaO5VWmzZAVy"
164
+
},
165
+
"outputs": [],
166
+
"source": [
167
+
"prefs = scp.preferences\n",
168
+
"DATADIR = prefs.datadir\n",
169
+
"print(DATADIR)"
170
+
]
171
+
},
172
+
{
173
+
"cell_type": "markdown",
174
+
"metadata": {
175
+
"pycharm": {
176
+
"name": "#%% md\n"
177
+
},
178
+
"id": "z-cfuM3zZAVz"
179
+
},
180
+
"source": [
181
+
"This preference setting can be changed. For exemple, as the default directory\n",
182
+
"will not allow keeping permanently our data (erased after closing the Colab\n",
183
+
"session), it may be desirable to store our data in your Google Drive.\n",
184
+
"\n",
185
+
"This assumes that your personal Google Drive is already mounted, you should see the `drive` folder in the Files explorer. If it is not the case, mount it using:"
186
+
]
187
+
},
188
+
{
189
+
"cell_type": "code",
190
+
"execution_count": null,
191
+
"metadata": {
192
+
"id": "izw4YRsnagJ1",
193
+
"pycharm": {
194
+
"name": "#%%\n"
195
+
}
196
+
},
197
+
"outputs": [],
198
+
"source": [
199
+
"from google.colab import drive\n",
200
+
"drive.mount('/content/drive')"
201
+
]
202
+
},
203
+
{
204
+
"cell_type": "markdown",
205
+
"metadata": {
206
+
"id": "CRPLLU76LXqO",
207
+
"pycharm": {
208
+
"name": "#%% md\n"
209
+
}
210
+
},
211
+
"source": [
212
+
"Now let's create a directory for our data in the `drive` and next, change the\n",
213
+
"preferences settings to set this directory the default to load/save data."
0 commit comments