-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add slides for the KEGS 2023 presentation.
- Loading branch information
1 parent
52c28e4
commit 10c8697
Showing
45 changed files
with
6,436 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Slides for KEGS 2023 presentation | ||
|
||
The `slides.odp` contains the slides for the KEGS 2023 presentation. A PDF | ||
version can be downloaded from | ||
[10.6084/m9.figshare.22151357](https://doi.org/10.6084/m9.figshare.22151357). | ||
|
||
The slides have been made with [LibreOffice | ||
Impress](https://www.libreoffice.org/discover/impress/) using the | ||
[Montserrat](https://fonts.google.com/specimen/Montserrat) | ||
and [FiraCode](https://github.com/tonsky/FiraCode) fonts available under the | ||
OFL license. | ||
Versions of these fonts are included in the `fonts` directory. | ||
|
||
The `code` folder contains Jupyter notebooks and Python scripts used to | ||
generate some of the figures shown in the slides. | ||
|
||
The `data` folder contains magnetic data from the Mt. Milligan, | ||
British Columbia. The files were downloaded from | ||
[NRCAN](https://natural-resources.canada.ca/home) website, available under an | ||
[Open Government Licence, Canada]( | ||
https://open.canada.ca/en/open-government-licence-canada). | ||
|
||
The `figs` folder contains some of the figures and original `.svg` files used | ||
to create the figures shown in the slides. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
""" | ||
Fetch GitHub avatars of Fatiando authors | ||
""" | ||
import re | ||
import requests | ||
from pathlib import Path | ||
|
||
BRANCH = "main" | ||
PROJECTS = ["harmonica", "verde", "boule", "pooch", "ensaio"] | ||
|
||
|
||
def _parse_authors_file(package, branch): | ||
""" | ||
Returns a dict with information about the author of the package | ||
Parameters | ||
---------- | ||
package : str | ||
Name of the Fatiando a Terra package. | ||
Returns | ||
------- | ||
authors : list | ||
List of tuples. Each tuple contains the ``full_name`` and the | ||
``github_handle`` of each user. | ||
""" | ||
response = requests.get( | ||
f"https://raw.githubusercontent.com/fatiando/{package}/{branch}/AUTHORS.md", | ||
) | ||
response.raise_for_status() | ||
markdown = response.text | ||
authors = re.findall(r"\[(.+?)\]\((?:https://github.com/)(.+?)/?\)", markdown) | ||
return authors | ||
|
||
|
||
if __name__ == "__main__": | ||
|
||
# Get path of dir for this script | ||
filepath = Path(__file__).parent | ||
|
||
# Get authors of all Fatiando projects | ||
authors = [] | ||
for project in PROJECTS: | ||
authors.extend(_parse_authors_file(project, BRANCH)) | ||
|
||
# Get unique authors | ||
authors = list(set(authors)) | ||
|
||
# Create directory for storing the avatar images | ||
avatars_dir = filepath / ".." / "figs" / "avatars" | ||
avatars_dir.mkdir() | ||
|
||
# Download the avatar images | ||
for _, handle in authors: | ||
with open(avatars_dir / f"{handle}.jpg", "wb") as outfile: | ||
response = requests.get(f"https://github.com/{handle}.png") | ||
if response.status_code != 200: | ||
print(f"Couldn't download avatar for {handle}") | ||
continue | ||
outfile.write(response.content) |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.