Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This repository is a template for how to set up a reproducible python environment with GitHub.

The documentation for this repository can be found [here](https://jorgensd.github.io/reproducibility/).

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jorgensd/reproducibility/gh-pages?labpath=_sources)
[![Jupyter Book Badge](https://jupyterbook.org/badge.svg)](https://jorgensd.github.io/reproducibility)
[![MIT License](https://img.shields.io/github/license/jorgensd/reproducibility)](LICENSE)
Expand Down
1 change: 0 additions & 1 deletion demo/demo.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# + [markdown]
# # An introduction to the light format
#
# Author: Jørgen S. Dokken
#
# SPDX-License-Identifier: MIT
Expand Down
45 changes: 36 additions & 9 deletions docs/_toc.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,39 @@
format: jb-book
root: index

chapters:
- file: "badges"
- file: "packaging"
- file: "github"
- file: "publishing"
# This file does not exist in the Github repository
# It should be copied here by adding it in the `Makefile`
- file: "demo"
- file: "api"
parts:
- caption: Python packaging
chapters:
- file: "part1/packaging"
- file: "part1/coverage"
- file: "part1/linting"
- file: "part1/typing"
- file: "part1/testing"

- caption: Github tools
chapters:
- file: "part2/github"
- file: "part2/workflows"
- file: "part2/citeable"
- file: "part2/issues"

- caption: Jupyter-book
chapters:
- file: "part3/publishing"

- caption: Creating a Package API
chapters:
- file: "part3/auto_api"
- file: "api"

- caption: Demos
chapters:
- file: part3/auto_demos
# The following file should be autogenerated by the Makefile
- file: "demo.ipynb"

- caption: Other Features
chapters:
- file: "part4/badges"


1 change: 1 addition & 0 deletions docs/part1/coverage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Coverage reports
1 change: 1 addition & 0 deletions docs/part1/linting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Python formatting
10 changes: 1 addition & 9 deletions docs/packaging.md → docs/part1/packaging.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
# Python-packaging
# Create an installable package

To be able to create a python package, we need a folder with the name of the package (in this repository it is called `mypackage`, located under `src/mypackage`), and a `pyproject.toml` file.


## Pyproject.toml


## Coverage reports


## Python linting (flake8)


## Python typing (mypy)
1 change: 1 addition & 0 deletions docs/part1/testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Testing
1 change: 1 addition & 0 deletions docs/part1/typing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Python typing
16 changes: 1 addition & 15 deletions docs/github.md → docs/part2/citeable.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
# Github tools

## Issue template
See [Adding an issue template](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository) for more information.


## Workflows


### Uploading artifacts

### Publishing to Pages


## Make a repository citable
# Make a repository citable
The easiest way to make your repository citable is to add a `CITATION.cff` file to the repository, as it is supported by both
[Zenodo's](https://zenodo.org/) and it's [Github integration](https://docs.github.com/en/repositories/archiving-a-github-repository/referencing-and-citing-content) and [Github](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-citation-files) itself.

2 changes: 2 additions & 0 deletions docs/part2/github.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Github tools

4 changes: 4 additions & 0 deletions docs/part2/issues.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Issue template
See [Adding an issue template](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository) for more information.


5 changes: 5 additions & 0 deletions docs/part2/workflows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Workflows

## Uploading artifacts

## Publishing to Pages
1 change: 1 addition & 0 deletions docs/part3/auto_api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Auto-generation
17 changes: 17 additions & 0 deletions docs/part3/auto_demos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
As shown in [Publishing a Jupyter book](publishing), we can add `.ipynb` files to the Jupyter book. This is achieved by adding their relative path with respect to `index.md` to `_toc.yml`.

These files can either be generated by hand, and added to the `docs` or auto-generated from a `.py` file, using `jupytext`.

The command
```bash
jupytext --to=ipynb --set-kernel=python3 path/to/demo.py --output=path/to/docs.ipynb
```
generates a notebook compatible with *Jupyter Book*.

The Python file should follow the conventions of the [light format](https://jupytext.readthedocs.io/en/latest/formats.html#the-light-format) for appropriate rendering.

This is illustrated in the following auto-converted demo.

# Auto-conversion of demos

In the [Makefile](https://github.com/jorgensd/reproducibility/blob/main/Makefile) one can find the instructions for auto-converting the demos and building the book.
8 changes: 8 additions & 0 deletions docs/part3/publishing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Building a book

## File formats

## `_toc.yml`

## `_config.yml`

File renamed without changes.
7 changes: 0 additions & 7 deletions docs/publishing.md

This file was deleted.