Skip to content

Commit 07d8608

Browse files
committed
Initial commit
0 parents  commit 07d8608

14 files changed

+542
-0
lines changed

.github/workflows/deploy.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: deploy
2+
3+
on:
4+
# Trigger the workflow on push to master branch
5+
push:
6+
branches:
7+
- master
8+
9+
# This job installs dependencies, build the book, and pushes it to `gh-pages`
10+
jobs:
11+
build-and-deploy-book:
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest]
16+
python-version: [3.8]
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
# Install dependencies
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v1
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
- name: Install dependencies
26+
run: |
27+
pip install -r requirements.txt
28+
29+
# Build the book
30+
- name: Build the book
31+
run: |
32+
jupyter-book build hpc_lecture_notes
33+
34+
# Deploy the book's HTML to gh-pages branch
35+
- name: GitHub Pages action
36+
uses: peaceiris/[email protected]
37+
with:
38+
github_token: ${{ secrets.GITHUB_TOKEN }}
39+
publish_dir: hpc_lecture_notes/_build/html

CONDUCT.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
# Code of Conduct
3+
4+
## Our Pledge
5+
6+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
7+
8+
## Our Standards
9+
10+
Examples of behavior that contributes to creating a positive environment include:
11+
12+
* Using welcoming and inclusive language
13+
* Being respectful of differing viewpoints and experiences
14+
* Gracefully accepting constructive criticism
15+
* Focusing on what is best for the community
16+
* Showing empathy towards other community members
17+
18+
Examples of unacceptable behavior by participants include:
19+
20+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
21+
* Trolling, insulting/derogatory comments, and personal or political attacks
22+
* Public or private harassment
23+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
24+
* Other conduct which could reasonably be considered inappropriate in a professional setting
25+
26+
## Our Responsibilities
27+
28+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
29+
30+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
31+
32+
## Scope
33+
34+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
35+
36+
## Enforcement
37+
38+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
39+
40+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
41+
42+
## Attribution
43+
44+
This Code of Conduct is adapted from the [Contributor Covenant, version 1.4](http://contributor-covenant.org/version/1/4).

CONTRIBUTING.md

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Contributing
2+
3+
Contributions are welcome, and they are greatly appreciated! Every little bit
4+
helps, and credit will always be given. You can contribute in the ways listed below.
5+
6+
## Report Bugs
7+
8+
Report bugs using GitHub issues.
9+
10+
If you are reporting a bug, please include:
11+
12+
* Your operating system name and version.
13+
* Any details about your local setup that might be helpful in troubleshooting.
14+
* Detailed steps to reproduce the bug.
15+
16+
## Fix Bugs
17+
18+
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help
19+
wanted" is open to whoever wants to implement it.
20+
21+
## Implement Features
22+
23+
Look through the GitHub issues for features. Anything tagged with "enhancement"
24+
and "help wanted" is open to whoever wants to implement it.
25+
26+
## Write Documentation
27+
28+
Techniques of High-Performance Computing - Lecture Notes could always use more documentation, whether as part of the
29+
official Techniques of High-Performance Computing - Lecture Notes docs, in docstrings, or even on the web in blog posts,
30+
articles, and such.
31+
32+
## Submit Feedback
33+
34+
The best way to send feedback is to file an issue on GitHub.
35+
36+
If you are proposing a feature:
37+
38+
* Explain in detail how it would work.
39+
* Keep the scope as narrow as possible, to make it easier to implement.
40+
* Remember that this is a volunteer-driven project, and that contributions
41+
are welcome :)
42+
43+
## Get Started
44+
45+
Ready to contribute? Here's how to set up `Techniques of High-Performance Computing - Lecture Notes` for local development.
46+
47+
1. Fork the repo on GitHub.
48+
2. Clone your fork locally.
49+
3. Install your local copy into a virtualenv, e.g., using `conda`.
50+
4. Create a branch for local development and make changes locally.
51+
5. Commit your changes and push your branch to GitHub.
52+
6. Submit a pull request through the GitHub website.
53+
54+
## Code of Conduct
55+
56+
Please note that the Techniques of High-Performance Computing - Lecture Notes project is released with a [Contributor Code of Conduct](CONDUCT.md). By contributing to this project you agree to abide by its terms.

LICENSE

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
3+
BSD License
4+
5+
Copyright (c) 2020, Timo Betcke
6+
All rights reserved.
7+
8+
Redistribution and use in source and binary forms, with or without modification,
9+
are permitted provided that the following conditions are met:
10+
11+
* Redistributions of source code must retain the above copyright notice, this
12+
list of conditions and the following disclaimer.
13+
14+
* Redistributions in binary form must reproduce the above copyright notice, this
15+
list of conditions and the following disclaimer in the documentation and/or
16+
other materials provided with the distribution.
17+
18+
* Neither the name of the copyright holder nor the names of its
19+
contributors may be used to endorse or promote products derived from this
20+
software without specific prior written permission.
21+
22+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
23+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25+
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
26+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
29+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
30+
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
31+
OF THE POSSIBILITY OF SUCH DAMAGE.
32+

README.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Techniques of High-Performance Computing - Lecture Notes
2+
3+
Lecture Notes for the module Techniques of High-Performance Computing
4+
5+
## Usage
6+
7+
### Building the book
8+
9+
If you'd like to develop on and build the Techniques of High-Performance Computing - Lecture Notes book, you should:
10+
11+
- Clone this repository and run
12+
- Run `pip install -r requirements.txt` (it is recommended you do this within a virtual environment)
13+
- (Recommended) Remove the existing `Techniques of High-Performance Computing - Lecture Notes/_build/` directory
14+
- Run `jupyter-book build Techniques of High-Performance Computing - Lecture Notes/`
15+
16+
A fully-rendered HTML version of the book will be built in `Techniques of High-Performance Computing - Lecture Notes/_build/html/`.
17+
18+
### Hosting the book
19+
20+
The html version of the book is hosted on the `gh-pages` branch of this repo. A GitHub actions workflow has been created that automatically builds and pushes the book to this branch on a push or pull request to master.
21+
22+
If you wish to disable this automation, you may remove the GitHub actions workflow and build the book manually by:
23+
24+
- Navigating to your local build; and running,
25+
- `ghp-import -n -p -f Techniques of High-Performance Computing - Lecture Notes/_build/html`
26+
27+
This will automatically push your build to the `gh-pages` branch. More information on this hosting process can be found [here](https://jupyterbook.org/publish/gh-pages.html#manually-host-your-book-with-github-pages).
28+
29+
## Contributors
30+
31+
We welcome and recognize all contributions. You can see a list of current contributors in the [contributors tab](https://github.com/tbetcke/hpc_lecture_notes/graphs/contributors).
32+
33+
## Credits
34+
35+
This project is created using the excellent open source [Jupyter Book project](https://jupyterbook.org/) and the [executablebooks/cookiecutter-jupyter-book template](https://github.com/executablebooks/cookiecutter-jupyter-book).

hpc_lecture_notes/_config.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#######################################################################################
2+
# A default configuration that will be loaded for all jupyter books
3+
# See the documentation for help and more options:
4+
# https://jupyterbook.org/customize/config.html
5+
6+
#######################################################################################
7+
# Book settings
8+
title : Techniques of High-Performance Computing - Lecture Notes # The title of the book. Will be placed in the left navbar.
9+
author : Timo Betcke # The author of the book
10+
copyright : "2020" # Copyright year to be placed in the footer
11+
logo : logo.png # A path to the book logo

hpc_lecture_notes/_toc.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Table of contents
2+
# Learn more at https://jupyterbook.org/customize/toc.html
3+
- file: intro
4+
- file: content
5+
sections:
6+
- file: markdown
7+
- file: notebooks

hpc_lecture_notes/content.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Content in Jupyter Book
2+
=======================
3+
4+
There are many ways to write content in Jupyter Book. This short section
5+
covers a few tips for how to do so.

hpc_lecture_notes/intro.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Welcome to your Jupyter Book
2+
============================
3+
4+
This is a small sample book to give you a feel for how book content is
5+
structured.
6+
7+
Check out the content pages bundled with this sample book to get started.

hpc_lecture_notes/logo.png

9.62 KB
Loading

hpc_lecture_notes/markdown.md

+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# Markdown Files
2+
3+
Whether you write your book's content in Jupyter Notebooks (`.ipynb`) or
4+
in regular markdown files (`.md`), you'll write in the same flavor of markdown
5+
called **MyST Markdown**.
6+
7+
## What is MyST?
8+
9+
MyST stands for "Markedly Structured Text". It
10+
is a slight variation on a flavor of markdown called "CommonMark" markdown,
11+
with small syntax extensions to allow you to write **roles** and **directives**
12+
in the Sphinx ecosystem.
13+
14+
## What are roles and directives?
15+
16+
Roles and directives are two of the most powerful tools in Jupyter Book. They
17+
are kind of like functions, but written in a markup language. They both
18+
serve a similar purpose, but **roles are written in one line**, whereas
19+
**directives span many lines**. They both accept different kinds of inputs,
20+
and what they do with those inputs depends on the specific role or directive
21+
that is being called.
22+
23+
### Using a directive
24+
25+
At its simplest, you can insert a directive into your book's content like so:
26+
27+
````
28+
```{mydirectivename}
29+
My directive content
30+
```
31+
````
32+
33+
This will only work if a directive with name `mydirectivename` already exists
34+
(which it doesn't). There are many pre-defined directives associated with
35+
Jupyter Book. For example, to insert a note box into your content, you can
36+
use the following directive:
37+
38+
````
39+
```{note}
40+
Here is a note
41+
```
42+
````
43+
44+
This results in:
45+
46+
```{note}
47+
Here is a note
48+
```
49+
50+
In your built book.
51+
52+
For more information on writing directives, see the
53+
[MyST documentation](https://myst-parser.readthedocs.io/).
54+
55+
56+
### Using a role
57+
58+
Roles are very similar to directives, but they are less-complex and written
59+
entirely on one line. You can insert a role into your book's content with
60+
this pattern:
61+
62+
```
63+
Some content {rolename}`and here is my role's content!`
64+
```
65+
66+
Again, roles will only work if `rolename` is a valid role's name. For example,
67+
the `doc` role can be used to refer to another page in your book. You can
68+
refer directly to another page by its relative path. For example, the
69+
role syntax `` {doc}`intro` `` will result in: {doc}`intro`.
70+
71+
For more information on writing roles, see the
72+
[MyST documentation](https://myst-parser.readthedocs.io/).
73+
74+
75+
### Adding a citation
76+
77+
You can also cite references that are stored in a `bibtex` file. For example,
78+
the following syntax: `` {cite}`holdgraf_evidence_2014` `` will render like
79+
this: {cite}`holdgraf_evidence_2014`.
80+
81+
Moreover, you can insert a bibliography into your page with this syntax.
82+
The `{bibliography}` directive must be used for all the `{cite}` roles to
83+
render properly.
84+
For example, if the references for your book are stored in `references.bib`,
85+
then the bibliography is inserted with:
86+
87+
````
88+
```{bibliography} references.bib
89+
```
90+
````
91+
92+
Resulting in a rendered bibliography that looks like:
93+
94+
```{bibliography} references.bib
95+
```
96+
97+
98+
### Executing code in your markdown files
99+
100+
If you'd like to include computational content inside these markdown files,
101+
you can use MyST Markdown to define cells that will be executed when your
102+
book is built. Jupyter Book uses *jupytext* to do this.
103+
104+
First, add Jupytext metadata to the file. For example, to add Jupytext metadata
105+
to this markdown page, run this command:
106+
107+
```
108+
jupyter-book myst init markdown.md
109+
```
110+
111+
Once a markdown file has Jupytext metadata in it, you can add the following
112+
directive to run the code at build time:
113+
114+
````
115+
```{code-cell}
116+
print("Here is some code to execute")
117+
```
118+
````
119+
120+
When your book is built, the contents of any `{code-cell}` blocks will be
121+
executed with your default Jupyter kernel, and their outputs will be displayed
122+
in-line with the rest of your content.
123+
124+
For more information about executing computational content with Jupyter Book,
125+
see [The MyST-NB documentation](https://myst-nb.readthedocs.io/).

0 commit comments

Comments
 (0)