|
13 | 13 | "GitHub is a version control system which automates this process. It allows you to roll back to previous versions of your code, make experimental changes on new branches, merge fixes, and work collaboratively on the same codebase.\n", |
14 | 14 | "\n", |
15 | 15 | "```{admonition} Exercise\n", |
16 | | - "Create an account on GitHub. \n", |
17 | | - "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", |
18 | | - "Then share your username with the instructor so you can be added to our GitHub classroom.\n", |
| 16 | + "1. Create an account on GitHub.\n", |
| 17 | + "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", |
| 18 | + "```bash \n", |
| 19 | + "sudo apt-get install git\n", |
| 20 | + "```\n", |
| 21 | + "on Linux, or\n", |
| 22 | + "```bash\n", |
| 23 | + "brew install git\n", |
| 24 | + "```\n", |
| 25 | + "on MacOS.\n", |
19 | 26 | "```\n", |
20 | 27 | "\n", |
21 | 28 | "On GitHub, your code is organized in structures called _repositories_, which you can think of as separate projects. Within a repository, your code may be organized in a directory structure. It is stored \"in the cloud\", meaning on some server somewhere else.\n", |
|
26 | 33 | "\n", |
27 | 34 | "```{admonition} \n", |
28 | 35 | ":class: warning\n", |
29 | | - "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", |
| 36 | + "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", |
30 | 37 | "```\n", |
31 | 38 | "\n", |
32 | 39 | "It is good practice to add an **informative** commit message so that future you can understand what changes were made in a commit. \n", |
|
42 | 49 | "2. Examples\n", |
43 | 50 | "3. API- (application programmer's interface) level documentation\n", |
44 | 51 | "\n", |
45 | | - "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", |
| 52 | + "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", |
46 | 53 | "\n", |
47 | 54 | "- A short description of the function,\n", |
48 | 55 | "- Input parameters with types and a brief description (e.g. any restrictions, default values, physical/mathematical meaning),\n", |
|
79 | 86 | "id": "75a3eb2a", |
80 | 87 | "metadata": {}, |
81 | 88 | "source": [ |
82 | | - "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." |
| 89 | + "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)." |
83 | 90 | ] |
84 | 91 | }, |
85 | 92 | { |
|
98 | 105 | ] |
99 | 106 | }, |
100 | 107 | { |
101 | | - "cell_type": "code", |
102 | | - "execution_count": null, |
103 | | - "id": "339d7ae1", |
| 108 | + "cell_type": "markdown", |
| 109 | + "id": "e942dc2f-9e2d-4a79-8e1c-63adf3f13a67", |
104 | 110 | "metadata": {}, |
105 | | - "outputs": [], |
106 | | - "source": [] |
| 111 | + "source": [ |
| 112 | + "```{admonition} Exercises\n", |
| 113 | + ":class: danger\n", |
| 114 | + "1. For this exercise, you'll need to clone the repository at `https://github.com/cu-comptools/gh-tutorial`.\n", |
| 115 | + "\n", |
| 116 | + "\n", |
| 117 | + "```" |
| 118 | + ] |
107 | 119 | } |
108 | 120 | ], |
109 | 121 | "metadata": { |
110 | 122 | "kernelspec": { |
111 | | - "display_name": "csci700f24", |
| 123 | + "display_name": "Python 3 (ipykernel)", |
112 | 124 | "language": "python", |
113 | | - "name": "csci700f24" |
| 125 | + "name": "python3" |
114 | 126 | }, |
115 | 127 | "language_info": { |
116 | 128 | "codemirror_mode": { |
|
122 | 134 | "name": "python", |
123 | 135 | "nbconvert_exporter": "python", |
124 | 136 | "pygments_lexer": "ipython3", |
125 | | - "version": "3.10.16" |
| 137 | + "version": "3.12.3" |
126 | 138 | } |
127 | 139 | }, |
128 | 140 | "nbformat": 4, |
|
0 commit comments