pystatsv1 0.18.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pystatsv1-0.18.0/LICENSE +22 -0
- pystatsv1-0.18.0/PKG-INFO +243 -0
- pystatsv1-0.18.0/README.md +210 -0
- pystatsv1-0.18.0/pyproject.toml +22 -0
- pystatsv1-0.18.0/setup.cfg +4 -0
- pystatsv1-0.18.0/setup.py +4 -0
- pystatsv1-0.18.0/src/pystatsv1/__init__.py +33 -0
- pystatsv1-0.18.0/src/pystatsv1/paths.py +44 -0
- pystatsv1-0.18.0/src/pystatsv1.egg-info/PKG-INFO +243 -0
- pystatsv1-0.18.0/src/pystatsv1.egg-info/SOURCES.txt +39 -0
- pystatsv1-0.18.0/src/pystatsv1.egg-info/dependency_links.txt +1 -0
- pystatsv1-0.18.0/src/pystatsv1.egg-info/top_level.txt +1 -0
- pystatsv1-0.18.0/tests/test_ch13_fitness.py +28 -0
- pystatsv1-0.18.0/tests/test_ch13_stroop.py +36 -0
- pystatsv1-0.18.0/tests/test_cli_smoke.py +59 -0
- pystatsv1-0.18.0/tests/test_psych_ch10_independent_t.py +125 -0
- pystatsv1-0.18.0/tests/test_psych_ch10_problem_set.py +84 -0
- pystatsv1-0.18.0/tests/test_psych_ch11_paired_t.py +86 -0
- pystatsv1-0.18.0/tests/test_psych_ch11_problem_set.py +46 -0
- pystatsv1-0.18.0/tests/test_psych_ch12_one_way_anova.py +105 -0
- pystatsv1-0.18.0/tests/test_psych_ch12_problem_set.py +64 -0
- pystatsv1-0.18.0/tests/test_psych_ch13_two_way_anova.py +107 -0
- pystatsv1-0.18.0/tests/test_psych_ch14_repeated_measures_anova.py +86 -0
- pystatsv1-0.18.0/tests/test_psych_ch14a_pingouin_mixed_demo.py +42 -0
- pystatsv1-0.18.0/tests/test_psych_ch14a_pingouin_rm_demo.py +41 -0
- pystatsv1-0.18.0/tests/test_psych_ch15_correlation.py +29 -0
- pystatsv1-0.18.0/tests/test_psych_ch15a_pingouin_pairwise_demo.py +42 -0
- pystatsv1-0.18.0/tests/test_psych_ch15a_pingouin_partial_demo.py +47 -0
- pystatsv1-0.18.0/tests/test_psych_ch16_regression.py +78 -0
- pystatsv1-0.18.0/tests/test_psych_ch16a_pingouin_regression_demo.py +102 -0
- pystatsv1-0.18.0/tests/test_psych_ch16b_pingouin_regression_diagnostics.py +96 -0
- pystatsv1-0.18.0/tests/test_psych_ch17_mixed_models.py +71 -0
- pystatsv1-0.18.0/tests/test_psych_ch18_ancova.py +51 -0
- pystatsv1-0.18.0/tests/test_psych_ch19_nonparametrics.py +39 -0
- pystatsv1-0.18.0/tests/test_psych_ch19a_rank_nonparametrics.py +76 -0
- pystatsv1-0.18.0/tests/test_psych_ch20_responsible_researcher.py +52 -0
- pystatsv1-0.18.0/tests/test_psych_ch6_normal_zscores.py +23 -0
- pystatsv1-0.18.0/tests/test_psych_ch7_sampling.py +69 -0
- pystatsv1-0.18.0/tests/test_psych_ch8_one_sample_test.py +94 -0
- pystatsv1-0.18.0/tests/test_psych_ch9_one_sample_ci.py +36 -0
- pystatsv1-0.18.0/tests/test_psych_sleep_study.py +60 -0
pystatsv1-0.18.0/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Nicholas Elliott Karlson
|
|
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 (including the next
|
|
13
|
+
paragraph) shall be included in all copies or substantial portions of the
|
|
14
|
+
Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
22
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pystatsv1
|
|
3
|
+
Version: 0.18.0
|
|
4
|
+
Summary: PyStatsV1: applied statistics labs in Python.
|
|
5
|
+
Author: PyStatsV1 contributors
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2025 Nicholas Elliott Karlson
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the “Software”), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice (including the next
|
|
18
|
+
paragraph) shall be included in all copies or substantial portions of the
|
|
19
|
+
Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
27
|
+
THE SOFTWARE.
|
|
28
|
+
|
|
29
|
+
Requires-Python: >=3.10
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
License-File: LICENSE
|
|
32
|
+
Dynamic: license-file
|
|
33
|
+
|
|
34
|
+
# PyStatsV1 — Applied Statistics (R ↔ Python)
|
|
35
|
+
|
|
36
|
+
[](https://github.com/PyStatsV1/PyStatsV1/actions/workflows/ci.yml)
|
|
37
|
+
[](https://github.com/PyStatsV1/PyStatsV1/tags)
|
|
38
|
+
[](https://pystatsv1.readthedocs.io/en/latest/?badge=latest)
|
|
39
|
+
|
|
40
|
+
PyStatsV1 provides **plain, transparent Python scripts** that mirror classical **R textbook analyses**, making it easy for students, tutors, and practitioners to:
|
|
41
|
+
|
|
42
|
+
- run statistical analyses from the command line,
|
|
43
|
+
- generate synthetic data for teaching,
|
|
44
|
+
- produce figures and JSON summaries,
|
|
45
|
+
- and compare outputs across R/Python.
|
|
46
|
+
|
|
47
|
+
The project follows a **chapter-based structure** — each chapter includes a simulator, an analyzer, Makefile targets, and CI smoke tests.
|
|
48
|
+
|
|
49
|
+
### Who is this for?
|
|
50
|
+
|
|
51
|
+
PyStatsV1 is designed for:
|
|
52
|
+
|
|
53
|
+
- **Students** who want to run textbook-style analyses in real Python code.
|
|
54
|
+
- **Instructors / TAs** who need reproducible demos and synthetic data for lectures, labs, or assignments.
|
|
55
|
+
- **Practitioners** who prefer plain scripts and command-line tools over large frameworks.
|
|
56
|
+
- **R users** who want a clear, line-by-line bridge from R examples into Python.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 🚀 Quick Start
|
|
61
|
+
|
|
62
|
+
### 1. Create and activate a virtual environment
|
|
63
|
+
|
|
64
|
+
**macOS / Linux**
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
python -m venv .venv && source .venv/bin/activate
|
|
68
|
+
python -m pip install -U pip
|
|
69
|
+
pip install -r requirements.txt
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**Windows (Git Bash or PowerShell)**
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
# Git Bash first; PowerShell as fallback
|
|
76
|
+
python -m venv .venv; source .venv/Scripts/activate 2>/dev/null || .venv\Scripts\Activate.ps1
|
|
77
|
+
python -m pip install -U pip
|
|
78
|
+
pip install -r requirements.txt
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## 📊 Chapter Scripts
|
|
84
|
+
|
|
85
|
+
### Chapter 1 — Introduction
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
python -m scripts.ch01_introduction
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Chapter 13 — Within-subjects & Mixed Models
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
make ch13-ci # tiny CI smoke
|
|
95
|
+
make ch13 # full demo
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Chapter 14 — Tutoring A/B Test (two-sample t-test)
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
make ch14-ci
|
|
102
|
+
make ch14
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Chapter 15 — Reliability (Cronbach’s α, ICC, Bland–Altman)
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
make ch15-ci
|
|
109
|
+
make ch15
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
For an overview of what each chapter contains:
|
|
113
|
+
|
|
114
|
+
- **[CHAPTERS.md](CHAPTERS.md)** — coverage, commands, and outputs
|
|
115
|
+
- **[ROADMAP.md](ROADMAP.md)** — planned chapters (e.g., Ch16 Epidemiology RR)
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## 📚 Project Docs & Policies
|
|
120
|
+
|
|
121
|
+
PyStatsV1 is structured with a core set of documentation:
|
|
122
|
+
|
|
123
|
+
- **[CONTRIBUTING.md](CONTRIBUTING.md)** — environment setup, development workflow, Makefile usage, PR process.
|
|
124
|
+
- **[CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)** — community expectations & enforcement.
|
|
125
|
+
- **[CHAPTERS.md](CHAPTERS.md)** — high-level description of all implemented chapters.
|
|
126
|
+
- **[ROADMAP.md](ROADMAP.md)** — the future of the project: upcoming chapters & milestones.
|
|
127
|
+
- **[SECURITY.md](SECURITY.md)** — how to privately report vulnerabilities.
|
|
128
|
+
- **[SUPPORT.md](SUPPORT.md)** — how to get help or ask questions.
|
|
129
|
+
- **Case Study Template:** [`docs/case_study_template.md`](docs/case_study_template.md) — structure for building new chapter teaching documentation.
|
|
130
|
+
|
|
131
|
+
If you want to contribute, start with **[CONTRIBUTING.md](CONTRIBUTING.md)** and check issues labeled
|
|
132
|
+
`good first issue` or `help wanted`.
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## 🤝 Contribute in 5 minutes
|
|
137
|
+
|
|
138
|
+
Want to help but not sure where to start?
|
|
139
|
+
|
|
140
|
+
1. **Browse issues** labeled `good first issue` or `help wanted`.
|
|
141
|
+
2. **Pick one small thing** (typo, doc improvement, tiny refactor, or a missing test).
|
|
142
|
+
3. **Fork & clone** the repo.
|
|
143
|
+
4. **Create and activate a virtual environment**, then:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
pip install -r requirements.txt
|
|
147
|
+
make lint
|
|
148
|
+
make test
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
5. Make your change, and ensure `make lint` and `make test` both pass.
|
|
152
|
+
6. Open a Pull Request and briefly describe:
|
|
153
|
+
- what you changed,
|
|
154
|
+
- how you tested it,
|
|
155
|
+
- which chapter(s) it touches, if any.
|
|
156
|
+
|
|
157
|
+
Maintainer promise: we’ll give constructive feedback and help first-time contributors land their PRs.
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## 🗺️ Roadmap snapshot
|
|
162
|
+
|
|
163
|
+
High-level upcoming work (see `ROADMAP.md` for details):
|
|
164
|
+
|
|
165
|
+
- ✅ v0.17.0 — Onboarding and issue templates
|
|
166
|
+
- ⏳ Next steps:
|
|
167
|
+
- Additional regression chapters (logistic, Poisson, etc.)
|
|
168
|
+
- Power and sample size simulations
|
|
169
|
+
- Epidemiology-focused examples (risk ratios, odds ratios)
|
|
170
|
+
- More teaching case studies using `docs/case_study_template.md`
|
|
171
|
+
|
|
172
|
+
If you’d like to champion a specific chapter or topic, open an issue and we can design it together.
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## 🧪 Development Workflow
|
|
177
|
+
|
|
178
|
+
From the project root:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
make lint # ruff check
|
|
182
|
+
make test # pytest
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
To run chapter smoke tests:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
make ch13-ci
|
|
189
|
+
make ch14-ci
|
|
190
|
+
make ch15-ci
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
All synthetic data is written to:
|
|
194
|
+
|
|
195
|
+
- `data/synthetic/`
|
|
196
|
+
- `outputs/<chapter>/`
|
|
197
|
+
|
|
198
|
+
…and ignored by Git.
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## 🔀 Pull Requests
|
|
203
|
+
|
|
204
|
+
Every pull request should:
|
|
205
|
+
|
|
206
|
+
- pass `make lint` and `make test`,
|
|
207
|
+
- avoid committing generated outputs,
|
|
208
|
+
- follow the structure described in **[CONTRIBUTING.md](CONTRIBUTING.md)**.
|
|
209
|
+
|
|
210
|
+
GitHub provides:
|
|
211
|
+
|
|
212
|
+
- 🐛 Bug report template
|
|
213
|
+
- 💡 Feature request template
|
|
214
|
+
- 📘 Good first issue template
|
|
215
|
+
- 🔀 Pull request template
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## 🔒 Security
|
|
220
|
+
|
|
221
|
+
If you believe you’ve found a security issue, **do not** open a public GitHub issue.
|
|
222
|
+
Follow the private disclosure process described in **[SECURITY.md](SECURITY.md)**.
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## 💬 Community & support
|
|
227
|
+
|
|
228
|
+
- **Questions?**
|
|
229
|
+
Open a GitHub issue with the `question` label.
|
|
230
|
+
|
|
231
|
+
- **Using PyStatsV1 in a course?**
|
|
232
|
+
We’d love to hear about it — open an issue titled `Course report: <institution>` or mention it in your PR description.
|
|
233
|
+
|
|
234
|
+
- **Feature ideas / chapter requests?**
|
|
235
|
+
Open an issue with the `enhancement` or `chapter-idea` label.
|
|
236
|
+
|
|
237
|
+
As the project grows, we plan to enable GitHub Discussions and possibly a lightweight chat space for instructors and contributors.
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## 📜 License
|
|
242
|
+
|
|
243
|
+
MIT © 2025 Nicholas Elliott Karlson
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# PyStatsV1 — Applied Statistics (R ↔ Python)
|
|
2
|
+
|
|
3
|
+
[](https://github.com/PyStatsV1/PyStatsV1/actions/workflows/ci.yml)
|
|
4
|
+
[](https://github.com/PyStatsV1/PyStatsV1/tags)
|
|
5
|
+
[](https://pystatsv1.readthedocs.io/en/latest/?badge=latest)
|
|
6
|
+
|
|
7
|
+
PyStatsV1 provides **plain, transparent Python scripts** that mirror classical **R textbook analyses**, making it easy for students, tutors, and practitioners to:
|
|
8
|
+
|
|
9
|
+
- run statistical analyses from the command line,
|
|
10
|
+
- generate synthetic data for teaching,
|
|
11
|
+
- produce figures and JSON summaries,
|
|
12
|
+
- and compare outputs across R/Python.
|
|
13
|
+
|
|
14
|
+
The project follows a **chapter-based structure** — each chapter includes a simulator, an analyzer, Makefile targets, and CI smoke tests.
|
|
15
|
+
|
|
16
|
+
### Who is this for?
|
|
17
|
+
|
|
18
|
+
PyStatsV1 is designed for:
|
|
19
|
+
|
|
20
|
+
- **Students** who want to run textbook-style analyses in real Python code.
|
|
21
|
+
- **Instructors / TAs** who need reproducible demos and synthetic data for lectures, labs, or assignments.
|
|
22
|
+
- **Practitioners** who prefer plain scripts and command-line tools over large frameworks.
|
|
23
|
+
- **R users** who want a clear, line-by-line bridge from R examples into Python.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 🚀 Quick Start
|
|
28
|
+
|
|
29
|
+
### 1. Create and activate a virtual environment
|
|
30
|
+
|
|
31
|
+
**macOS / Linux**
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
python -m venv .venv && source .venv/bin/activate
|
|
35
|
+
python -m pip install -U pip
|
|
36
|
+
pip install -r requirements.txt
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Windows (Git Bash or PowerShell)**
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Git Bash first; PowerShell as fallback
|
|
43
|
+
python -m venv .venv; source .venv/Scripts/activate 2>/dev/null || .venv\Scripts\Activate.ps1
|
|
44
|
+
python -m pip install -U pip
|
|
45
|
+
pip install -r requirements.txt
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## 📊 Chapter Scripts
|
|
51
|
+
|
|
52
|
+
### Chapter 1 — Introduction
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
python -m scripts.ch01_introduction
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Chapter 13 — Within-subjects & Mixed Models
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
make ch13-ci # tiny CI smoke
|
|
62
|
+
make ch13 # full demo
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Chapter 14 — Tutoring A/B Test (two-sample t-test)
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
make ch14-ci
|
|
69
|
+
make ch14
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Chapter 15 — Reliability (Cronbach’s α, ICC, Bland–Altman)
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
make ch15-ci
|
|
76
|
+
make ch15
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
For an overview of what each chapter contains:
|
|
80
|
+
|
|
81
|
+
- **[CHAPTERS.md](CHAPTERS.md)** — coverage, commands, and outputs
|
|
82
|
+
- **[ROADMAP.md](ROADMAP.md)** — planned chapters (e.g., Ch16 Epidemiology RR)
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## 📚 Project Docs & Policies
|
|
87
|
+
|
|
88
|
+
PyStatsV1 is structured with a core set of documentation:
|
|
89
|
+
|
|
90
|
+
- **[CONTRIBUTING.md](CONTRIBUTING.md)** — environment setup, development workflow, Makefile usage, PR process.
|
|
91
|
+
- **[CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)** — community expectations & enforcement.
|
|
92
|
+
- **[CHAPTERS.md](CHAPTERS.md)** — high-level description of all implemented chapters.
|
|
93
|
+
- **[ROADMAP.md](ROADMAP.md)** — the future of the project: upcoming chapters & milestones.
|
|
94
|
+
- **[SECURITY.md](SECURITY.md)** — how to privately report vulnerabilities.
|
|
95
|
+
- **[SUPPORT.md](SUPPORT.md)** — how to get help or ask questions.
|
|
96
|
+
- **Case Study Template:** [`docs/case_study_template.md`](docs/case_study_template.md) — structure for building new chapter teaching documentation.
|
|
97
|
+
|
|
98
|
+
If you want to contribute, start with **[CONTRIBUTING.md](CONTRIBUTING.md)** and check issues labeled
|
|
99
|
+
`good first issue` or `help wanted`.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## 🤝 Contribute in 5 minutes
|
|
104
|
+
|
|
105
|
+
Want to help but not sure where to start?
|
|
106
|
+
|
|
107
|
+
1. **Browse issues** labeled `good first issue` or `help wanted`.
|
|
108
|
+
2. **Pick one small thing** (typo, doc improvement, tiny refactor, or a missing test).
|
|
109
|
+
3. **Fork & clone** the repo.
|
|
110
|
+
4. **Create and activate a virtual environment**, then:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
pip install -r requirements.txt
|
|
114
|
+
make lint
|
|
115
|
+
make test
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
5. Make your change, and ensure `make lint` and `make test` both pass.
|
|
119
|
+
6. Open a Pull Request and briefly describe:
|
|
120
|
+
- what you changed,
|
|
121
|
+
- how you tested it,
|
|
122
|
+
- which chapter(s) it touches, if any.
|
|
123
|
+
|
|
124
|
+
Maintainer promise: we’ll give constructive feedback and help first-time contributors land their PRs.
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## 🗺️ Roadmap snapshot
|
|
129
|
+
|
|
130
|
+
High-level upcoming work (see `ROADMAP.md` for details):
|
|
131
|
+
|
|
132
|
+
- ✅ v0.17.0 — Onboarding and issue templates
|
|
133
|
+
- ⏳ Next steps:
|
|
134
|
+
- Additional regression chapters (logistic, Poisson, etc.)
|
|
135
|
+
- Power and sample size simulations
|
|
136
|
+
- Epidemiology-focused examples (risk ratios, odds ratios)
|
|
137
|
+
- More teaching case studies using `docs/case_study_template.md`
|
|
138
|
+
|
|
139
|
+
If you’d like to champion a specific chapter or topic, open an issue and we can design it together.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## 🧪 Development Workflow
|
|
144
|
+
|
|
145
|
+
From the project root:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
make lint # ruff check
|
|
149
|
+
make test # pytest
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
To run chapter smoke tests:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
make ch13-ci
|
|
156
|
+
make ch14-ci
|
|
157
|
+
make ch15-ci
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
All synthetic data is written to:
|
|
161
|
+
|
|
162
|
+
- `data/synthetic/`
|
|
163
|
+
- `outputs/<chapter>/`
|
|
164
|
+
|
|
165
|
+
…and ignored by Git.
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## 🔀 Pull Requests
|
|
170
|
+
|
|
171
|
+
Every pull request should:
|
|
172
|
+
|
|
173
|
+
- pass `make lint` and `make test`,
|
|
174
|
+
- avoid committing generated outputs,
|
|
175
|
+
- follow the structure described in **[CONTRIBUTING.md](CONTRIBUTING.md)**.
|
|
176
|
+
|
|
177
|
+
GitHub provides:
|
|
178
|
+
|
|
179
|
+
- 🐛 Bug report template
|
|
180
|
+
- 💡 Feature request template
|
|
181
|
+
- 📘 Good first issue template
|
|
182
|
+
- 🔀 Pull request template
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## 🔒 Security
|
|
187
|
+
|
|
188
|
+
If you believe you’ve found a security issue, **do not** open a public GitHub issue.
|
|
189
|
+
Follow the private disclosure process described in **[SECURITY.md](SECURITY.md)**.
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## 💬 Community & support
|
|
194
|
+
|
|
195
|
+
- **Questions?**
|
|
196
|
+
Open a GitHub issue with the `question` label.
|
|
197
|
+
|
|
198
|
+
- **Using PyStatsV1 in a course?**
|
|
199
|
+
We’d love to hear about it — open an issue titled `Course report: <institution>` or mention it in your PR description.
|
|
200
|
+
|
|
201
|
+
- **Feature ideas / chapter requests?**
|
|
202
|
+
Open an issue with the `enhancement` or `chapter-idea` label.
|
|
203
|
+
|
|
204
|
+
As the project grows, we plan to enable GitHub Discussions and possibly a lightweight chat space for instructors and contributors.
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## 📜 License
|
|
209
|
+
|
|
210
|
+
MIT © 2025 Nicholas Elliott Karlson
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "pystatsv1"
|
|
7
|
+
version = "0.18.0"
|
|
8
|
+
description = "PyStatsV1: applied statistics labs in Python."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
authors = [
|
|
12
|
+
{ name = "PyStatsV1 contributors" }
|
|
13
|
+
]
|
|
14
|
+
license = { file = "LICENSE" }
|
|
15
|
+
# Runtime dependencies are installed from requirements.txt in CI.
|
|
16
|
+
dependencies = []
|
|
17
|
+
|
|
18
|
+
[tool.setuptools]
|
|
19
|
+
package-dir = { "" = "src" }
|
|
20
|
+
|
|
21
|
+
[tool.setuptools.packages.find]
|
|
22
|
+
where = ["src"]
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Top-level package for the PyStatsV1 project.
|
|
3
|
+
|
|
4
|
+
Convenience re-exports:
|
|
5
|
+
|
|
6
|
+
- DATA_DIR, SYNTHETIC_DATA_DIR
|
|
7
|
+
- OUTPUTS_DIR, TRACK_C_OUTPUT_DIR
|
|
8
|
+
- PROJECT_ROOT
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
12
|
+
|
|
13
|
+
from .paths import ( # noqa: F401
|
|
14
|
+
DATA_DIR,
|
|
15
|
+
SYNTHETIC_DATA_DIR,
|
|
16
|
+
OUTPUTS_DIR,
|
|
17
|
+
TRACK_C_OUTPUT_DIR,
|
|
18
|
+
PROJECT_ROOT,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
__all__ = [
|
|
22
|
+
"DATA_DIR",
|
|
23
|
+
"SYNTHETIC_DATA_DIR",
|
|
24
|
+
"OUTPUTS_DIR",
|
|
25
|
+
"TRACK_C_OUTPUT_DIR",
|
|
26
|
+
"PROJECT_ROOT",
|
|
27
|
+
"__version__",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
try:
|
|
31
|
+
__version__ = version("pystatsv1")
|
|
32
|
+
except PackageNotFoundError: # pragma: no cover
|
|
33
|
+
__version__ = "0.0.0"
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Centralized filesystem paths for the PyStatsV1 project.
|
|
3
|
+
|
|
4
|
+
Repo layout:
|
|
5
|
+
|
|
6
|
+
PyStatsV1/
|
|
7
|
+
data/
|
|
8
|
+
synthetic/
|
|
9
|
+
outputs/
|
|
10
|
+
track_c/
|
|
11
|
+
docs/
|
|
12
|
+
scripts/
|
|
13
|
+
src/pystatsv1/...
|
|
14
|
+
|
|
15
|
+
This module exposes a small set of reusable Path objects so scripts and
|
|
16
|
+
tests don't have to duplicate logic for finding the project root.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
from __future__ import annotations
|
|
20
|
+
|
|
21
|
+
from pathlib import Path
|
|
22
|
+
|
|
23
|
+
# src/pystatsv1/paths.py -> .../src/pystatsv1 -> .../src -> .../PyStatsV1
|
|
24
|
+
PACKAGE_ROOT = Path(__file__).resolve().parent
|
|
25
|
+
PROJECT_ROOT = PACKAGE_ROOT.parents[1]
|
|
26
|
+
|
|
27
|
+
# Data directories
|
|
28
|
+
DATA_DIR = PROJECT_ROOT / "data"
|
|
29
|
+
SYNTHETIC_DATA_DIR = DATA_DIR / "synthetic"
|
|
30
|
+
|
|
31
|
+
# Outputs (top-level and Track C specific)
|
|
32
|
+
OUTPUTS_DIR = PROJECT_ROOT / "outputs"
|
|
33
|
+
TRACK_C_OUTPUT_DIR = OUTPUTS_DIR / "track_c"
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def ensure_dir(path: Path) -> Path:
|
|
37
|
+
"""Ensure that ``path`` exists (mkdir -p) and return it."""
|
|
38
|
+
path.mkdir(parents=True, exist_ok=True)
|
|
39
|
+
return path
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def ensure_output_subdir(name: str) -> Path:
|
|
43
|
+
"""Ensure that a subdirectory of OUTPUTS_DIR exists and return it."""
|
|
44
|
+
return ensure_dir(OUTPUTS_DIR / name)
|