Skip to content

Commit c0a21c7

Browse files
committed
updates before class
1 parent 79d822c commit c0a21c7

File tree

4 files changed

+54
-17
lines changed

4 files changed

+54
-17
lines changed

content/01-python/basics.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ Some resources for practicing on your own:
2121

2222
## Online books:
2323

24-
* [Think python](http://www.greenteapress.com/thinkpython/)
24+
* [Think python](https://greenteapress.com/wp/think-python-3rd-edition/)
2525

26-
* [Dive into Python](http://www.diveintopython.net/)
26+
* [Dive into Python](https://diveintopython3.net/)
2727

2828
* [SciPy Lecture Notes](http://scipy-lectures.github.io/)
2929

@@ -36,7 +36,7 @@ Some resources for practicing on your own:
3636

3737
* Astronomy: [AstroPy](http://astropy.org)
3838

39-
* Atmospheric sciences: [PyAOS](http://pyaos.johnny-lin.com/)
39+
* Atmospheric sciences: [PyAOS](https://pyaos.github.io/)
4040

4141
* Biology: [Biopython](http://biopython.org/)
4242

content/01-python/installing.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ https://www.anaconda.com/products/individual
2323

2424
This will install everything that you need.
2525

26+
```{tip}
2627
If you have trouble getting a local install working, most of the class
2728
material will work automatically in the cloud, either on
2829
[binder](https://mybinder.org/) or [google
2930
colab](https://research.google.com/colaboratory/).
31+
```
3032

3133
If you have python successfully installed, you should be able to start
3234
the python interpreter at the command line as: `python`. A shell will

content/01-python/w1-jupyter.ipynb

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,30 @@
2121
"cell_type": "markdown",
2222
"metadata": {},
2323
"source": [
24-
"We interact with python by typing into _cells_ in the notebook. By default, a cell is a _code_ cell, which means that you can enter any valid python code into it and run it. Another important type of cell is a _markdown_ cell. This lets you put text, with different formatting (italics, bold, etc) that describes what the notebook is doing.\n",
24+
"````{note}\n",
25+
"There are several interfaces to [Jupyter](https://jupyter.org/).\n",
2526
"\n",
26-
"You can change the cell type via the menu at the top, or using the shortcuts:\n",
27+
"We will use *JupyterLab*, which is traditionally started at the command line via:\n",
28+
"```\n",
29+
"jupyter lab\n",
30+
"```\n",
2731
"\n",
28-
" * ctrl-m m : mark down cell\n",
29-
" * ctrl-m y : code cell"
32+
"The older (classic) interface is *Jupyter Notebook*, which can be started via:\n",
33+
"```\n",
34+
"jupyter notebook\n",
35+
"```\n",
36+
"````"
3037
]
3138
},
3239
{
3340
"cell_type": "markdown",
3441
"metadata": {},
3542
"source": [
36-
"Some useful short-cuts:\n",
43+
"We interact with python by typing into _cells_ in the notebook. \n",
3744
"\n",
38-
" * shift+enter = run cell and jump to the next (creating a new cell if there is no other new one)\n",
39-
" * ctrl+enter = run cell-in place\n",
40-
" * alt+enter = run cell and insert a new one below\n",
45+
"By default, a cell is a _code_ cell, which means that you can enter any valid python code into it and run it. \n",
4146
"\n",
42-
"ctrl+m h lists other commands"
47+
"Another important type of cell is a _markdown_ cell. This lets you put text, with different formatting (italics, bold, etc) that describes what the notebook is doing."
4348
]
4449
},
4550
{
@@ -51,6 +56,29 @@
5156
"$$\\frac{\\partial \\rho}{\\partial t} + \\nabla \\cdot (\\rho U) = 0$$"
5257
]
5358
},
59+
{
60+
"cell_type": "markdown",
61+
"metadata": {},
62+
"source": [
63+
"```{tip}\n",
64+
"You can change the cell type via the menu at the top, or using the shortcuts:\n",
65+
"\n",
66+
" * ctrl-m m : mark down cell\n",
67+
" * ctrl-m y : code cell\n",
68+
"```"
69+
]
70+
},
71+
{
72+
"cell_type": "markdown",
73+
"metadata": {},
74+
"source": [
75+
"Some useful short-cuts:\n",
76+
"\n",
77+
" * shift+enter = run cell and jump to the next (creating a new cell if there is no other new one)\n",
78+
" * ctrl+enter = run cell-in place\n",
79+
" * alt+enter = run cell and insert a new one below"
80+
]
81+
},
5482
{
5583
"cell_type": "markdown",
5684
"metadata": {},
@@ -148,7 +176,7 @@
148176
"name": "python",
149177
"nbconvert_exporter": "python",
150178
"pygments_lexer": "ipython3",
151-
"version": "3.11.6"
179+
"version": "3.13.1"
152180
}
153181
},
154182
"nbformat": 4,

content/01-python/w1-python-datatypes.ipynb

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
"source": [
114114
"```{note}\n",
115115
"Integer division is one place where python and other programming languages differ.\n",
116-
"In python, dividing 2 integers results in a float. In C/C++/Fortran, dividing 2 integers results in an integer, so `1/2 = 0`.\n",
116+
"In python, dividing two integers results in a float. In C/C++/Fortran, dividing two integers results in an integer, so `1/2 = 0`.\n",
117117
"```"
118118
]
119119
},
@@ -501,13 +501,20 @@
501501
"cell_type": "markdown",
502502
"metadata": {},
503503
"source": [
504-
"It is important to understand that since there are infinitely many real numbers between any two bounds, on a computer we have to approximate this by a finite number. There is an IEEE standard for floating point that pretty much all languages and processors follow. \n",
504+
"```{important}\n",
505+
"Not every number can be represented in floating point. Since there are infinitely many real numbers between any two bounds but we are using a finite amount of memory, on a computer we have to approximate numbers. There is an IEEE standard for floating point that pretty much all languages and processors follow. \n",
505506
"\n",
506507
"The means two things\n",
507508
"\n",
508509
"* not every real number will have an exact representation in floating point\n",
509510
"* there is a finite precision to numbers -- below this we lose track of differences (this is usually called *roundoff* error)\n",
510-
"\n",
511+
"```"
512+
]
513+
},
514+
{
515+
"cell_type": "markdown",
516+
"metadata": {},
517+
"source": [
511518
"Consider the following expression, for example:"
512519
]
513520
},
@@ -537,7 +544,7 @@
537544
"cell_type": "markdown",
538545
"metadata": {},
539546
"source": [
540-
"Here's another example: The number 0.1 cannot be exactly represented on a computer. In our print, we use a format specifier (the stuff inside of the {}) to ask for more precision to be shown:"
547+
"Here's another example: The number 0.1 cannot be exactly represented on a computer. In our print, we use a format specifier (the stuff inside of the `{}`) to ask for more precision to be shown:"
541548
]
542549
},
543550
{

0 commit comments

Comments
 (0)