|
47 | 47 | "storage = {\n", |
48 | 48 | " \"contiguous\": True,\n", |
49 | 49 | " \"urlpath\": \"myfile.b2frame\",\n", |
| 50 | + " \"mode\": \"w\", # create a file anew\n", |
50 | 51 | " \"cparams\": cparams,\n", |
51 | 52 | " \"dparams\": dparams,\n", |
52 | 53 | "}" |
|
56 | 57 | "cell_type": "markdown", |
57 | 58 | "metadata": {}, |
58 | 59 | "source": [ |
59 | | - "And let's remove a possible existing serialized super-chunk (frame):" |
| 60 | + "Now, we can already create a SChunk instance:" |
60 | 61 | ] |
61 | 62 | }, |
62 | 63 | { |
63 | 64 | "cell_type": "code", |
64 | 65 | "execution_count": 3, |
65 | 66 | "metadata": {}, |
66 | | - "outputs": [], |
67 | | - "source": [ |
68 | | - "blosc2.remove_urlpath(\"myfile.b2frame\")" |
69 | | - ] |
70 | | - }, |
71 | | - { |
72 | | - "cell_type": "markdown", |
73 | | - "metadata": {}, |
74 | | - "source": [ |
75 | | - "Now, we can already create a SChunk!" |
76 | | - ] |
77 | | - }, |
78 | | - { |
79 | | - "cell_type": "code", |
80 | | - "execution_count": 4, |
81 | | - "metadata": {}, |
82 | 67 | "outputs": [ |
83 | 68 | { |
84 | 69 | "data": { |
85 | | - "text/plain": [ |
86 | | - "<blosc2.SChunk.SChunk at 0x7f71c83a67c0>" |
87 | | - ] |
| 70 | + "text/plain": "<blosc2.SChunk.SChunk at 0x110def6c0>" |
88 | 71 | }, |
89 | | - "execution_count": 4, |
| 72 | + "execution_count": 3, |
90 | 73 | "metadata": {}, |
91 | 74 | "output_type": "execute_result" |
92 | 75 | } |
|
100 | 83 | "cell_type": "markdown", |
101 | 84 | "metadata": {}, |
102 | 85 | "source": [ |
103 | | - "Great! So you have created your first super-chunk with your desired compression codec and typesize, and it is going to be persistent on disk." |
| 86 | + "Great! So you have created your first super-chunk with your desired compression codec and typesize, that is going to be persistent on-disk." |
104 | 87 | ] |
105 | 88 | }, |
106 | 89 | { |
|
114 | 97 | }, |
115 | 98 | { |
116 | 99 | "cell_type": "code", |
117 | | - "execution_count": 5, |
| 100 | + "execution_count": 4, |
118 | 101 | "metadata": {}, |
119 | 102 | "outputs": [], |
120 | 103 | "source": [ |
|
123 | 106 | }, |
124 | 107 | { |
125 | 108 | "cell_type": "code", |
126 | | - "execution_count": 6, |
| 109 | + "execution_count": 5, |
127 | 110 | "metadata": {}, |
128 | 111 | "outputs": [ |
129 | 112 | { |
130 | 113 | "name": "stdout", |
131 | 114 | "output_type": "stream", |
132 | 115 | "text": [ |
133 | | - "CPU times: user 355 ms, sys: 0 ns, total: 355 ms\n", |
134 | | - "Wall time: 69.6 ms\n" |
| 116 | + "CPU times: user 312 ms, sys: 790 ms, total: 1.1 s\n", |
| 117 | + "Wall time: 333 ms\n" |
135 | 118 | ] |
136 | 119 | } |
137 | 120 | ], |
|
144 | 127 | }, |
145 | 128 | { |
146 | 129 | "cell_type": "code", |
147 | | - "execution_count": 7, |
| 130 | + "execution_count": 6, |
148 | 131 | "metadata": {}, |
149 | 132 | "outputs": [ |
150 | 133 | { |
151 | 134 | "name": "stdout", |
152 | 135 | "output_type": "stream", |
153 | 136 | "text": [ |
154 | | - "-rw-rw-r-- 1 faltet2 faltet2 11M jun 28 19:03 myfile.b2frame\r\n" |
| 137 | + "-rw-r--r-- 1 francesc staff 10M Oct 3 18:29 myfile.b2frame\r\n" |
155 | 138 | ] |
156 | 139 | } |
157 | 140 | ], |
|
170 | 153 | }, |
171 | 154 | { |
172 | 155 | "cell_type": "code", |
173 | | - "execution_count": 8, |
| 156 | + "execution_count": 7, |
174 | 157 | "metadata": {}, |
175 | 158 | "outputs": [], |
176 | 159 | "source": [ |
|
179 | 162 | }, |
180 | 163 | { |
181 | 164 | "cell_type": "code", |
182 | | - "execution_count": 9, |
| 165 | + "execution_count": 8, |
183 | 166 | "metadata": {}, |
184 | 167 | "outputs": [ |
185 | 168 | { |
186 | 169 | "name": "stdout", |
187 | 170 | "output_type": "stream", |
188 | 171 | "text": [ |
189 | | - "CPU times: user 65.9 ms, sys: 82 ms, total: 148 ms\n", |
190 | | - "Wall time: 39.5 ms\n" |
| 172 | + "CPU times: user 200 ms, sys: 65.8 ms, total: 266 ms\n", |
| 173 | + "Wall time: 77 ms\n" |
191 | 174 | ] |
192 | 175 | } |
193 | 176 | ], |
|
199 | 182 | }, |
200 | 183 | { |
201 | 184 | "cell_type": "code", |
202 | | - "execution_count": 10, |
| 185 | + "execution_count": 9, |
203 | 186 | "metadata": {}, |
204 | 187 | "outputs": [], |
205 | 188 | "source": [ |
|
218 | 201 | }, |
219 | 202 | { |
220 | 203 | "cell_type": "code", |
221 | | - "execution_count": 11, |
| 204 | + "execution_count": 10, |
222 | 205 | "metadata": {}, |
223 | 206 | "outputs": [], |
224 | 207 | "source": [ |
|
228 | 211 | }, |
229 | 212 | { |
230 | 213 | "cell_type": "code", |
231 | | - "execution_count": 12, |
| 214 | + "execution_count": 11, |
232 | 215 | "metadata": {}, |
233 | 216 | "outputs": [ |
234 | 217 | { |
235 | 218 | "name": "stdout", |
236 | 219 | "output_type": "stream", |
237 | 220 | "text": [ |
238 | | - "CPU times: user 258 µs, sys: 348 µs, total: 606 µs\n", |
239 | | - "Wall time: 351 µs\n" |
| 221 | + "CPU times: user 288 µs, sys: 839 µs, total: 1.13 ms\n", |
| 222 | + "Wall time: 1.41 ms\n" |
240 | 223 | ] |
241 | 224 | }, |
242 | 225 | { |
243 | 226 | "data": { |
244 | | - "text/plain": [ |
245 | | - "100" |
246 | | - ] |
| 227 | + "text/plain": "100" |
247 | 228 | }, |
248 | | - "execution_count": 12, |
| 229 | + "execution_count": 11, |
249 | 230 | "metadata": {}, |
250 | 231 | "output_type": "execute_result" |
251 | 232 | } |
|
264 | 245 | }, |
265 | 246 | { |
266 | 247 | "cell_type": "code", |
267 | | - "execution_count": 13, |
| 248 | + "execution_count": 12, |
268 | 249 | "metadata": {}, |
269 | 250 | "outputs": [ |
270 | 251 | { |
271 | 252 | "name": "stdout", |
272 | 253 | "output_type": "stream", |
273 | 254 | "text": [ |
274 | | - "CPU times: user 116 µs, sys: 158 µs, total: 274 µs\n", |
275 | | - "Wall time: 173 µs\n" |
| 255 | + "CPU times: user 280 µs, sys: 570 µs, total: 850 µs\n", |
| 256 | + "Wall time: 687 µs\n" |
276 | 257 | ] |
277 | 258 | }, |
278 | 259 | { |
279 | 260 | "data": { |
280 | | - "text/plain": [ |
281 | | - "101" |
282 | | - ] |
| 261 | + "text/plain": "101" |
283 | 262 | }, |
284 | | - "execution_count": 13, |
| 263 | + "execution_count": 12, |
285 | 264 | "metadata": {}, |
286 | 265 | "output_type": "execute_result" |
287 | 266 | } |
|
311 | 290 | }, |
312 | 291 | { |
313 | 292 | "cell_type": "code", |
314 | | - "execution_count": 14, |
| 293 | + "execution_count": 13, |
315 | 294 | "metadata": {}, |
316 | 295 | "outputs": [ |
317 | 296 | { |
318 | 297 | "data": { |
319 | | - "text/plain": [ |
320 | | - "{'info1': 'This is an example', 'info2': 'of user meta handling'}" |
321 | | - ] |
| 298 | + "text/plain": "{b'info1': 'This is an example', b'info2': 'of user meta handling'}" |
322 | 299 | }, |
323 | | - "execution_count": 14, |
| 300 | + "execution_count": 13, |
324 | 301 | "metadata": {}, |
325 | 302 | "output_type": "execute_result" |
326 | 303 | } |
|
340 | 317 | }, |
341 | 318 | { |
342 | 319 | "cell_type": "code", |
343 | | - "execution_count": 15, |
| 320 | + "execution_count": 14, |
344 | 321 | "metadata": {}, |
345 | 322 | "outputs": [ |
346 | 323 | { |
347 | 324 | "data": { |
348 | | - "text/plain": [ |
349 | | - "{'info2': 'of user meta handling'}" |
350 | | - ] |
| 325 | + "text/plain": "{b'info2': 'of user meta handling'}" |
351 | 326 | }, |
352 | | - "execution_count": 15, |
| 327 | + "execution_count": 14, |
353 | 328 | "metadata": {}, |
354 | 329 | "output_type": "execute_result" |
355 | 330 | } |
|
363 | 338 | "cell_type": "markdown", |
364 | 339 | "metadata": {}, |
365 | 340 | "source": [ |
366 | | - "That's all for now. There are more examples in the examples directory for you to explore. Enjoy!" |
| 341 | + "That's all for now. There are more examples in the `examples/` directory for you to explore. Enjoy!" |
367 | 342 | ] |
368 | 343 | } |
369 | 344 | ], |
|
0 commit comments