Skip to content

Commit e025ae5

Browse files
committed
And more
1 parent 5c58a70 commit e025ae5

File tree

608 files changed

+80862
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

608 files changed

+80862
-0
lines changed

.github/workflows/issue_workflow.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Issue Management
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
7+
jobs:
8+
triage_or_add_to_project:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Check if the issue creator is a maintainer
13+
id: check_maintainer
14+
run: |
15+
echo "::set-output name=is_maintainer::$(curl -s -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' \
16+
https://api.github.com/repos/${{ github.repository }}/collaborators/${{ github.event.issue.user.login }}/permission \
17+
| jq -r '.permission' | grep -q 'admin' && echo 'true' || echo 'false')"
18+
19+
- name: Apply "needs triage" label to issues created by non-maintainers
20+
if: steps.check_maintainer.outputs.is_maintainer == 'false'
21+
uses: actions/github-script@v6
22+
with:
23+
script: |
24+
github.rest.issues.addLabels({
25+
issue_number: context.issue.number,
26+
owner: context.repo.owner,
27+
repo: context.repo.repo,
28+
labels: ["needs-triage"]
29+
})

.github/workflows/publish.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
on:
2+
workflow_dispatch:
3+
push:
4+
branches: main
5+
6+
name: Quarto render and publish
7+
8+
jobs:
9+
build-deploy:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
pages: write
14+
15+
steps:
16+
- name: Check out repository
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Quarto
20+
uses: quarto-dev/quarto-actions/setup@v2
21+
env:
22+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
24+
- name: Install Python and Dependencies
25+
uses: actions/setup-python@v4
26+
with:
27+
python-version: '3.11'
28+
cache: 'pip'
29+
- run: pip install jupyter
30+
- run: pip install -r requirements.txt
31+
32+
- name: Render and Publish
33+
uses: quarto-dev/quarto-actions/publish@v2
34+
with:
35+
target: gh-pages
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# poetry
98+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102+
#poetry.lock
103+
104+
# pdm
105+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106+
#pdm.lock
107+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108+
# in version control.
109+
# https://pdm.fming.dev/#use-with-ide
110+
.pdm.toml
111+
112+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113+
__pypackages__/
114+
115+
# Celery stuff
116+
celerybeat-schedule
117+
celerybeat.pid
118+
119+
# SageMath parsed files
120+
*.sage.py
121+
122+
# Environments
123+
.env
124+
.venv
125+
env/
126+
venv/
127+
ENV/
128+
env.bak/
129+
venv.bak/
130+
131+
# Spyder project settings
132+
.spyderproject
133+
.spyproject
134+
135+
# Rope project settings
136+
.ropeproject
137+
138+
# mkdocs documentation
139+
/site
140+
141+
# mypy
142+
.mypy_cache/
143+
.dmypy.json
144+
dmypy.json
145+
146+
# Pyre type checker
147+
.pyre/
148+
149+
# pytype static type analyzer
150+
.pytype/
151+
152+
# Cython debug symbols
153+
cython_debug/
154+
155+
# PyCharm
156+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158+
# and can be added to the global gitignore or merged into this file. For a more nuclear
159+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160+
#.idea/
161+
.Rproj.user
162+
163+
/.quarto/
164+
.DS_Store
165+
_site
166+
site_libs
167+
168+
/.luarc.json
169+
170+
171+
# gimp
172+
*.xcf

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.11.0

.vscode/settings.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"[python]": {
3+
"editor.defaultFormatter": "ms-python.black-formatter"
4+
},
5+
"python.formatting.provider": "none",
6+
"cSpell.words": [
7+
"asis",
8+
"behaviour"
9+
]
10+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Posit PBC
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Intro to Shiny for Python / Posit Conf::20204
2+
3+
This is the repository for the "Intro to Shiny for Python" workshop Posit Conf 2024.
4+
5+
6+
## For students
7+
8+
If you're a student, please visit the course pages at https://andrie.github.io/conf-2024-intro-to-shiny-for-python/
9+
10+
## Installation - for instructors only
11+
12+
Note: These instructions are to build the website locally, and is should only be necessary if you want to teach this class.
13+
14+
You will need to install a few things to render the website locally:
15+
16+
1) [Install quarto](https://quarto.org/docs/get-started/)
17+
18+
2) Install the shinylive python package `pip install shinylive --upgrade`
19+
20+
3) Install the shinylive quarto materials `quarto add quarto-ext/shinylive`
21+
22+
### How to edit the materials
23+
24+
This is a quarto website, so to make changes to the course text modify the `.qmd` files, or the `_quarto.yml`.
25+
26+
To do a live preview run `quarto preview --render html`, note that while `--render html` is a bit slower, it's the best way to see changes with the included applications.
27+
28+
### Creating an including Shiny Apps
29+
30+
All of the apps live in the `apps` folder, which means that you can use VS Code to edit and test them out.
31+
32+
To include an application insert an `asis` quarto chunk which looks like this:
33+
34+
`````` python
35+
```{python}
36+
##| echo: false
37+
##| output: asis
38+
39+
include_shiny_folder("apps/basic-app")
40+
```
41+
``````
42+
43+
You can also pass options to this function to modify the behaviour of the included app.
44+
45+
To include a set of problem tabs, your app should have two application files. `app.py` which shows the starting point for the problem and `app-solution.py` which shows the target application.
46+
47+
You can then use the `problem_tabs` function to include the tabs.
48+
49+
`````` python
50+
```{python}
51+
##| echo: false
52+
##| output: asis
53+
54+
problem_tabs("apps/basic-app")
55+
```
56+
```````
57+
58+
### Inserting multiple choice questions
59+
60+
You can insert a shinylive app which displays sets of multiple choice questions by supplying a dictionary.
61+
62+
It is a good idea to always wrap this dictionary with the `Quiz` class which validates that it is the right format for the application.
63+
64+
````` python
65+
```{python}
66+
## | echo: false
67+
## | output: asis
68+
69+
from helpers import multiple_choice_app, Quiz
70+
71+
questions = Quiz(
72+
{
73+
"What ui input is used for plots?": {
74+
"choices": ["ui.input_plot", "ui.plot_input", "ui.plotInput"],
75+
"answer": "ui.Input_plot",
76+
},
77+
"How do you remove a reactive link??": {
78+
"choices": ["reactive.isolate", "req", "reactive.Effect"],
79+
"answer": "reactive.isolate",
80+
},
81+
"What should you use to save an image of a plot to disk?": {
82+
"choices": ["reactive.Calc", "@ui.output_plot", "reactive.Effect"],
83+
"answer": "reactive.Effect",
84+
},
85+
}
86+
)
87+
88+
multiple_choice_app(questions)
89+
```
90+
``````

__init__.py

Whitespace-only changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
title: Reveal agenda
2+
author: Andrie de Vries
3+
version: 0.0.3
4+
contributes:
5+
filters:
6+
- reveal-auto-agenda.lua

0 commit comments

Comments
 (0)