Skip to content

Commit

Permalink
differences for PR #21
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jan 30, 2025
1 parent 1b273b8 commit baead85
Show file tree
Hide file tree
Showing 4 changed files with 199 additions and 40 deletions.
1 change: 1 addition & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ episodes:

# Information for Learners
learners:
- setup.md

# Information for Instructors
instructors:
Expand Down
5 changes: 2 additions & 3 deletions md5sum.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"file" "checksum" "built" "date"
"CODE_OF_CONDUCT.md" "c93c83c630db2fe2462240bf72552548" "site/built/CODE_OF_CONDUCT.md" "2022-08-05"
"LICENSE.md" "b24ebbb41b14ca25cf6b8216dda83e5f" "site/built/LICENSE.md" "2023-04-07"
"config.yaml" "e3e4437a746e9ff33e1eb98311c8eac1" "site/built/config.yaml" "2025-01-16"
"config.yaml" "abf56b0cd041899c22cecb11235b639b" "site/built/config.yaml" "2025-01-30"
"index.md" "447e37bf2e1d5254609dbb0fa9409b16" "site/built/index.md" "2024-10-24"
"links.md" "8184cf4149eafbf03ce8da8ff0778c14" "site/built/links.md" "2022-04-22"
"episodes/introduction.md" "1cf3c7fc50b2f6ddaf448fbd9e5f90b1" "site/built/introduction.md" "2024-12-19"
Expand All @@ -20,6 +20,5 @@
"episodes/documentation.md" "fac7ff65d88edb23b07b277032e573d6" "site/built/documentation.md" "2024-12-13"
"episodes/hot-takes.md" "49a06cdbf6547f63a9f5516b10c7ac99" "site/built/hot-takes.md" "2024-12-13"
"instructors/instructor-notes.md" "cae72b6712578d74a49fea7513099f8c" "site/built/instructor-notes.md" "2023-03-16"
"learners/reference.md" "1c7cc4e229304d9806a13f69ca1b8ba4" "site/built/reference.md" "2023-03-16"
"learners/setup.md" "5456593e4a75491955ac4a252c05fbc9" "site/built/setup.md" "2024-01-26"
"learners/setup.md" "0cb6a3afef0e18dfb8bf6b7d03ff427e" "site/built/setup.md" "2025-01-30"
"profiles/learner-profiles.md" "acbbe2d0c836bc6c4d78ca6a97cdb33a" "site/built/learner-profiles.md" "2024-12-13"
8 changes: 0 additions & 8 deletions reference.md

This file was deleted.

225 changes: 196 additions & 29 deletions setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,220 @@
title: Setup
---

FIXME: Setup instructions live in this document. Please specify the tools and
the data sets the Learner needs to have installed.
## Summary - TODO

## Data Sets
::: prereq

<!--
FIXME: place any data you want learners to use in `episodes/data` and then use
a relative link ( [data zip file](data/lesson-data.zip) ) to provide a
link to it, replacing the example.com link.
-->
Download the [data zip file](https://example.com/FIXME) and unzip it to your Desktop
### Prerequisite Python knowledge
This lesson assumes an introductory knowledge of Python and the `pandas` library. Participants should:

## Software Setup
* be comfortable reading CSV files into Pandas DataFrames
* be able to do basic data transformations in Pandas: for instance, renaming columns, merging two datasets on a shared column, or multiplying a column by a scalar value.
* be able to save transformed Pandas DataFrames locally (e.g., as a CSV)
* be able to create simple graphs in Python
* be able to write a simple function

::::::::::::::::::::::::::::::::::::::: discussion
These skills are equivalent to the completion of the [Data Analysis and Visualization in
Python for Ecologists](https://datacarpentry.github.io/python-ecology-lesson/) lesson. If you
haven’t already completed this lesson and aren’t familiar with the skills listed above, please
review those materials before starting this lesson.

### Details
### Prerequisite Git knowledge
This lesson assumes `git` is installed locally, and that participants have a basic
familiarity with the `git` version control command-line tool. Participants should be able to:
* create a local Git repository
* use commits to track changes in files
* push to and pull from a remote repository

Setup for different systems can be presented in dropdown menus via a `spoiler`
tag. They will join to this discussion block, so you can give a general overview
of the software used in this lesson here and fill out the individual operating
systems (and potentially add more, e.g. online setup) in the solutions blocks.
These skills are covered in the Software Carpentries' [Version Control with Git](https://swcarpentry.github.io/git-novice/) lesson. If you aren't familiar with the skills listed above, please review
those materials before starting this lesson.

:::::::::::::::::::::::::::::::::::::::::::::::::::
### Other prerequisite knowledge
Throughout this lesson, we'll be working with a variety of energy datasets. In order to
get the most out of this lesson, we expect that participants:
* have some domain knowledge about the energy sector (e.g., are studying energy systems
in university).
* have energy-relevant research questions that you want to answer using data

:::::::::::::::: spoiler
Though these are not *mandatory* for participation in the lesson, we believe these skills
are critical to interpreting the data and applying the skills learned in these lessons
to your own work.

### Windows
:::

Use PuTTY
## Setup: Overview

::::::::::::::::::::::::
This lesson is designed to be run on a personal computer.
All of the software and data used in this lesson are freely available online,
and instructions on how to obtain them are provided below.

:::::::::::::::: spoiler
## Obtain lesson materials

### MacOS
In the terminal, navigate to the directory where you want to save the lesson materials.
Clone the lesson repository using the `git clone` command:

Use Terminal.app
```bash
git clone https://github.com/catalyst-cooperative/open-energy-data-for-all.git
```

::::::::::::::::::::::::
This will create an `open-energy-data-for-all` folder in your selected location containing
all lesson materials.

To clone the repository, you must have `git` installed and configured on your computer (one of
the prerequisites for this lesson). If you need additional guidance on `git` setup, see the Software Carpentries' [Version Control with Git](https://swcarpentry.github.io/git-novice/) lesson.

:::::::::::::::: spoiler
## Accessing remote lesson data

### Linux
In episodes 3 and 4 of this lesson, we'll learn how to efficiently access remote data.
To do so, we'll need to set up credentials to access these resources.

Use Terminal
### Create an API key for accessing the EIA API
In episode 3 and 4, we'll be learning how to access the Application Programming Interface (API)
for the Energy Information Administration (EIA). To register for an EIA API key:

::::::::::::::::::::::::
1. Go to the [EIA API website](https://www.eia.gov/opendata/).
2. Click "Register" on the right-hand side and complete the form.
3. Log in to the email address you provided - you should have received an email from the
EIA with the subject line "EIA API Registration Key" that contains your API key.

### Create an API key for accessing the EPA API
In episode 3 and 4, we'll also be exploring the Environmental Protection Agency's (EPA)
Clean Air Markets API portal. To register for an EPA API key:

1. Go to the [registration page](https://www.epa.gov/power-sector/cam-api-portal#/api-key-signup) and fill out the form.
2. Log in to the email address you provided. You should have received an email from the EPA
containing an API key for the Clean Air Markets API portal.

## Create an account on GitHub

You will need an account for [GitHub](https://github.com) to follow episodes *(TODO!)* in this lesson.

1. Go to <https://github.com> and follow the "Sign up" link at the top-right of the window.
2. Follow the instructions to create an account.
3. Verify your email address with GitHub.
4. Configure multifactor authentication (see below).

Basic GitHub accounts are free. As you set up your account,p lease consider what personal
information you'd like to reveal. For example, you may want to review these
[instructions for keeping your email address private]("https://help.github.com/articles/keeping-your-email-address-private/") provided at GitHub.

### Multi-factor Authentication

In 2023, GitHub introduced a requirement for
all accounts to have
[multi-factor authentication (2FA)](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/about-two-factor-authentication)
configured for extra security.
Several options exist for setting up 2FA, which are summarised here:

1. If you already use an authenticator app,
like [Google Authenticator](https://support.google.com/accounts/answer/1066447?hl=en&co=GENIE.Platform%3DiOS&oco=0)
or [Duo Mobile](https://duo.com/product/multi-factor-authentication-mfa/duo-mobile-app) on your smartphone for example,
[add GitHub to that app](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication#configuring-two-factor-authentication-using-a-totp-mobile-app).
2. If you have access to a smartphone but do not already use an authenticator app, install one and
[add GitHub to the app](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication#configuring-two-factor-authentication-using-a-totp-mobile-app).
3. If you do not have access to a smartphone or do not want to install an authenticator app, you have two options:
1. [set up 2FA via text message](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication#configuring-two-factor-authentication-using-text-messages)
([list of countries where authentication by SMS is supported](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/countries-where-sms-authentication-is-supported)), or
2. [use a hardware security key](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication#configuring-two-factor-authentication-using-a-security-key)
like [YubiKey](https://www.yubico.com/products/yubikey-5-overview/)
or the [Google Titan key](https://store.google.com/us/product/titan_security_key?hl=en-US&pli=1).

The GitHub documentation provides [more details about configuring 2FA](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication).

## Launch Python interface - TODO!

To start working with Python, we need to launch a program that will interpret and execute our
Python commands. Below we list several options. If you don't have a preference, proceed with the
top option in the list that is available on your machine. Otherwise, you may use any interface
you like.

## Option A: Jupyter Notebook

A Jupyter Notebook provides a browser-based interface for working with Python.
If you installed Anaconda, you can launch a notebook in two ways:

::::::::::::::::: spoiler

## Anaconda Navigator

1. Launch Anaconda Navigator.
It might ask you if you'd like to send anonymized usage information to Anaconda developers:
![](fig/anaconda-navigator-first-launch.png){alt='Anaconda Navigator first launch'}
Make your choice and click "Ok, and don't show again" button.
2. Find the "Notebook" tab and click on the "Launch" button:
![](fig/anaconda-navigator-notebook-launch.png){alt='Anaconda Navigator Notebook launch'}
Anaconda will open a new browser window or tab with a Notebook Dashboard showing you the
contents of your Home (or User) folder.
3. Navigate to the `data` directory by clicking on the directory names leading to it:
`Desktop`, `swc-python`, then `data`:
![](fig/jupyter-notebook-data-directory.png){alt='Anaconda Navigator Notebook directory'}
4. Launch the notebook by clicking on the "New" button and then selecting "Python 3":
![](fig/jupyter-notebook-launch-notebook.png){alt='Anaconda Navigator Notebook directory'}

:::::::::::::::::::::::::


::::::::::::::::: spoiler

## Command line (Terminal)

1\. Navigate to the `data` directory:

::::::::::::::::: spoiler

## Unix shell

If you're using a Unix shell application, such as Terminal app in macOS, Console or Terminal
in Linux, or [Git Bash][gitbash] on Windows, execute the following command:

```bash
cd ~/Desktop/swc-python/data
```

:::::::::::::::::::::::::

::::::::::::::::: spoiler

## Command Prompt (Windows)

On Windows, you can use its native Command Prompt program. The easiest way to start it up is
pressing <kbd>Windows Logo Key</kbd>\+<kbd>R</kbd>, entering `cmd`, and hitting
<kbd>Return</kbd>. In the Command Prompt, use the following command to navigate to
the `data` folder:

```source
cd /D %userprofile%\Desktop\swc-python\data
```

:::::::::::::::::::::::::

2\. Start Jupyter server

::::::::::::::::: spoiler

## Unix shell

```bash
jupyter notebook
```

:::::::::::::::::::::::::


::::::::::::::::: spoiler

## Command Prompt (Windows)

```source
python -m notebook
```

:::::::::::::::::::::::::

3\. Launch the notebook by clicking on the "New" button on the right and selecting "Python 3"
from the drop-down menu:
![](fig/jupyter-notebook-launch-notebook2.png){alt='Anaconda Navigator Notebook directory'}

:::::::::::::::::::::::::

  <!-- vertical spacer -->

0 comments on commit baead85

Please sign in to comment.