Skip to content

Commit 02ddc1a

Browse files
committed
initial rewriting of docs
1 parent 0ba4f4c commit 02ddc1a

20 files changed

+363
-286
lines changed

docs/src/check.ipynb

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@
99
"slideshow": {
1010
"slide_type": ""
1111
},
12-
"tags": []
12+
"tags": [],
13+
"vscode": {
14+
"languageId": "raw"
15+
}
1316
},
1417
"source": [
1518
".. important::\n",
16-
" Jupyter widgets cannot be run within in documentation. To be able to interact with the widget you must run a mybinder instance. To run a mybinder instance of this notebook please use this link https://mybinder.org/v2/gh/osscar-org/scicode-widgets/HEAD?labpath=docs%2Fsrc%2Fexercises.ipynb."
19+
" Jupyter widgets cannot be run within the documentation. To interact with the widget, you must run a mybinder instance. To run a mybinder instance of this notebook, please use this link https://mybinder.org/v2/gh/osscar-org/scicode-widgets/HEAD?labpath=docs%2Fsrc%2Fcheck.ipynb."
1720
]
1821
},
1922
{
@@ -29,7 +32,7 @@
2932
"id": "2",
3033
"metadata": {},
3134
"source": [
32-
"Checks intention is to give students a way to validate their code solution. The student's code can be validated by providing a list of inputs and references comparing the output of the student's code with the references, or by directy testing certain functional behavior of the code. In cases when reference outputs need to be obfuscated the outputs that are compared can be passed through a _fingerprint_ function. This notebook goes through each of these features and presents an example."
35+
"The purpose of a check is to give students a way to validate their code solutions. The student's code can be validated by providing a list of inputs and references, which are compared to the output of the student's code, or by directly testing certain functional behavior of the code. In cases when reference outputs need to be obfuscated, the outputs that are compared can be passed through a _fingerprint_ function. This notebook goes through each of these features and presents an example."
3336
]
3437
},
3538
{
@@ -51,7 +54,7 @@
5154
"id": "4",
5255
"metadata": {},
5356
"source": [
54-
"Similar as for the `ExerciseRegistry` we need to define a `CheckRegistry` that registers the checks for each exercise."
57+
"Similar to the `ExerciseRegistry`, we need to define a `CheckRegistry` that registers the checks for each exercise."
5558
]
5659
},
5760
{
@@ -89,7 +92,7 @@
8992
"\n",
9093
"\n",
9194
"check_code_ex = CodeExercise(\n",
92-
" key=\"sinus_with_references_1\",\n",
95+
" key=\"sine_with_references_1\",\n",
9396
" code=sin,\n",
9497
" check_registry=check_registry,\n",
9598
")\n",
@@ -121,7 +124,7 @@
121124
"id": "8",
122125
"metadata": {},
123126
"source": [
124-
"Because there are asserts that are repeatedly needed for almost any kind of exercise, we provide of a set of asserts"
127+
"Since some asserts are frequently needed across various exercises, we provide a common set of asserts."
125128
]
126129
},
127130
{
@@ -139,14 +142,14 @@
139142
" assert_type,\n",
140143
")\n",
141144
"\n",
142-
"def sinus(arr):\n",
145+
"def sine(arr):\n",
143146
" import numpy as np\n",
144147
" return np.cos(arr) # oops! wrong solution\n",
145148
"\n",
146149
"check_code_ex = CodeExercise(\n",
147-
" key=\"sinus_with_references_2\",\n",
148-
" title=\"sinus\",\n",
149-
" code=sinus,\n",
150+
" key=\"sine_with_references_2\",\n",
151+
" title=\"sine\",\n",
152+
" code=sine,\n",
150153
" check_registry=check_registry,\n",
151154
")\n",
152155
"\n",
@@ -216,13 +219,13 @@
216219
},
217220
"outputs": [],
218221
"source": [
219-
"def sinus(arr):\n",
222+
"def sine(arr):\n",
220223
" import numpy as np\n",
221224
" return np.cos(arr) # oops! wrong solution\n",
222225
"\n",
223226
"code_ex_functional_behavior = CodeExercise(\n",
224-
" key=\"sinus_functional_behavior\",\n",
225-
" code=sinus,\n",
227+
" key=\"sine_functional_behavior\",\n",
228+
" code=sine,\n",
226229
" check_registry=check_registry,\n",
227230
")\n",
228231
"\n",
@@ -250,7 +253,7 @@
250253
"tags": []
251254
},
252255
"source": [
253-
"## Obfuscating the reference solution with fingerprint"
256+
"## Obfuscating the reference solution with a fingerprint"
254257
]
255258
},
256259
{
@@ -272,19 +275,19 @@
272275
" \n",
273276
" What has wings but in the air it not swings.\n",
274277
" I looked to the north, but it was not worth.\n",
275-
" What I am looking for?\n",
278+
" What am I looking for?\n",
276279
" \"\"\"\n",
277280
" return \"\"\n",
278-
"code_input_sinus = CodeInput(riddle)\n",
281+
"code_input_sine = CodeInput(riddle)\n",
279282
"\n",
280283
"check_code_ex = CodeExercise(\n",
281284
" key=\"riddle\",\n",
282-
" code=code_input_sinus,\n",
285+
" code=code_input_sine,\n",
283286
" check_registry=check_registry,\n",
284287
")\n",
285288
"\n",
286289
"#def assert_equal(output, reference):\n",
287-
"# return \"\" if output == reference else \"Not correct solution. Hint: it is an animal in the antarctica.\"\n",
290+
"# return \"\" if output == reference else \"Not correct solution. Hint: it is an animal in the Antarctica.\"\n",
288291
"\n",
289292
"char_to_num = {char: num for num, char in enumerate(\"abcdefghijklmnopqrmnstuvwxyz\")}\n",
290293
"def string_to_int(output):\n",
@@ -318,7 +321,7 @@
318321
"id": "18",
319322
"metadata": {},
320323
"source": [
321-
"The check registry also provides the possibility to check all the widgets. "
324+
"The check registry also allows checking of all the widgets simultaneously. "
322325
]
323326
},
324327
{
@@ -338,7 +341,7 @@
338341
"id": "20",
339342
"metadata": {},
340343
"source": [
341-
"For the demo to automatically we simulate a button press using the private function that should not be used"
344+
"For the demo, we simulate a button press using the private function that should not be used"
342345
]
343346
},
344347
{

docs/src/developers.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Developers
22
==========
33

4-
This is an instruction of the developer tools that help you contributing.
4+
This is an instruction of the developer tools that help you contribute.
55

66
Running tests
77
-------------
88

9-
Tests can be with run using
9+
Tests can be run by using
1010

1111
.. code-block:: bash
1212
@@ -21,25 +21,24 @@ You can source the test environment of tox after a run using
2121
Converting notebook test files
2222
##############################
2323

24-
The we store the notebooks as converted Python file using `jupytext` for the conversion
25-
for better versioning
24+
We store the notebooks as converted Python file using `jupytext` for better versioning
2625

2726
.. code-block:: bash
2827
2928
jupytext tests/notebooks/*.py --to ipynb
3029
31-
Be aware that when runnng the tests with tox all `*.ipynb` are overwriten by their
32-
corresponding `*.py` file. For example, the file `test_widget_cue_box.ipynb` is
30+
Be aware that when running the tests with tox all `*.ipynb` are overwritten by the
31+
corresponding `*.py` files. For example, the file `test_widget_cue_box.ipynb` is
3332
overwritten by the conversion of `test_widget_cue_box.py` when running the test.
3433

3534

3635
Running in browser
3736
##################
3837

3938
We use selenium to test the widgets on user actions (like a button click). To run it in
40-
in the CI where no display is available. We run the browsers in headless model to not
41-
load the UI. For debugging a test however, it is often benificial to see what is
42-
happening in the window. To run the tests with the browser UI please use
39+
the CI where no display is available. We run the browsers in the headless mode to not
40+
load the UI. For debugging a test, however, it is often beneficial to see what is
41+
happening in the window. To run the tests with the browser UI, please use
4342

4443
.. code-block:: bash
4544
@@ -48,15 +47,16 @@ happening in the window. To run the tests with the browser UI please use
4847
Port issues
4948
###########
5049

51-
For the notebook server we fixed the port to 8815, if this port is not available you .
52-
It can happen that notebook process is not properly killed and remains as zombie
53-
process. You can check if a notebook with this port is already running using
50+
For the notebook server, we fixed the port to 8815. If this port is not available, you
51+
you need to choose a different one. It can happen that notebook process is not properly
52+
killed and remains as zombie process. You can check if a notebook with the 8815 port
53+
is already running using
5454

5555
.. code-block:: bash
5656
5757
jupyter notebook list | grep 8815
5858
59-
or if some process is using it
59+
or if some other process is using it
6060

6161
.. code-block:: bash
6262
@@ -88,7 +88,7 @@ To build the docs please use
8888
8989
tox -e docs
9090
91-
To open the doc with for example firefox you can run
91+
To open the documentation with Firefox, for example, you can run:
9292

9393
.. code-block:: bash
9494

docs/src/exercises.ipynb

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@
99
"slideshow": {
1010
"slide_type": ""
1111
},
12-
"tags": []
12+
"tags": [],
13+
"vscode": {
14+
"languageId": "raw"
15+
}
1316
},
1417
"source": [
1518
".. important::\n",
16-
" Jupyter widgets cannot be run within in documentation. To be able to interact with the widget you must run a mybinder instance. To run a mybinder instance of this notebook please use this link https://mybinder.org/v2/gh/osscar-org/scicode-widgets/HEAD?labpath=docs%2Fsrc%2Fexercises.ipynb."
19+
" Jupyter widgets cannot be run within the documentation. To interact with the widget, you must run a mybinder instance. To run a mybinder instance of this notebook, please use this link https://mybinder.org/v2/gh/osscar-org/scicode-widgets/HEAD?labpath=docs%2Fsrc%2Fexercises.ipynb."
1720
]
1821
},
1922
{
@@ -72,7 +75,7 @@
7275
"id": "5",
7376
"metadata": {},
7477
"source": [
75-
"Due to limitations of jupyter notebooks in saving the widgets state, we store and load the widget state by ourself using the `ExerciseRegstry`. It allows you specify a filename for the json file to store all the answers to all registered exercises. The exercises are registered by passing the `ExerciseRegstry` instance as input argument."
78+
"Due to limitations of jupyter notebooks in saving the widgets state, we store and load the widget state by ourselves using the `ExerciseRegistry`. It allows you specify a filename for the JSON file to store all the answers to all registered exercises. The exercises are registered by passing the `ExerciseRegistry` instance as input argument."
7679
]
7780
},
7881
{
@@ -101,7 +104,7 @@
101104
"id": "8",
102105
"metadata": {},
103106
"source": [
104-
"A simple textarea to save students answers. Note that the save and load buttons only appear when a exercise key and registry is given"
107+
"A simple text area to save students' answers. Note that the save and load buttons only appear when an exercise key and registry are given."
105108
]
106109
},
107110
{
@@ -138,7 +141,7 @@
138141
"id": "11",
139142
"metadata": {},
140143
"source": [
141-
"This is an example how to create a simple exercise."
144+
"This is an example on how to create a simple exercise."
142145
]
143146
},
144147
{
@@ -197,7 +200,7 @@
197200
"id": "14",
198201
"metadata": {},
199202
"source": [
200-
"More complex widgets might need creation beforehand to allow full customization"
203+
"More complex widgets might need to be created beforehand to allow full customization"
201204
]
202205
},
203206
{
@@ -276,7 +279,7 @@
276279
"id": "17",
277280
"metadata": {},
278281
"source": [
279-
"So far we always added the imports required for the code inside the code input. We need to do this because the widget is its creates its own environment (own globals) so no function from the notebook is accidently used. This however does not solve the problem when one wants to include typehints in the function signature that require imports. For that one can add the library to the globals."
282+
"So far we always added the imports required for the code inside the code input. We need to do this because the widget is its creates its own environment (own globals), so no function from the notebook is accidently used. However, this does not solve the problem when one wants to include typehints in the function signature that require imports. For this, one can add the library to the globals."
280283
]
281284
},
282285
{
@@ -387,7 +390,7 @@
387390
"id": "23",
388391
"metadata": {},
389392
"source": [
390-
"The `ParametersPanel` can be also used with the same shorthand constructors as [interact](https://ipywidgets.readthedocs.io/en/latest/examples/Using%20Interact.html). Here some examples"
393+
"The `ParametersPanel` can be also used with the same shorthand constructors as [interact](https://ipywidgets.readthedocs.io/en/latest/examples/Using%20Interact.html). Here are some examples."
391394
]
392395
},
393396
{
@@ -413,7 +416,7 @@
413416
],
414417
"metadata": {
415418
"kernelspec": {
416-
"display_name": "Python 3 (ipykernel)",
419+
"display_name": "scicode",
417420
"language": "python",
418421
"name": "python3"
419422
},
@@ -427,7 +430,7 @@
427430
"name": "python",
428431
"nbconvert_exporter": "python",
429432
"pygments_lexer": "ipython3",
430-
"version": "3.11.10"
433+
"version": "3.11.11"
431434
}
432435
},
433436
"nbformat": 4,

0 commit comments

Comments
 (0)