pystatsv1 0.18.0__py3-none-any.whl

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/__init__.py ADDED
@@ -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"
pystatsv1/paths.py ADDED
@@ -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)
@@ -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
+ [![ci](https://img.shields.io/github/actions/workflow/status/PyStatsV1/PyStatsV1/ci.yml?branch=main)](https://github.com/PyStatsV1/PyStatsV1/actions/workflows/ci.yml)
37
+ [![release](https://img.shields.io/github/v/tag/PyStatsV1/PyStatsV1?label=release)](https://github.com/PyStatsV1/PyStatsV1/tags)
38
+ [![Documentation Status](https://readthedocs.org/projects/pystatsv1/badge/?version=latest)](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,7 @@
1
+ pystatsv1/__init__.py,sha256=BxGDqhAIQYH9fdNfWYUEEYe1fG8a4J3hwXiYhmtwOLk,617
2
+ pystatsv1/paths.py,sha256=_N5OxNsHewnpSOgoGMXoW7y0eXwOcQ_OJMyRef9OswI,1120
3
+ pystatsv1-0.18.0.dist-info/licenses/LICENSE,sha256=y1zqwmZEm_3E_rohXFs5EwIIB6uvAUB_KcVPFuK4j3U,1120
4
+ pystatsv1-0.18.0.dist-info/METADATA,sha256=327_M-wXIOVxQngCguVrEvwCFxR1NS67ZZ9I0mbRc6o,7566
5
+ pystatsv1-0.18.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
+ pystatsv1-0.18.0.dist-info/top_level.txt,sha256=WlU1GU7q1JZyOlQv8NS3ciIhsZUL3A55MZkZS7WAnG8,10
7
+ pystatsv1-0.18.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -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 @@
1
+ pystatsv1