Run | View | |
---|---|---|
Topic 1 - Subtopic 1 | Put colab button here | Put github button here |
Topic 1 - Subtopic 2 | Put colab button here | Put github button here |
Run | View | |
---|---|---|
Topic 2 - Subtopic 1 | Put colab button here | Put github button here |
Topic 2 - Subtopic 2 | Put colab button here | Put github button here |
If you wish to contribute your own knowledge and know-how to the NGG community, create a new topic and associated notebooks by following the directions below. In essence, you will contribute a subdirectory to the NGG repository that looks something like this:
topic-name/
| README.md
| notebook1.ipynb
| notebook2.ipynb
| notebook3.ipynb
| py-environment.py
|
|___data/
| | data.csv
|
|___images/
| | image.png
|
|___lib/
| | custom-package-or-function-or-etc.py
To facilitate interactive learning, one should only strive to use notebook-style documents that mix code and text (Python jupyter notebooks, R markdown notebooks, Matlab live scripts, markdown files). A reasonable excpetion to this is if your topic/analyses require a high volume of custom code (like one's own Python package) that wouldn't make sense to include in a notebook. Python jupyter notebooks are encouraged because they can be run online via Google Colab, but you can upload the other types for use on one's own computer.
If you plan to include Python jupyter notebooks:
- A recent version of Python installed on your computer.
- A Python environment with at minimum
numpy
,scipy
,matplotlib
,pandas
, andjupyterlab
installed. An easy way to create/manage Python environments for those not comfortable with the command line is via the Anaconda desktop app.
If you plan to include other types of notebooks (R markdown notebooks, Matlab live scripts, markdown files):
- R markdown notebooks: Recent versions of R and RStudio
- Matlab live scripts: A recent version of Matlab (2018 onward should be fine)
- Markdown files: A markdown editor (many exist, but a good online one is https://dillinger.io/)
-
Make an empty folder on your computer to host the necessary materials. The name of the folder can be anything you want.
-
In the command line (Terminal on Mac, PowerShell on Windows), navigate to the folder.
-
Use git to download only the materials needed from the NGG github repository. To do so, input the following lines:
git init git remote add origin -f https://github.com/jacobaparker/notebook-test.git git config core.sparsecheckout true git sparse-checkout set images/* templates/* git pull origin main
-
Make a new folder within the folder you ran these lines in and title it the name of your topic.
-
Within your topic folder, create a
data/
folder and place any datasets you will need in it. If you have images you would like to include in your notebooks, create animages/
folder and place them in there. If will need any custom libraries/packages/code modules, create alib/
folder and place them in there (one should try to include all needed code in notebooks, but this may be necessary if there is a high volume of code)
Python Jupyter Notebooks
- Copy the Python jupyter notebook template file
py-notebook-template.ipynb
from thetemplates/
folder and paste it into your topic folder. - Activate a python environment that has
jupyterlab
installed and launch jupyter notebooks. - Open the notebook you just copied into your topic folder and add your content while following the structure provided.
R Markdown Notebooks
- Copy the R markdown notebook template file
R-notebook-template.Rmd
from thetemplates/
folder and paste it into your topic folder. - Open RStudio and open the notebook you just copied into your topic folder and add your content while following the structure provided.
Matlab Live Scripts
- Copy the Matlab live script template file
matlab-live-script-template.mlx
from thetemplates/
folder and paste it into your topic folder. - Open Matlab and open the notebook you just copied into your topic folder and add your content while following the structure provided.
Markdown File
- Copy the markdown template file
markdown-template.md
from thetemplates/
folder and paste it into your topic folder. - Open the markdown file you just copied into your topic folder and add your content while following the structure provided.
Adding to the NGG Github
-
Once you have created your notebook/s and uploaded your data/images/other files, copy the README template file
README-template.md
from thetemplates/
folder and fill in the requested information. -
Once you have created the README, commit your changes using git and create a github pull request by pushing to the NGG repository. To do this, navigate to your topic folder in the command line and input the following:
git add . git commit -m "topic name: , author: " git push
Your submitted materials will then be published to the NGG repository following review.