Joseph Holler's Open Source GIScience Resources at Middlebury College
: In this lesson, we will study the research paper and implementation of a COVID-19 accessibility analysis.
Wednesday, May 12
Prior to lecture, please read:
Kang, J. Y., A. Michels, F. Lyu, Shaohua Wang, N. Agbodo, V. L. Freeman, and Shaowen Wang. 2020. Rapidly measuring spatial accessibility of COVID-19 healthcare resources: a case study of Illinois, USA. International Journal of Health Geographics 19 (1):1–17. DOI:10.1186/s12942-020-00229-x.
To the best of your ability, draw or outline a workflow for this analysis. You may work in partners or small groups on this task.
@middlebury.edu
address.github.io
GitHub pages addressgeog 0323 spring 2021 open source GIScience
The goal of this lab is to get accustomed to working in a cyberinfrastructure environment with Python, Jupyter notebooks, and GitHub integration. We will do so with the Jupyter notebook published to accompany Kang et al (2020). The notebook has been published on CyberGISX and maintained in a GitHub repository
By the end of lab, you should have:
Advice:
R
, you can skip around a Jupyter notebook trying to execute different code blocks. However, code blocks often depend on prior code blocks to load packages, define functions, or define or modify data variables.Markdown
blocks, similar to markdown in GitHub or R.Transitioning to next week you should:
Below I will outline three workflows. Geog 323 students, please just follow the first two. The third is for reference.
new
and terminal
to open the Linux command-line terminal.ls
: list files and folderscd work
: change the directory to work
ls
: check to see if there are any folders with an identical name to your repository. If so, rename either the repository or the folder.git clone https://github.com/gituser/RP-Kang
: where gituser
is the user or organization name and RP-Kang
is the repository name. In other words, you need the URL
of the repository you want to clone.ls
: check to see if the repository has been added.RP-Kang
folder, browse the data
folder to see what’s there (and where)COVID-19Aacc.ipybn
Jupyter notebook..ipybn
notebooks and saving them.Cell
–> All Output
–> Clear
cd
: to change the directory to the root folder of your project, e.g. you should be inside RP-Kang
inside work
to run any git
commands on your RP-Kang
repositorycd ..
git config --global user.email "josephh@middlebury.edu"
: configure your GitHub user namegit config --global user.name "josephholler"
: configure your GitHub emailgit remote get-url origin
: Check the existing remote connection. The connection should point to your own GitHub repository. If it doesn’t use the next line to change it!git remote set-url origin https://github.com/gituser/RP-Kang
: Change the remote connection to your own repository, replacing gituser
with your own GitHub user name.git remote -v
: verify that the change workedgit add .
: to add changes from all files or git add jupyter.ipynb
to add a specific file’s changes to the commit, with the example of a Jupyter notebook eponymously named jupyter
git commit -m "commit description"
: to commit the staged changes, hopefully with a better description than my examplegit push origin
: to push the commit to GitHubOpen with CyberGISX
button, which will copy the notebook into your logged-in CyberGISX account. Beware: if you have already copied the notebook once, you will get inconsistent results with this copy feature. If you must keep two versions of the same notebook, then rename the folder containing the first before making a second copy.COVID-19AccessibilityNotebook
containing the .ipynb
Jupyter notebook and any required data.Now that the notebook has been copied into your CyberGISX account, you need a GitHub repository for this project.
RP-Kang
https://github.com/josephholler/RP-Kang.git
Now the harder part: connecting the CyberGISX notebook to your GitHub repository using the Linux terminal and command line Git. Linux is an open-source operating system and its file and folder names are case-sensitive.
new
and terminal
to open the Linux command-line terminal.ls
list files and folderscd work
change the directory to work
ls
cd COVID-19AccessibilityNotebook
change the directory to the COVID-19 Notebookgit init
initialize git repository. One exists already, because all of the Git files were copied from the original repositorygit add .
: add all the files to the repositorygit config --global user.email "josephh@middlebury.edu"
: configure your GitHub user namegit config --global user.name "josephholler"
: configure your GitHub emailgit remote get-url origin
: Check the existing remote connection. The connection should point to your own GitHub repository. If it doesn’t use the next line to change it!git remote set-url origin https://github.com/gituser/RP-Kang
: Change the remote connection to your own repository, replacing gituser
with your own GitHub user name.git remote -v
: verify that the change workedgit commit -m "first commit"
: commit the changes, where the description of changes is in quotes. -m
is for main branch
.git push origin
: push your changes to GitHub! The command line will ask for your username and password.