pysofra 0.1.0a1__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.
Files changed (108) hide show
  1. pysofra-0.1.0a1/.gitignore +90 -0
  2. pysofra-0.1.0a1/CHANGELOG.md +29 -0
  3. pysofra-0.1.0a1/LICENSE +674 -0
  4. pysofra-0.1.0a1/NOTICE +18 -0
  5. pysofra-0.1.0a1/PKG-INFO +301 -0
  6. pysofra-0.1.0a1/README.md +235 -0
  7. pysofra-0.1.0a1/pyproject.toml +204 -0
  8. pysofra-0.1.0a1/src/pysofra/__init__.py +82 -0
  9. pysofra-0.1.0a1/src/pysofra/core/__init__.py +14 -0
  10. pysofra-0.1.0a1/src/pysofra/core/compose.py +167 -0
  11. pysofra-0.1.0a1/src/pysofra/core/format.py +155 -0
  12. pysofra-0.1.0a1/src/pysofra/core/frames.py +69 -0
  13. pysofra-0.1.0a1/src/pysofra/core/schema.py +128 -0
  14. pysofra-0.1.0a1/src/pysofra/core/table.py +924 -0
  15. pysofra-0.1.0a1/src/pysofra/io/__init__.py +1 -0
  16. pysofra-0.1.0a1/src/pysofra/models/__init__.py +6 -0
  17. pysofra-0.1.0a1/src/pysofra/models/extract.py +249 -0
  18. pysofra-0.1.0a1/src/pysofra/models/pool.py +119 -0
  19. pysofra-0.1.0a1/src/pysofra/models/regression.py +507 -0
  20. pysofra-0.1.0a1/src/pysofra/models/survival.py +395 -0
  21. pysofra-0.1.0a1/src/pysofra/models/uvregression.py +438 -0
  22. pysofra-0.1.0a1/src/pysofra/notebook/__init__.py +6 -0
  23. pysofra-0.1.0a1/src/pysofra/plot/__init__.py +23 -0
  24. pysofra-0.1.0a1/src/pysofra/plot/_backend.py +32 -0
  25. pysofra-0.1.0a1/src/pysofra/plot/forest.py +159 -0
  26. pysofra-0.1.0a1/src/pysofra/plot/inline.py +171 -0
  27. pysofra-0.1.0a1/src/pysofra/plot/km.py +249 -0
  28. pysofra-0.1.0a1/src/pysofra/render/__init__.py +28 -0
  29. pysofra-0.1.0a1/src/pysofra/render/_zip_determinism.py +57 -0
  30. pysofra-0.1.0a1/src/pysofra/render/base.py +22 -0
  31. pysofra-0.1.0a1/src/pysofra/render/docx.py +286 -0
  32. pysofra-0.1.0a1/src/pysofra/render/html.py +442 -0
  33. pysofra-0.1.0a1/src/pysofra/render/image.py +130 -0
  34. pysofra-0.1.0a1/src/pysofra/render/latex.py +253 -0
  35. pysofra-0.1.0a1/src/pysofra/render/markdown.py +128 -0
  36. pysofra-0.1.0a1/src/pysofra/render/pptx.py +340 -0
  37. pysofra-0.1.0a1/src/pysofra/render/xlsx.py +226 -0
  38. pysofra-0.1.0a1/src/pysofra/summary/__init__.py +6 -0
  39. pysofra-0.1.0a1/src/pysofra/summary/calibrate.py +214 -0
  40. pysofra-0.1.0a1/src/pysofra/summary/design.py +246 -0
  41. pysofra-0.1.0a1/src/pysofra/summary/effect_size.py +187 -0
  42. pysofra-0.1.0a1/src/pysofra/summary/extras.py +745 -0
  43. pysofra-0.1.0a1/src/pysofra/summary/smd.py +133 -0
  44. pysofra-0.1.0a1/src/pysofra/summary/stats.py +135 -0
  45. pysofra-0.1.0a1/src/pysofra/summary/tbl_cross.py +339 -0
  46. pysofra-0.1.0a1/src/pysofra/summary/tbl_one.py +1220 -0
  47. pysofra-0.1.0a1/src/pysofra/summary/tbl_summary.py +51 -0
  48. pysofra-0.1.0a1/src/pysofra/summary/tests.py +370 -0
  49. pysofra-0.1.0a1/src/pysofra/summary/typing.py +129 -0
  50. pysofra-0.1.0a1/src/pysofra/summary/weights.py +161 -0
  51. pysofra-0.1.0a1/src/pysofra/themes/__init__.py +5 -0
  52. pysofra-0.1.0a1/src/pysofra/themes/registry.py +272 -0
  53. pysofra-0.1.0a1/tests/conftest.py +39 -0
  54. pysofra-0.1.0a1/tests/fixtures/scipy_validation/README.md +45 -0
  55. pysofra-0.1.0a1/tests/fixtures/scipy_validation/anova_oneway.json +33 -0
  56. pysofra-0.1.0a1/tests/fixtures/scipy_validation/chi_square.json +23 -0
  57. pysofra-0.1.0a1/tests/fixtures/scipy_validation/fisher_2x2.json +17 -0
  58. pysofra-0.1.0a1/tests/fixtures/scipy_validation/kruskal_wallis.json +32 -0
  59. pysofra-0.1.0a1/tests/fixtures/scipy_validation/student_t.json +32 -0
  60. pysofra-0.1.0a1/tests/fixtures/scipy_validation/svyttest.json +48 -0
  61. pysofra-0.1.0a1/tests/fixtures/scipy_validation/weighted_mean.json +34 -0
  62. pysofra-0.1.0a1/tests/fixtures/scipy_validation/welch_t_test.json +34 -0
  63. pysofra-0.1.0a1/tests/fixtures/scipy_validation/wilcoxon_rank_sum.json +32 -0
  64. pysofra-0.1.0a1/tests/test_compose.py +59 -0
  65. pysofra-0.1.0a1/tests/test_compose_edges.py +574 -0
  66. pysofra-0.1.0a1/tests/test_conditional_formatting.py +104 -0
  67. pysofra-0.1.0a1/tests/test_design_regression.py +140 -0
  68. pysofra-0.1.0a1/tests/test_extract_edges.py +322 -0
  69. pysofra-0.1.0a1/tests/test_extras_edges.py +818 -0
  70. pysofra-0.1.0a1/tests/test_extras_edges_2.py +385 -0
  71. pysofra-0.1.0a1/tests/test_format.py +89 -0
  72. pysofra-0.1.0a1/tests/test_joss_api_stability.py +206 -0
  73. pysofra-0.1.0a1/tests/test_joss_property_invariants.py +299 -0
  74. pysofra-0.1.0a1/tests/test_joss_renderer_consistency.py +248 -0
  75. pysofra-0.1.0a1/tests/test_joss_statistical_correctness.py +496 -0
  76. pysofra-0.1.0a1/tests/test_latex_pptx.py +112 -0
  77. pysofra-0.1.0a1/tests/test_misc_fixes.py +124 -0
  78. pysofra-0.1.0a1/tests/test_modifier_edges.py +461 -0
  79. pysofra-0.1.0a1/tests/test_multi_model.py +128 -0
  80. pysofra-0.1.0a1/tests/test_partial_modifiers.py +256 -0
  81. pysofra-0.1.0a1/tests/test_partials.py +229 -0
  82. pysofra-0.1.0a1/tests/test_plot_determinism.py +127 -0
  83. pysofra-0.1.0a1/tests/test_plot_embedding.py +80 -0
  84. pysofra-0.1.0a1/tests/test_plots.py +103 -0
  85. pysofra-0.1.0a1/tests/test_polars.py +53 -0
  86. pysofra-0.1.0a1/tests/test_pptx_overflow.py +170 -0
  87. pysofra-0.1.0a1/tests/test_rao_scott.py +50 -0
  88. pysofra-0.1.0a1/tests/test_regression.py +90 -0
  89. pysofra-0.1.0a1/tests/test_regressions.py +1431 -0
  90. pysofra-0.1.0a1/tests/test_render_edges.py +450 -0
  91. pysofra-0.1.0a1/tests/test_render_edges_2.py +311 -0
  92. pysofra-0.1.0a1/tests/test_rendering.py +193 -0
  93. pysofra-0.1.0a1/tests/test_scipy_validation.py +182 -0
  94. pysofra-0.1.0a1/tests/test_snapshot.py +54 -0
  95. pysofra-0.1.0a1/tests/test_stats.py +182 -0
  96. pysofra-0.1.0a1/tests/test_summary_edges.py +211 -0
  97. pysofra-0.1.0a1/tests/test_summary_edges_2.py +424 -0
  98. pysofra-0.1.0a1/tests/test_survey_design.py +147 -0
  99. pysofra-0.1.0a1/tests/test_survey_extensions.py +231 -0
  100. pysofra-0.1.0a1/tests/test_survival.py +87 -0
  101. pysofra-0.1.0a1/tests/test_table_edges.py +426 -0
  102. pysofra-0.1.0a1/tests/test_tbl_one.py +108 -0
  103. pysofra-0.1.0a1/tests/test_test_overrides.py +132 -0
  104. pysofra-0.1.0a1/tests/test_uvregression_factors.py +111 -0
  105. pysofra-0.1.0a1/tests/test_validation_fixes.py +219 -0
  106. pysofra-0.1.0a1/tests/test_weights.py +94 -0
  107. pysofra-0.1.0a1/tests/test_wishlist.py +352 -0
  108. pysofra-0.1.0a1/tests/test_xlsx.py +53 -0
@@ -0,0 +1,90 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.egg-info/
4
+ dist/
5
+ build/
6
+ .venv/
7
+ venv/
8
+ .env
9
+
10
+ .pytest_cache/
11
+ .mypy_cache/
12
+ .ruff_cache/
13
+ .coverage
14
+ htmlcov/
15
+
16
+ .DS_Store
17
+ .idea/
18
+ .vscode/
19
+ .claude/
20
+
21
+ site/
22
+ docs/_build/
23
+
24
+ # Tutorial / example export artefacts — produced on demand by
25
+ # scripts/render_tutorial.py, not part of the source tree.
26
+ *.docx
27
+ *.pptx
28
+ *.xlsx
29
+ examples/tutorial_*.docx
30
+ examples/tutorial_*.pptx
31
+ examples/tutorial_*.xlsx
32
+ examples/tutorial_*.png
33
+ !tests/fixtures/**/*.docx
34
+ !tests/fixtures/**/*.pptx
35
+ !tests/fixtures/**/*.xlsx
36
+
37
+ # Hypothesis example database (auto-managed)
38
+ .hypothesis/
39
+
40
+ # uv writes a lockfile when ``uv add`` / ``uv pip install`` is used
41
+ # locally; the project pins its runtime versions explicitly in
42
+ # pyproject.toml + paper/replication/requirements.txt, so the uv
43
+ # lockfile is a local convenience that should not ship.
44
+ uv.lock
45
+
46
+ # JSS paper bundle — paper/ contains the manuscript, bibliography,
47
+ # embedded figures, and replication archive. The .tex / .bib / .py /
48
+ # .R sources are ALWAYS tracked. Replication outputs are tracked in
49
+ # the text formats reviewers diff (json / tex / md / html / png /
50
+ # pdf / svg) so the archive ships with a working baseline; only the
51
+ # heavy regenerable Office binaries (docx / pptx / xlsx) and the
52
+ # fontconfig / mpl cache directories are ignored.
53
+ paper/replication/trial.csv
54
+ paper/replication/table*.docx
55
+ paper/replication/table*.pptx
56
+ paper/replication/table*.xlsx
57
+ paper/replication/.mplconfig/
58
+
59
+ # Submission-required text outputs and figures: explicit re-include.
60
+ # The blanket repo-wide ``*.docx`` rule at the top of this file would
61
+ # otherwise eat ``paper/replication/table*.html`` etc. — these
62
+ # negations keep them tracked.
63
+ !paper/replication/paper_outputs*.json
64
+ !paper/replication/table*.html
65
+ !paper/replication/table*.tex
66
+ !paper/replication/table*.md
67
+ !paper/replication/figures/
68
+ !paper/replication/figures/*
69
+
70
+ # The `paper/figures/` directory IS tracked because paper.tex embeds
71
+ # its PDFs/PNGs via \includegraphics. To regenerate, run
72
+ # paper/replication/example_trial.py then copy the desired files in.
73
+ !paper/figures/
74
+ !paper/figures/*
75
+
76
+ # LaTeX build artefacts (in case anyone compiles paper.tex locally).
77
+ paper/*.aux
78
+ paper/*.log
79
+ paper/*.out
80
+ paper/*.toc
81
+ paper/*.bbl
82
+ paper/*.blg
83
+ paper/*.synctex.gz
84
+ paper/paper.pdf
85
+
86
+
87
+ # paper/ is excluded from the public repo until JSS submission lands.
88
+ # It stays in the local working tree for editing; the replication
89
+ # archive moves into the repo at submission time.
90
+ paper/
@@ -0,0 +1,29 @@
1
+ # Changelog
2
+
3
+ All notable changes to PySofra will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.1.0a1] — 2026-05-20
9
+
10
+ ### Added
11
+
12
+ - Initial alpha release.
13
+ - Core `SofraTable` object with immutable method chaining.
14
+ - `tbl_one()` — baseline characteristic tables (Table 1) with continuous /
15
+ categorical summaries, stratification, missing data summaries, overall
16
+ column, p-values, and standardized mean differences (SMDs).
17
+ - `tbl_summary()` — general descriptive summary tables with grouping and
18
+ configurable statistics.
19
+ - `tbl_regression()` — regression tables for `statsmodels` linear / logistic
20
+ / Poisson models, with confidence intervals, exponentiation, and p-values.
21
+ - `tbl_merge()` / `tbl_stack()` — table composition.
22
+ - HTML renderer with rich notebook `_repr_html_` output (dark-mode aware,
23
+ responsive, sticky headers).
24
+ - Markdown renderer.
25
+ - DOCX renderer via `python-docx` (publication-quality Word tables with
26
+ captions, footnotes, merged spanning headers).
27
+ - Themes: `clinical`, `compact`, `jama`, `nejm`, `minimal`.
28
+ - Automatic statistical test selection with override hooks.
29
+ - Snapshot tests for HTML output.