-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a notebook for quickstart (#568)
Our Quickstart documentation is now an executable document (.ipynb notebook) Detailed changelog: * Changed pre-commit config in preparation for jupyter notebooks * Added jupyterlab3 as dev requirement for docs * Basic rewrite of quickstart as a notebook * Added nc files generated by notebooks to .gitignore * Added nbsphinx and other notebook doc dependencies aswell as configs * Added headings for quicker navigation * Added some jupyter helpers to make the output prettier And made flake8 for notebooks ignore 'E402 module level import not at top of file' * Added binder config * Replaced 'IPython.display.Code' with custom 'print_yaml_file' function The problem with 'Code' was, while it was properly syntax highlighted in the Html docs, it doesn't work in jupyterlab (see: issue 11747 in ipython/ipython) and the workaround is longer than the markdown wrapping in 'print_yaml_file'. Also, the colormap used by 'pygments' does not adjust or work well with the dark theme. * Added pandoc to doc related CI tasks, so the docs will actually build * Added tests for the notebooks, that way errors can be easier spotted * Adjusted notebook to API changes * Added pre-commit hook to remove empty notebook cells * Use tox-direct when no seperate env is needed E.g. docs, docs-links, docs-notebooks, pre-commit since those should all be runnable in the local devenv. The main reason to use tox-direct is that building the docs fails with image path resolving errors for the notebooks. * Added Trigger-Binder-build workflow and binder badge That way users don't need to wait for the binder image to build, since it gets built each push to main * Added ast-check and isort to notebook pre-commit hooks * Removed usage warning * Replaced my feature branch deprendency of tox-direct with new release on PyPi
- Loading branch information
Showing
17 changed files
with
666 additions
and
282 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: "Trigger-Binder-build" | ||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
trigger-binder-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: s-weigand/trigger-mybinder-build@v1 | ||
with: | ||
target-repo: glotaran/pyglotaran | ||
target-state: main |
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
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,14 @@ | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
# Jupyter | ||
- jupyterlab=3 | ||
- jupyter-offlinenotebook=0.2 | ||
# Python Kernel | ||
- ipykernel>5.1 | ||
- python=3.8 | ||
# update outdated repo2docker version | ||
- pip | ||
- pip: | ||
- -r ../requirements_dev.txt | ||
- .. |
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,5 @@ | ||
#!/bin/bash | ||
set -ex | ||
|
||
# run matplotlib once to generate the font cache | ||
python -c "import matplotlib as mpl; mpl.use('Agg'); import pylab as plt; fig, ax = plt.subplots(); fig.savefig('test.png')" |
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,29 @@ | ||
type: kinetic-spectrum | ||
|
||
initial_concentration: | ||
input: | ||
compartments: [s1, s2, s3] | ||
parameters: [input.1, input.0, input.0] | ||
|
||
k_matrix: | ||
k1: | ||
matrix: | ||
(s2, s1): kinetic.1 | ||
(s3, s2): kinetic.2 | ||
(s3, s3): kinetic.3 | ||
|
||
megacomplex: | ||
m1: | ||
k_matrix: [k1] | ||
|
||
irf: | ||
irf1: | ||
type: gaussian | ||
center: irf.center | ||
width: irf.width | ||
|
||
dataset: | ||
dataset1: | ||
initial_concentration: input | ||
megacomplex: [m1] | ||
irf: irf1 |
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,13 @@ | ||
input: | ||
- ['1', 1, {'vary': False, 'non-negative': False}] | ||
- ['0', 0, {'vary': False, 'non-negative': False}] | ||
|
||
kinetic: [ | ||
0.5, | ||
0.3, | ||
0.1, | ||
] | ||
|
||
irf: | ||
- ['center', 0.3] | ||
- ['width', 0.1] |
Oops, something went wrong.