Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoledoux committed Nov 10, 2023
2 parents bd2298a + 0c1cc89 commit 2e708d8
Show file tree
Hide file tree
Showing 19 changed files with 263 additions and 15 deletions.
10 changes: 10 additions & 0 deletions docs/introdays/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

# 13+14 Nov geogeeks workshop material


1. [Session #1 -- writing (13 Nov 8:45--12:00)](session1/index.md)
1. [Session #2 -- Git (13 Nov 13:45--17:00)](session2/index.md)
1. [Session #3 -- Linux(14 Nov 8:45--12:00)](session3/index.md)
1. [Session #4 -- geo-Python (14 Nov 13:45--17:00)](session4/index.md)

![](schedule.png)
Binary file added docs/introdays/schedule.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
84 changes: 84 additions & 0 deletions docs/introdays/session1/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@


# Session #1 support material/info

## Markdown

- exercise #1: [HTML page to replicate](md_result.html)
- exercise #2: convert your .md file to a PDF with [Pandoc](https://pandoc.org/)


## LaTeX

### Intro slides (as presented during GEO1002)

[Intro slides to LaTeX](../../writing/files/intro_latex_tudelft3d.pdf) by [tudelft3d](https://3d.bk.tudelft.nl)

### Exercises

1. Register at <https://overleaf.com> with your `@tudelft.nl` email (for an account with more options, TUDelft pays for it)
1. Start with the template below here and discover/try some features. Notice that this won't compile correctly because of the reference on line 26: the file `myreferences.bib` should be in the same folder
1. copy the content of the second file to a file `myreferences.bib` and add it to the same folder
1. check this [demo template](https://github.com/tudelft3d/latex-getting-started/tree/main/template) to know the best way to make complex things (tables, code, etc.)
1. when all this works, try to replicate [this PDF](latex_result.pdf)


### A better starting template for simple LaTeX

```tex
\documentclass[a4paper,11pt]{scrartcl}
\usepackage{graphicx}
\usepackage[utf8]{inputenc} %-- pour utiliser des accents en français
\usepackage{amsmath,amssymb,amsthm}
\usepackage[round]{natbib}
\usepackage{url}
\usepackage{mathpazo}
\usepackage{booktabs}
\usepackage{hyperref}
\title{My great title}
\author{Jan Smit\\ \url{[email protected]}}
\date{\today}
\begin{document}
\maketitle
\section{Introduction}
Lemongrass frosted gingerbread bites banana bread orange crumbled lentils sweet potato black bean burrito green pepper springtime.
Strawberry ginger lemongrass agave green tea smoky maple tempeh glaze enchiladas couscous.
Cranberry spritzer Malaysian cinnamon pineapple salsa apples spring cherry bomb bananas blueberry pops scotch bonnet pepper.
Bento box roasted peanuts pasta Sicilian~\citep{DeVries20}.
\bibliographystyle{abbrvnat}
\bibliography{references.bib}
\end{document}
```

```tex
@article{DeVries20,
author = {De Vries, Piet},
doi = {10.1016/j.scs.2022.104225},
journal = {Sustainable Cities and Society},
pages = {102222},
title = {Understanding the relationship between urban morphology and other things},
year = {2021}
}
```


## Python venv

1. [install pyenv](../../python/install.md)
1. [create a new venv](../../python/venv.md) called "geogeeks"
1. activate it (with the console or with PyCharm)
1. install [pyproj](https://pyproj4.github.io/pyproj/): `pip install pyproj`
1. try to import it: `import pyproj` and you shouldn't get any errors

## The slides

Today's slides are available [there](files/slides.pdf).
Binary file added docs/introdays/session1/latex_result.pdf
Binary file not shown.
67 changes: 67 additions & 0 deletions docs/introdays/session1/md_result.html

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions docs/introdays/session2/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@


# Session #2 support material/info

4 changes: 4 additions & 0 deletions docs/introdays/session3/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@


# Session #3 support material/info

62 changes: 62 additions & 0 deletions docs/introdays/session4/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@


# Session 4: geo-Python (Jupyter, Numpy, GeoPandas, Matplotlib)

Instructors: Lukas Beuster & Gina Stavropoulou


# Requirements:

A computer with Python3.8 or higher.


# Getting Started:

You will need to use your [terminal](../../computer/terminal.md) on Linux/macOS, or your PowerShell on Windows.

## Clone the repo (or use GitHub Desktop)

```bash
git clone https://github.com/GinaStavropoulou/geogeek-workshop.git
cd geogeek-workshop
```

## Create a new venv

Use either [pyenv](../../python/venv.md) or the following commands:

=== ":simple-apple: macOS + :simple-linux: Linux"

Create a virtual environment:
```
python -m venv .venv
```
Activate the environment
```bash
source .venv/bin/activate
```

=== ":simple-windows: Windows"

Create a virtual environment:
```
python -m venv .venv
```
Activate the environment
```
.venv\Scripts\Activate.ps1
```


## Install the requirements:
```bash
pip install -r requirements.txt
```

### Then get started with:

```bash
jupyter lab
```

This will open jupyter lab on your browser. You can choose the notebook of Exercise 0 to start with.
Binary file added docs/python/img/pyenvpycharm-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/python/img/pyenvpycharm-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/python/img/pyenvpycharm-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 7 additions & 4 deletions docs/python/install.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@

# How to install Python using Pyenv
# How to install Python using pyenv

Installing and using Python as recommended below has major benefits and will prevent problems in the future.

---

We recommend installing and managing Python using "pyenv". Pyenv is a tool that allows you to install *multiple versions* of Python, and select which specific version should be used.
We recommend installing and managing Python using "pyenv".
pyenv is a tool that allows you to install *multiple versions* of Python, and select which specific version should be used.

=== ":simple-apple: macOS"
To install Python via pyenv, make sure you have [Homebrew](../computer/packagemanager.md) installed and then run the following commands in your [terminal](../computer/terminal.md).
Expand Down Expand Up @@ -33,7 +34,10 @@ We recommend installing and managing Python using "pyenv". Pyenv is a tool that
```

=== ":simple-windows: Windows"
Note: pyenv was created for macOS and Linux, the version for Windows is called "pyenv-win". However, it works the same as pyenv and the command in the terminal is still `pyenv`.

!!! note

pyenv was created for macOS and Linux, the version for Windows is called "**pyenv-win**". However, it works the same as pyenv and the command in the terminal is still `pyenv`.

To install Python via pyenv-win, make sure you have [Chocolatey](../computer/packagemanager.md) installed and then run the following commands in your [Powershell terminal](../computer/terminal.md).

Expand Down Expand Up @@ -77,4 +81,3 @@ pyenv global 3.11.5
```
This command sets your newly installed Python as the default Python for all terminals.

%% Add extra info for selecting in Pycharm and VSCode
4 changes: 4 additions & 0 deletions docs/python/jupyter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

# Jupyter notebooks

![](https://upload.wikimedia.org/wikipedia/commons/2/21/OpenGL_Tutorial_TODO.png){width=300x}
2 changes: 1 addition & 1 deletion docs/python/pypackages.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- [Laspy](https://github.com/laspy/laspy): to read/write/process point clouds in LAS/LAZ
- [Matplotlib](https://matplotlib.org/): great to visualise (mostly non-geo) data
- [NumPy](https://numpy.org/): multi-dimensional arrays
- [pyproj](https://pyproj4.github.io/): essential for dealing with CRS
- [pyproj](https://pyproj4.github.io/pyproj/): essential for dealing with CRS
- [Rasterio](https://github.com/rasterio/rasterio): read/write/process raster data
- [scikit-learn](https://scikit-learn.org/stable/): machine learning in Python
- [Shapely](https://github.com/shapely/shapely): processing of 2D vector data
Expand Down
13 changes: 10 additions & 3 deletions docs/python/venv.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ It allows us to avoid this mess (from [xkcd-1987](https://xkcd.com/1987/)):
![](img/xkcd.png){ width="400" }



## How to create and use a venv

=== "If you use pyenv"

If you used [pyenv](install.md) to install Python, then you can also use it to have venv.
It keeps a global list of which versions and virtual environments you have installed.
If you used [pyenv](install.md) to install Python (this is what the geogeek-in-chief recommends!), then you can also use it to install and manage your virtual environments.
pyenv keeps a global list of which versions and venv you have installed, and allows you to easily switch between them.

Some useful commands:

Expand Down Expand Up @@ -60,6 +59,14 @@ It allows us to avoid this mess (from [xkcd-1987](https://xkcd.com/1987/)):
deactivate
```

=== "pyenv + PyCharm"

Just activate and select a new interpreter (which must be a venv, not a Python version!), following those steps:

1. ![](img/pyenvpycharm-1.png)
2. ![](img/pyenvpycharm-2.png)
3. ![](img/pyenvpycharm-3.png)

=== "Directly with PyCharm"

PyCharm allows you to create venv and activate them, follow those instructions:
Expand Down
Binary file added docs/writing/files/intro_latex_tudelft3d.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/writing/latexintro.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

[![](img/overleaf.png)](https://overleaf.com)

To start, we recommend you use the [online LaTeX environment Overleaf](https://www.overleaf.com) since it has a full installation of LaTeX and there is nothing to install.
To start, the geogeek-in-chief recommends you use the [online LaTeX environment Overleaf](https://www.overleaf.com) since it has a full installation of LaTeX and there is nothing to install.
If you login with your TUDelft email, you get extra features (TUDelft pays for it).

### Local installation
Expand Down
13 changes: 7 additions & 6 deletions docs/writing/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@ The geogeeks website is written in Markdown, see [the source of this page](https

## Getting started

!!! external-link "GitHub's Markdown quickstart"
[Learn Markdown](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/quickstart-for-writing-on-github) by making a README file for your GitHub profile

!!! external-link "Markdown Guide Getting Started"
[Another nice ressource](https://www.markdownguide.org/getting-started/)

[Arguable the best cheat-sheet!](https://www.markdownguide.org/cheat-sheet/)

[markdown-cheat-sheet.md](https://www.markdownguide.org/assets/markdown-cheat-sheet.md)


## Markdown: basic + extended versions

The [original Markdown](https://daringfireball.net/projects/markdown/) is rather limited, but it has been extended by several to add more complex features (like tables, code-blocks, or [admonitions](https://squidfunk.github.io/mkdocs-material/reference/admonitions/)).
Watch out, it's a bit of the far-west out there: some processors might not be able to parse your flavour of Markdown correctly!?

Watch out, it's a bit the far-west out there: some processors might not be able to parse your flavour of Markdown correctly!?

!!! external-link "GitHub Flavoured Markdown"
GitHub offers an useful overview of the features they added for their extended version called "[GitHub Flavoured Markdown (GFM)](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting)".
Expand All @@ -29,7 +30,7 @@ Watch out, it's a bit of the far-west out there: some processors might not be ab
## Software to process Markdown

- PyCharm/CLion will preview automatically any Markdown files
- any file `.md` pushed to GitHub will be rendered
- any file `.md` pushed to GitHub will be rendered automatically
- [dillinger.io: a handy web-preview tool](https://dillinger.io/)
- [Exhaustive list of processors](https://github.com/markdown/markdown.github.com/wiki/Implementations)

2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ nav:
- "Home":
- index.md
- contribute.md
- intro days (13+14 Nov): introdays/index.md
- Computer & Software:
- computer/index.md
- computer/filesystem.md
Expand All @@ -67,6 +68,7 @@ nav:
- python/pip.md
- python/pypackages.md
- python/venv.md
- python/jupyter.md
- C++:
- cpp/install.md
- cpp/cmake.md
Expand Down

0 comments on commit 2e708d8

Please sign in to comment.