Skip to content

Commit

Permalink
Merge pull request #109 from kavitasinghnih/plotting-userstory
Browse files Browse the repository at this point in the history
add basic dynamicpet usage jupyter notebook and fix checks

add jupyter notebook checks
add jupytext to generate py from ipynb for easy code diff
configure CI to run kinfitr tests on macOS
skip R install on windows
fix coverage checks
  • Loading branch information
bilgelm authored Sep 12, 2024
2 parents 2e2c5c8 + 0a74755 commit 81d123d
Show file tree
Hide file tree
Showing 14 changed files with 3,116 additions and 391 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,21 @@ jobs:
- name: Check out the repository
uses: actions/checkout@v4

- name: Set up R if not on Windows
if: matrix.os != 'windows-latest'
uses: r-lib/actions/setup-r@v2

- name: Install remotes R package if on MacOS
if: matrix.os == 'macos-latest'
uses: r-lib/actions/setup-r-dependencies@v2
with:
packages: remotes

- name: Install kinfitr if on MacOS
if: matrix.os == 'macos-latest'
run: |
Rscript -e "remotes::install_url('https://github.com/mathesong/kinfitr/archive/refs/tags/v0.8.0.tar.gz')"
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -110,6 +125,7 @@ jobs:
with:
name: coverage-data
path: ".coverage.*"
include-hidden-files: true

- name: Upload documentation
if: matrix.session == 'docs-build'
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
/.pytype/
/dist/
/docs/_build/
/docs/jupyter_execute/
/docs/notebooks/nb_data/
/src/*.egg-info/
__pycache__/
/.vscode
Expand Down
27 changes: 27 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ repos:
language: system
types: [python]
require_serial: true
exclude: ^docs/notebooks/
- id: check-added-large-files
name: Check for added large files
entry: check-added-large-files
Expand All @@ -27,6 +28,7 @@ repos:
language: system
types: [python]
stages: [manual]
exclude: ^docs/notebooks/
- id: end-of-file-fixer
name: Fix End of Files
entry: end-of-file-fixer
Expand All @@ -40,26 +42,51 @@ repos:
types: [python]
require_serial: true
args: [--darglint-ignore-regex, .*]
exclude: ^docs/notebooks/
- id: isort
name: isort
entry: isort
require_serial: true
language: system
types_or: [cython, pyi, python]
args: ["--filter-files"]
exclude: ^docs/notebooks/
- id: pyupgrade
name: pyupgrade
description: Automatically upgrade syntax for newer versions.
entry: pyupgrade
language: system
types: [python]
args: [--py37-plus]
exclude: ^docs/notebooks/
- id: trailing-whitespace
name: Trim Trailing Whitespace
entry: trailing-whitespace-fixer
language: system
types: [text]
stages: [commit, push, manual]
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.9.0
hooks:
- id: nbqa-black
- id: nbqa-check-ast
- id: nbqa-flake8
args: ["--extend-ignore=E402"]
- id: nbqa-pyupgrade
args: ["--py37-plus"]
- id: nbqa-isort
- repo: https://github.com/mwouts/jupytext
rev: v1.16.4
hooks:
- id: jupytext
name: jupytext
description: Runs jupytext on all notebooks and paired files
language: python
entry: jupytext --pre-commit-mode --set-formats "ipynb,py:percent"
require_serial: true
types_or: [jupyter, python]
files: ^docs/notebooks/ # Only apply this under docs/notebooks/
fail_fast: true
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.6.0
hooks:
Expand Down
4 changes: 2 additions & 2 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ coverage:
status:
project:
default:
target: "100"
target: "80"
patch:
default:
target: "100"
target: "80"
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx_click",
"myst_parser",
"myst_nb",
]
autodoc_typehints = "description"
autosummary_generate = True
Expand Down
12 changes: 11 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ end-before: <!-- github-only -->
```{toctree}
---
hidden:
maxdepth: 1
maxdepth: 2
caption: Contents:
---
usage
Expand All @@ -21,3 +22,12 @@ Code of Conduct <codeofconduct>
License <license>
Changelog <https://github.com/bilgelm/dynamicpet/releases>
```

```{toctree}
---
maxdepth: 1
caption: Notebooks:
---
notebooks/basics
```
Loading

0 comments on commit 81d123d

Please sign in to comment.