Skip to content

Commit

Permalink
added github instructions and links
Browse files Browse the repository at this point in the history
  • Loading branch information
kcaylor committed Sep 13, 2024
1 parent 70e3cba commit 48ca420
Show file tree
Hide file tree
Showing 83 changed files with 3,539 additions and 2,240 deletions.
4 changes: 4 additions & 0 deletions course-materials/day8.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ description: "Thursday September 12^th^, 2024"

: {.hover .bordered tbl-colwidths="[20,40,40]"}

## Syncing your classwork to Github

[Here](interactive-sessions/8a_github.qmd) are some directions for syncing your classwork with a GitHub repository

## End-of-day practice

There are no additional end-of-day tasks / activities today!
Expand Down
5 changes: 5 additions & 0 deletions course-materials/day9.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ description: "Friday September 13^th^, 2024"
| day 9 / afternoon | Data Science Project Presentations <br> (all afternoon) | |
: {.hover .bordered tbl-colwidths="[20,40,40]"}

## Syncing your classwork to Github

[Here](interactive-sessions/8a_github.qmd) are some directions for syncing your classwork with a GitHub repository


## End-of-day practice

End of Class! Congratulations!!
Expand Down
6 changes: 5 additions & 1 deletion course-materials/final_project.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,15 @@ You can include visualizations as part of your data exploration (step 2), or any

Additional figures and graphics are also welcome - you are encouraged to make your notebooks as engaging and visually interesting as possible.

Here are some links to potential data resources that you can use to develop your analyses:
## Syncing your data to Github

[Here](interactive-sessions/8a_github.qmd) are some directions for syncing your classwork with GitHub


### General places to find fun data

Here are some links to potential data resources that you can use to develop your analyses:

- [Kaggle](https://www.kaggle.com/datasets?fileType=csv)
- [Data is Plural](https://www.data-is-plural.com/)
- [US Data.gov](https://data.gov/)
Expand Down
147 changes: 147 additions & 0 deletions course-materials/interactive-sessions/8a_github.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
---
title: "Interactive Session"
subtitle: "Creating a GitHub Repository for Your EDS 217 Course Work"
jupyter: eds217_2024
format:
html:
toc: true
toc-depth: 3
code-fold: show
---

## Introduction

This session contains detailed instructions for creating a new GitHub repository and pushing your EDS 217 course work to it. It also covers how to clean your Jupyter notebooks before committing them to ensure your repository is clean and professional.

:::{.callout-warning}
Jupyter notebooks files can be hard to use in github because they contain information about code execution order and output in the file. For this reason, you should clean notebooks before pushing them to a github repo. We will clean them using the `nbstripout` python package
:::

## Steps to Setting up a GitHub repo for your coursework:

1. Create a new repository on GitHub
2. Initialize a local Git repository
3. Clean Jupyter notebooks of output and execution data
4. Add, commit, and push files to a GitHub repository

## Creating a New GitHub Repository

Let's start by creating a new repository on GitHub:

1. Log in to your GitHub account
2. Click the '+' icon in the top-right corner and select 'New repository'
3. Name your repository (e.g., "EDS-217-Course-Work")
4. Add a description (optional)
5. Choose to make the repository public or private
6. Don't initialize the repository with a README, .gitignore, or license
7. Click 'Create repository'

After creating the repository, you'll see a page with instructions. We'll use these in the next steps.

## Initializing a Local Git Repository

Now, let's set up your local directory as a Git repository:


1. Open a terminal on the class `workbench` server
2. Navigate to your course work directory:

```{python}
#| echo: true
#| eval: false
cd path/to/your/EDS-217
```

3. Initialize the repository:

```{python}
#| echo: true
#| eval: false
git init
```

4. Add your GitHub repository as the remote origin:

```{python}
#| echo: true
#| eval: false
git remote add origin https://github.com/your-username/EDS-217-Course-Work.git
```

Replace `your-username` with your actual GitHub username.

## Cleaning Jupyter Notebooks

Before we commit our notebooks, let's clean them to remove output cells and execution data:

1. Install the `nbstripout` tool if you haven't already:

```{python}
#| echo: true
#| eval: false
pip install nbstripout
```

2. Configure `nbstripout` for your repository:

```{python}
#| echo: true
#| eval: false
nbstripout --install --attributes .gitattributes
```

This sets up `nbstripout` to automatically clean your notebooks when you commit them.

## Adding, Committing, and Pushing Files

Now we're ready to add our files to the repository:

1. Add all files in the directory:

```{python}
#| echo: true
#| eval: false
git add .
```

2. Commit the files:

```{python}
#| echo: true
#| eval: false
git commit -m "Initial commit: Adding EDS 217 course work"
```

3. Push the files to GitHub:

```{python}
#| echo: true
#| eval: false
git push -u origin main
```

Note: If your default branch is named "master" instead of "main", use `git push -u origin master`.

## Verifying Your Repository

1. Go to your GitHub repository page in your web browser
2. Refresh the page
3. You should now see all your course files listed in the repository

## Conclusion

Congratulations! You've successfully created a GitHub repository for your EDS 217 course work, cleaned your Jupyter notebooks, and pushed your files to GitHub. This process helps you maintain a clean, professional repository of your work that you can easily share or refer back to in the future.

## Additional Resources

- [GitHub Docs: Creating a new repository](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-new-repository)
- [Git Documentation](https://git-scm.com/doc)
- [nbstripout Documentation](https://github.com/kynan/nbstripout)
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ <h3 class="anchored" data-anchor-id="task-1-list-operations">Task 1: List Operat
<li>Remove the second fruit from the list.</li>
<li>Print the final list.</li>
</ol>
<div id="69086262" class="cell" data-execution_count="1">
<div id="87aa1c8a" class="cell" data-execution_count="1">
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Example code for instructor</span></span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a>fruits <span class="op">=</span> [<span class="st">"apple"</span>, <span class="st">"banana"</span>, <span class="st">"cherry"</span>]</span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="bu">print</span>(<span class="st">"Original list:"</span>, fruits)</span>
Expand Down Expand Up @@ -512,7 +512,7 @@ <h3 class="anchored" data-anchor-id="task-2-dictionary-operations">Task 2: Dicti
<li>Update the quantity of an existing item.</li>
<li>Print the final inventory.</li>
</ol>
<div id="e41e5832" class="cell" data-execution_count="2">
<div id="93609349" class="cell" data-execution_count="2">
<div class="sourceCode cell-code" id="cb3"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Example code for instructor</span></span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a>inventory <span class="op">=</span> {</span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a> <span class="st">"apples"</span>: <span class="dv">50</span>,</span>
Expand Down Expand Up @@ -549,7 +549,7 @@ <h3 class="anchored" data-anchor-id="task-3-creating-and-manipulating-sets">Task
<li>Find and print the intersection of the two sets.</li>
<li>Add a new element to the <code>evens</code> set.</li>
</ol>
<div id="12023436" class="cell" data-execution_count="3">
<div id="71e7a648" class="cell" data-execution_count="3">
<div class="sourceCode cell-code" id="cb5"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Example code for instructor</span></span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a>evens <span class="op">=</span> {<span class="dv">2</span>, <span class="dv">4</span>, <span class="dv">6</span>, <span class="dv">8</span>, <span class="dv">10</span>}</span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a>odds <span class="op">=</span> {<span class="dv">1</span>, <span class="dv">3</span>, <span class="dv">5</span>, <span class="dv">7</span>, <span class="dv">9</span>}</span>
Expand Down Expand Up @@ -583,7 +583,7 @@ <h3 class="anchored" data-anchor-id="task-4-set-operations-vs.-list-operations">
<li>Use a list comprehension to remove duplicates.</li>
<li>Print the results of both methods.</li>
</ol>
<div id="73c60b9e" class="cell" data-execution_count="4">
<div id="ec2a3e8c" class="cell" data-execution_count="4">
<div class="sourceCode cell-code" id="cb7"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Example code for instructor</span></span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a>numbers <span class="op">=</span> [<span class="dv">1</span>, <span class="dv">2</span>, <span class="dv">2</span>, <span class="dv">3</span>, <span class="dv">3</span>, <span class="dv">3</span>, <span class="dv">4</span>, <span class="dv">4</span>, <span class="dv">5</span>]</span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a></span>
Expand Down
18 changes: 9 additions & 9 deletions docs/course-materials/answer-keys/3b_control_flows-key.html
Original file line number Diff line number Diff line change
Expand Up @@ -470,10 +470,10 @@ <h3 class="anchored" data-anchor-id="task-1-simple-weather-advice">Task 1: Simpl
<li>Otherwise, print “Enjoy the pleasant weather!”</li>
</ul></li>
</ol>
<div id="41527b68" class="cell" data-execution_count="1">
<div id="3a858836" class="cell" data-execution_count="1">
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>temperature <span class="op">=</span> <span class="dv">20</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div id="858298a6" class="cell" data-execution_count="2">
<div id="c93e69fd" class="cell" data-execution_count="2">
<div class="sourceCode cell-code" id="cb3"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="cf">if</span> temperature <span class="op">&gt;</span> <span class="dv">25</span>:</span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a> <span class="bu">print</span>(<span class="st">"It's a hot day, stay hydrated!"</span>)</span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a><span class="cf">else</span>:</span>
Expand All @@ -497,10 +497,10 @@ <h3 class="anchored" data-anchor-id="task-2-grade-classifier">Task 2: Grade Clas
<li>Below 60: “F”</li>
</ul></li>
</ol>
<div id="9cb8ac94" class="cell" data-execution_count="3">
<div id="fbe5b74d" class="cell" data-execution_count="3">
<div class="sourceCode cell-code" id="cb5"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>score <span class="op">=</span> <span class="dv">85</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div id="c22eeb39" class="cell" data-execution_count="4">
<div id="fd9d9982" class="cell" data-execution_count="4">
<div class="sourceCode cell-code" id="cb6"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="cf">if</span> score <span class="op">&gt;=</span> <span class="dv">90</span>:</span>
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a> grade <span class="op">=</span> <span class="st">'A'</span></span>
<span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a><span class="cf">elif</span> score <span class="op">&gt;=</span> <span class="dv">80</span>:</span>
Expand Down Expand Up @@ -528,7 +528,7 @@ <h3 class="anchored" data-anchor-id="task-3-counting-sheep">Task 3: Counting She
<li>Use a for loop with the range() function</li>
<li>Print each number followed by “sheep”</li>
</ol>
<div id="4a2b688c" class="cell" data-execution_count="5">
<div id="008b2c90" class="cell" data-execution_count="5">
<div class="sourceCode cell-code" id="cb8"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> i <span class="kw">in</span> <span class="bu">range</span>(<span class="dv">1</span>,<span class="dv">6</span>):</span>
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a> <span class="bu">print</span>(<span class="ss">f"</span><span class="sc">{</span>i<span class="sc">}</span><span class="ss"> sheep"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
Expand All @@ -548,10 +548,10 @@ <h3 class="anchored" data-anchor-id="task-4-sum-of-numbers">Task 4: Sum of Numbe
<li>Use a for loop with the range() function to add each number to <code>total</code></li>
<li>After the loop, print the total</li>
</ol>
<div id="c652055c" class="cell" data-execution_count="6">
<div id="576799e3" class="cell" data-execution_count="6">
<div class="sourceCode cell-code" id="cb10"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a>total <span class="op">=</span> <span class="dv">0</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div id="54c48e7d" class="cell" data-execution_count="7">
<div id="beb20619" class="cell" data-execution_count="7">
<div class="sourceCode cell-code" id="cb11"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> i <span class="kw">in</span> <span class="bu">range</span>(<span class="dv">1</span>,<span class="dv">11</span>):</span>
<span id="cb11-2"><a href="#cb11-2" aria-hidden="true" tabindex="-1"></a> total <span class="op">=</span> total <span class="op">+</span> i</span>
<span id="cb11-3"><a href="#cb11-3" aria-hidden="true" tabindex="-1"></a></span>
Expand All @@ -573,10 +573,10 @@ <h3 class="anchored" data-anchor-id="task-5-countdown">Task 5: Countdown</h3>
<li>After each print, decrease the countdown by 1</li>
<li>When the countdown reaches 0, print “Blast off!”</li>
</ol>
<div id="d22808e6" class="cell" data-execution_count="8">
<div id="f57693b5" class="cell" data-execution_count="8">
<div class="sourceCode cell-code" id="cb13"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a>countdown <span class="op">=</span> <span class="dv">5</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div id="63c51f2b" class="cell" data-execution_count="9">
<div id="f6ed3639" class="cell" data-execution_count="9">
<div class="sourceCode cell-code" id="cb14"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a><span class="cf">while</span> countdown <span class="op">&gt;</span> <span class="dv">0</span>:</span>
<span id="cb14-2"><a href="#cb14-2" aria-hidden="true" tabindex="-1"></a> <span class="bu">print</span>(countdown)</span>
<span id="cb14-3"><a href="#cb14-3" aria-hidden="true" tabindex="-1"></a> <span class="co"># (-= is a python syntax shortcut inherited from C)</span></span>
Expand Down
Loading

0 comments on commit 48ca420

Please sign in to comment.