Skip to content

Commit 4cee065

Browse files
feat: add Python library for reading and parsing Smile data sets (clo… (#249)
* feat: add Python library for reading and parsing Smile data sets (closes #245) - add a python library in analysis/ folder - add an example ipynb and marimo notebook for processing data - add a claude code file for suggestions on how to format this code - update docs - add tests for this functionality to the overall project and autofix deploy * [autofix.ci] apply automated fixes * fix: prettier was interfering with vitepress blocks - automated run of prettier was modifying the vitepress layout * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 6ac132d commit 4cee065

31 files changed

Lines changed: 10286 additions & 11 deletions

.github/workflows/autofix.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,31 @@ jobs:
159159
- name: Run tests
160160
id: run-tests
161161
run: npm run test
162+
163+
python-test:
164+
runs-on: ubuntu-latest
165+
needs: autofix
166+
defaults:
167+
run:
168+
working-directory: analysis
169+
170+
steps:
171+
- name: Checkout code
172+
uses: actions/checkout@v4
173+
with:
174+
repository: ${{ github.event.pull_request.head.repo.full_name }}
175+
ref: ${{ github.event.pull_request.head.ref }}
176+
177+
- name: Setup Python
178+
uses: actions/setup-python@v5
179+
with:
180+
python-version: '3.11'
181+
182+
- name: Install uv
183+
uses: astral-sh/setup-uv@v4
184+
185+
- name: Install dependencies
186+
run: uv sync --extra dev
187+
188+
- name: Run Python tests
189+
run: uv run pytest --cov=smiledata --cov-report=term-missing

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,18 @@ env/*.zip
3737
*.service-account*
3838
components.d.ts
3939
/.vite
40+
41+
# Python
42+
analysis/.venv/
43+
analysis/__pycache__/
44+
analysis/*.egg-info/
45+
analysis/.ruff_cache/
46+
*.pyc
47+
__pycache__/
48+
.marimo/
49+
50+
# Test coverage
51+
analysis/htmlcov/
52+
analysis/.coverage
53+
.pytest_cache/
54+
analysis/notebooks/__marimo__/session

.prettierrc

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,10 @@
55
"printWidth": 120,
66
"overrides": [
77
{
8-
"files": "docs/*.md",
8+
"files": "docs/**/*.md",
99
"options": {
1010
"printWidth": 80,
11-
"proseWrap": "always"
12-
}
13-
},
14-
{
15-
"files": "docs/*/*.md",
16-
"options": {
17-
"printWidth": 80,
18-
"proseWrap": "always"
11+
"proseWrap": "preserve"
1912
}
2013
}
2114
]

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Online docs: [https://smile.gureckislab.org](https://smile.gureckislab.org)
4040
including Prolific, MTurk, CloudResearch, and more.
4141
- 📝 [Data provenance features](https://smile.gureckislab.org/analysis.html#data-provenance) include an audit trail
4242
of which version of the code was used to create each data file.
43+
- 🐍 Easy-to-use [Python library](https://smile.gureckislab.org/analysis.html#python-analysis-library-smiledata) for data analysis with Polars DataFrames, built-in plotting, and support for Jupyter and Marimo notebooks.
4344
- 😎 Great-looking and detailed docs, if we do say so ourselves!
4445

4546
## License

analysis/.python-version

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

0 commit comments

Comments
 (0)