|
28 | 28 | "This [book on git](https://git-scm.com/book/en/v2/Getting-Started-The-Command-Line) serves as a complete reference for the system and is an excellent source of information with many examples.\n", |
29 | 29 | "\n", |
30 | 30 | "```{admonition} Exercise\n", |
31 | | - "Create an account on GitHub. \n", |
32 | | - "It is strongly recommended that you use the command line interface, so if you're using Windows, please make sure you have access to a unix-based terminal, via e.g. the [Windows Subsystem for Linux](https://learn.microsoft.com/en-us/windows/wsl/about), or [Cygwin](https://www.cygwin.com), or the Windows Terminal, or Git Bash, etc.\n", |
33 | | - "Then share your username with the instructor so you can be added to our GitHub classroom.\n", |
| 31 | + "1. Create an account on GitHub.\n", |
| 32 | + "2. It is strongly recommended that you use the command line interface, so if you're using Windows, please make sure you have access to a unix-based terminal, via e.g. the [Windows Subsystem for Linux](https://learn.microsoft.com/en-us/windows/wsl/about), or [Cygwin](https://www.cygwin.com), or the Windows Terminal, or Git Bash, etc. To install it,\n", |
| 33 | + "```bash \n", |
| 34 | + "sudo apt-get install git\n", |
| 35 | + "```\n", |
| 36 | + "on Linux, or\n", |
| 37 | + "```bash\n", |
| 38 | + "brew install git\n", |
| 39 | + "```\n", |
| 40 | + "on MacOS.\n", |
34 | 41 | "```\n", |
35 | 42 | "\n", |
36 | 43 | "### 2.1.1 Repositories, cloning and forking\n", |
|
95 | 102 | "\n", |
96 | 103 | "```{admonition} \n", |
97 | 104 | ":class: warning\n", |
98 | | - "Avoid storing binary files on GitHub, as even incremental changes to these result in large commits and you'll run out of your storage/bandwidth quota.\n", |
| 105 | + "Avoid storing binary files (e.g *.pdf, *.o) on GitHub, as even incremental changes to these result in large commits and you'll run out of your storage/bandwidth quota.\n", |
99 | 106 | "```\n", |
100 | 107 | "\n", |
101 | 108 | "It is good practice to add an **informative** commit message so that future you can understand what changes were made in a commit. \n", |
|
119 | 126 | "2. Examples\n", |
120 | 127 | "3. API- (application programmer's interface) level documentation\n", |
121 | 128 | "\n", |
122 | | - "In-line comments may be enough for yourself to understand code that you wrote a few months back, but is insufficient in general. A much better practice is to write a _docstring_, a short description for each function, which has the following general structure (regardless of programming language, though shown in Python):\n", |
| 129 | + "In-line comments may be enough for yourself to understand code that you wrote a few months back, and they are useful, but insufficient on their own. A much better practice is to write a _docstring_, a short description for each function, which has the following general structure (regardless of programming language, though shown in Python):\n", |
123 | 130 | "\n", |
124 | 131 | "- A short description of the function,\n", |
125 | 132 | "- Input parameters with types and a brief description (e.g. any restrictions, default values, physical/mathematical meaning),\n", |
|
156 | 163 | "id": "75a3eb2a", |
157 | 164 | "metadata": {}, |
158 | 165 | "source": [ |
159 | | - "If you write docstrings in the above format (which is called the NumPy format), or a different standardized format such as the Google format, it can be converted to API documentation automatically. For example, [this C++/Python software package](https://oscode.readthedocs.io/en/latest/) has API documentation that was auto-generated from docstrings. Docstrings may contain math formulae, or more complicated examples, see e.g the SciPy documentation." |
| 166 | + "If you write docstrings in the above format (which is called the NumPy format), or a different standardized format such as the Google format, it can be converted to API documentation automatically. For example, [this C++/Python software package](https://oscode.readthedocs.io/en/latest/) has API documentation that was auto-generated from docstrings. Docstrings may contain math formulae, or more complicated examples, see e.g the [SciPy documentation](https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.solve_ivp.html) (click on \"source\" near the name of the function the link leads you to and you'll see that it was all generated from a docstring)." |
160 | 167 | ] |
161 | 168 | }, |
162 | 169 | { |
|
176 | 183 | }, |
177 | 184 | { |
178 | 185 | "cell_type": "markdown", |
179 | | - "id": "f2befda8", |
| 186 | + "id": "e942dc2f-9e2d-4a79-8e1c-63adf3f13a67", |
180 | 187 | "metadata": {}, |
181 | 188 | "source": [ |
182 | 189 | "```{admonition} Exercises\n", |
183 | 190 | ":class: danger\n", |
184 | | - "For exercises on writing docstrings and unit tests, please see the [Git and GitHub tutorial repository](https://github.com/cu-comptools/git-tutorial-2025).\n", |
| 191 | + "1. For this exercise, you'll need to clone the repository at `https://github.com/cu-comptools/gh-tutorial`.\n", |
| 192 | + "\n", |
| 193 | + "\n", |
185 | 194 | "```" |
186 | 195 | ] |
187 | | - }, |
188 | | - { |
189 | | - "cell_type": "code", |
190 | | - "execution_count": null, |
191 | | - "id": "bebd8bfe", |
192 | | - "metadata": {}, |
193 | | - "outputs": [], |
194 | | - "source": [] |
195 | 196 | } |
196 | 197 | ], |
197 | 198 | "metadata": { |
|
210 | 211 | "name": "python", |
211 | 212 | "nbconvert_exporter": "python", |
212 | 213 | "pygments_lexer": "ipython3", |
213 | | - "version": "3.10.16" |
| 214 | + "version": "3.12.3" |
214 | 215 | } |
215 | 216 | }, |
216 | 217 | "nbformat": 4, |
|
0 commit comments