Skip to content

Commit d1f9808

Browse files
committed
fix #568 : updated the tutorial notebook about Session objects
1 parent 57c806c commit d1f9808

File tree

6 files changed

+538
-104
lines changed

6 files changed

+538
-104
lines changed
38.7 KB
Loading

doc/source/changes/version_0_30.rst.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ Miscellaneous improvements
216216
* added documentation and examples for :py:obj:`where()`, :py:obj:`maximum()`
217217
and :py:obj:`minimum()` functions (closes :issue:`700`)
218218

219+
* updated the ``Working With Sessions`` section of the tutorial (closes :issue:`568`).
220+
219221

220222
Fixes
221223
-----

doc/source/tutorial/tutorial_presenting_larray_objects.ipyml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,6 @@ cells:
9999

100100
A ``LArray`` object represents a multidimensional array with labeled axes.
101101

102-
See the [LArray](../api.rst#larray) section of the API Reference to explore all methods of LArray objects.
103-
104-
To know how to save and load arrays in CSV, Excel or HDF format, please refer to the [Loading and Dumping Arrays](tutorial_IO.ipynb#Loading-and-Dumping-Arrays) section of the tutorial.
105-
106102
### Create an array from scratch
107103

108104
To create an array from scratch, you need to provide the data and a list
@@ -151,7 +147,7 @@ cells:
151147
- markdown: |
152148
### Array creation functions
153149

154-
Arrays can also be generated in an easier way through creation functions (#ref needed):
150+
Arrays can also be generated in an easier way through [creation functions](../api.rst#array-creation-functions):
155151

156152
- `ndtest` : creates a test array with increasing numbers as data
157153
- `empty` : creates an array but leaves its allocated memory
@@ -290,17 +286,19 @@ cells:
290286
```
291287

292288

289+
- markdown: |
290+
### More on LArray objects
291+
292+
To know how to save and load arrays in CSV, Excel or HDF format, please refer to the [Loading and Dumping Arrays](tutorial_IO.ipynb#Loading-and-Dumping-Arrays) section of the tutorial.
293+
294+
See the [LArray](../api.rst#larray) section of the API Reference to explore all methods of LArray objects.
295+
296+
293297
- markdown: |
294298
## Session
295299

296300
A ``Session`` object is a dictionary-like object used to gather several arrays, axes and groups.
297301
A session is particularly adapted to gather all input objects of a model or to gather the output arrays from different scenarios. Like with arrays, it is possible to associate metadata to sessions.
298-
299-
See the [Session](../api.rst#session) section of the API Reference to explore all methods of Session objects.
300-
301-
To know how to save and load sessions in CSV, Excel or HDF format, please refer to the [Loading and Dumping Sessions](tutorial_IO.ipynb#Loading-and-Dumping-Sessions) section of the tutorial.
302-
303-
To see how to work with sessions, please read the [Working With Sessions](tutorial_sessions.ipynb#Working-With-Sessions) section of the tutorial.
304302

305303

306304
- markdown: |
@@ -326,7 +324,7 @@ cells:
326324

327325
# add metadata after creation
328326
s_pop.meta.title = 'Demographic Model of Belgium'
329-
s_pop.meta.description = 'Modelize the demography of Belgium'
327+
s_pop.meta.description = 'Models the demography of Belgium'
330328

331329
# print content of the session
332330
print(s_pop.summary())
@@ -370,6 +368,16 @@ cells:
370368
</div>
371369

372370

371+
- markdown: |
372+
### More on Session objects
373+
374+
To know how to save and load sessions in CSV, Excel or HDF format, please refer to the [Loading and Dumping Sessions](tutorial_IO.ipynb#Loading-and-Dumping-Sessions) section of the tutorial.
375+
376+
To see how to work with sessions, please read the [Working With Sessions](tutorial_sessions.ipynb#Working-With-Sessions) section of the tutorial.
377+
378+
Finally, see the [Session](../api.rst#session) section of the API Reference to explore all methods of Session objects.
379+
380+
373381
# The lines below here may be deleted if you do not need them.
374382
# ---------------------------------------------------------------------------
375383
metadata:

doc/source/tutorial/tutorial_presenting_larray_objects.ipynb

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,6 @@
156156
"\n",
157157
"A ``LArray`` object represents a multidimensional array with labeled axes.\n",
158158
"\n",
159-
"See the [LArray](../api.rst#larray) section of the API Reference to explore all methods of LArray objects.\n",
160-
"\n",
161-
"To know how to save and load arrays in CSV, Excel or HDF format, please refer to the [Loading and Dumping Arrays](tutorial_IO.ipynb#Loading-and-Dumping-Arrays) section of the tutorial.\n",
162-
"\n",
163159
"### Create an array from scratch\n",
164160
"\n",
165161
"To create an array from scratch, you need to provide the data and a list\n",
@@ -227,7 +223,7 @@
227223
"source": [
228224
"### Array creation functions\n",
229225
"\n",
230-
"Arrays can also be generated in an easier way through creation functions (#ref needed):\n",
226+
"Arrays can also be generated in an easier way through [creation functions](../api.rst#array-creation-functions):\n",
231227
"\n",
232228
"- `ndtest` : creates a test array with increasing numbers as data\n",
233229
"- `empty` : creates an array but leaves its allocated memory\n",
@@ -470,16 +466,21 @@
470466
"cell_type": "markdown",
471467
"metadata": {},
472468
"source": [
473-
"## Session\n",
469+
"### More on LArray objects\n",
474470
"\n",
475-
"A ``Session`` object is a dictionary-like object used to gather several arrays, axes and groups. \n",
476-
"A session is particularly adapted to gather all input objects of a model or to gather the output arrays from different scenarios. Like with arrays, it is possible to associate metadata to sessions.\n",
477-
"\n",
478-
"See the [Session](../api.rst#session) section of the API Reference to explore all methods of Session objects.\n",
471+
"To know how to save and load arrays in CSV, Excel or HDF format, please refer to the [Loading and Dumping Arrays](tutorial_IO.ipynb#Loading-and-Dumping-Arrays) section of the tutorial.\n",
479472
"\n",
480-
"To know how to save and load sessions in CSV, Excel or HDF format, please refer to the [Loading and Dumping Sessions](tutorial_IO.ipynb#Loading-and-Dumping-Sessions) section of the tutorial.\n",
473+
"See the [LArray](../api.rst#larray) section of the API Reference to explore all methods of LArray objects."
474+
]
475+
},
476+
{
477+
"cell_type": "markdown",
478+
"metadata": {},
479+
"source": [
480+
"## Session\n",
481481
"\n",
482-
"To see how to work with sessions, please read the [Working With Sessions](tutorial_sessions.ipynb#Working-With-Sessions) section of the tutorial.\n"
482+
"A ``Session`` object is a dictionary-like object used to gather several arrays, axes and groups. \n",
483+
"A session is particularly adapted to gather all input objects of a model or to gather the output arrays from different scenarios. Like with arrays, it is possible to associate metadata to sessions."
483484
]
484485
},
485486
{
@@ -513,7 +514,7 @@
513514
"\n",
514515
"# add metadata after creation\n",
515516
"s_pop.meta.title = 'Demographic Model of Belgium'\n",
516-
"s_pop.meta.description = 'Modelize the demography of Belgium'\n",
517+
"s_pop.meta.description = 'Models the demography of Belgium'\n",
517518
"\n",
518519
"# print content of the session\n",
519520
"print(s_pop.summary())"
@@ -567,6 +568,19 @@
567568
"\n",
568569
"</div>\n"
569570
]
571+
},
572+
{
573+
"cell_type": "markdown",
574+
"metadata": {},
575+
"source": [
576+
"### More on Session objects\n",
577+
"\n",
578+
"To know how to save and load sessions in CSV, Excel or HDF format, please refer to the [Loading and Dumping Sessions](tutorial_IO.ipynb#Loading-and-Dumping-Sessions) section of the tutorial.\n",
579+
"\n",
580+
"To see how to work with sessions, please read the [Working With Sessions](tutorial_sessions.ipynb#Working-With-Sessions) section of the tutorial.\n",
581+
"\n",
582+
"Finally, see the [Session](../api.rst#session) section of the API Reference to explore all methods of Session objects."
583+
]
570584
}
571585
],
572586
"metadata": {

0 commit comments

Comments
 (0)