statwarrant 0.5.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.
Files changed (78) hide show
  1. statwarrant-0.5.0/.github/ISSUE_TEMPLATE/bug_report.yml +30 -0
  2. statwarrant-0.5.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
  3. statwarrant-0.5.0/.github/ISSUE_TEMPLATE/feedback.yml +75 -0
  4. statwarrant-0.5.0/.github/ISSUE_TEMPLATE/linter.yml +57 -0
  5. statwarrant-0.5.0/.github/workflows/release.yml +94 -0
  6. statwarrant-0.5.0/.github/workflows/tests.yml +83 -0
  7. statwarrant-0.5.0/.gitignore +9 -0
  8. statwarrant-0.5.0/CHANGELOG.md +343 -0
  9. statwarrant-0.5.0/CITATION.cff +9 -0
  10. statwarrant-0.5.0/CODE_OF_CONDUCT.md +10 -0
  11. statwarrant-0.5.0/CONTRIBUTING.md +34 -0
  12. statwarrant-0.5.0/KNOWN_ISSUES.md +295 -0
  13. statwarrant-0.5.0/LICENSE +21 -0
  14. statwarrant-0.5.0/PKG-INFO +437 -0
  15. statwarrant-0.5.0/README.md +388 -0
  16. statwarrant-0.5.0/RELEASING.md +35 -0
  17. statwarrant-0.5.0/SECURITY.md +14 -0
  18. statwarrant-0.5.0/VALIDATION.md +51 -0
  19. statwarrant-0.5.0/evaluation/human-review/README.md +182 -0
  20. statwarrant-0.5.0/evaluation/human-review/adjudication.csv +1 -0
  21. statwarrant-0.5.0/evaluation/human-review/cases.csv +1 -0
  22. statwarrant-0.5.0/evaluation/human-review/reviewer_A.csv +1 -0
  23. statwarrant-0.5.0/evaluation/human-review/reviewer_B.csv +1 -0
  24. statwarrant-0.5.0/examples/published_results.py +38 -0
  25. statwarrant-0.5.0/examples/quickstart.ipynb +236 -0
  26. statwarrant-0.5.0/examples/quickstart.py +36 -0
  27. statwarrant-0.5.0/pyproject.toml +40 -0
  28. statwarrant-0.5.0/src/statwarrant/__init__.py +38 -0
  29. statwarrant-0.5.0/src/statwarrant/_core.py +491 -0
  30. statwarrant-0.5.0/src/statwarrant/_precision.py +62 -0
  31. statwarrant-0.5.0/src/statwarrant/_ratio_display.py +112 -0
  32. statwarrant-0.5.0/src/statwarrant/_version.py +1 -0
  33. statwarrant-0.5.0/src/statwarrant/adapters.py +389 -0
  34. statwarrant-0.5.0/src/statwarrant/claims.py +2331 -0
  35. statwarrant-0.5.0/src/statwarrant/design.py +180 -0
  36. statwarrant-0.5.0/src/statwarrant/plan.py +762 -0
  37. statwarrant-0.5.0/tests/test_adapters.py +99 -0
  38. statwarrant-0.5.0/tests/test_adversarial_comparison.py +76 -0
  39. statwarrant-0.5.0/tests/test_claims.py +109 -0
  40. statwarrant-0.5.0/tests/test_comparative_direction.py +224 -0
  41. statwarrant-0.5.0/tests/test_core.py +159 -0
  42. statwarrant-0.5.0/tests/test_critical_value_safety.py +32 -0
  43. statwarrant-0.5.0/tests/test_design.py +61 -0
  44. statwarrant-0.5.0/tests/test_design_extremes.py +68 -0
  45. statwarrant-0.5.0/tests/test_display_levels.py +27 -0
  46. statwarrant-0.5.0/tests/test_external_sleep_review.py +39 -0
  47. statwarrant-0.5.0/tests/test_independent_order.py +156 -0
  48. statwarrant-0.5.0/tests/test_neither_nor.py +63 -0
  49. statwarrant-0.5.0/tests/test_nist_longley_validation.py +73 -0
  50. statwarrant-0.5.0/tests/test_observation_adapters.py +225 -0
  51. statwarrant-0.5.0/tests/test_observation_claims.py +151 -0
  52. statwarrant-0.5.0/tests/test_observation_display.py +60 -0
  53. statwarrant-0.5.0/tests/test_observation_precision.py +146 -0
  54. statwarrant-0.5.0/tests/test_observation_threshold_display.py +193 -0
  55. statwarrant-0.5.0/tests/test_observation_thresholds.py +208 -0
  56. statwarrant-0.5.0/tests/test_observation_underflow.py +211 -0
  57. statwarrant-0.5.0/tests/test_observation_units.py +202 -0
  58. statwarrant-0.5.0/tests/test_portability.py +43 -0
  59. statwarrant-0.5.0/tests/test_properties.py +53 -0
  60. statwarrant-0.5.0/tests/test_published_wording.py +220 -0
  61. statwarrant-0.5.0/tests/test_ratio_and_size_wording.py +114 -0
  62. statwarrant-0.5.0/tests/test_real_data_reference_summaries.py +42 -0
  63. statwarrant-0.5.0/tests/test_review3.py +238 -0
  64. statwarrant-0.5.0/tests/test_review4.py +191 -0
  65. statwarrant-0.5.0/tests/test_review5.py +205 -0
  66. statwarrant-0.5.0/tests/test_review6.py +135 -0
  67. statwarrant-0.5.0/tests/test_review_050.py +97 -0
  68. statwarrant-0.5.0/tests/test_review_regressions.py +203 -0
  69. statwarrant-0.5.0/tests/test_review_release_050.py +160 -0
  70. statwarrant-0.5.0/tests/test_safety_baseline_050.py +135 -0
  71. statwarrant-0.5.0/tests/test_safety_claim_variants_050.py +118 -0
  72. statwarrant-0.5.0/tests/test_safety_log_base_050.py +159 -0
  73. statwarrant-0.5.0/tests/test_safety_ratio_display_050.py +187 -0
  74. statwarrant-0.5.0/tests/test_safety_rounding_050.py +198 -0
  75. statwarrant-0.5.0/tests/test_safety_scale_integration_050.py +66 -0
  76. statwarrant-0.5.0/tests/test_scenarios.py +49 -0
  77. statwarrant-0.5.0/tests/test_sentences.py +164 -0
  78. statwarrant-0.5.0/tests/test_warning_messages.py +32 -0
@@ -0,0 +1,30 @@
1
+ name: Bug report
2
+ description: A wrong number, a crash, or output that contradicts itself.
3
+ title: "[Bug] "
4
+ labels: ["bug"]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Everything here is public: do not paste confidential or unpublished data. Security problems:
10
+ report them privately (see SECURITY.md), not here.
11
+ - type: textarea
12
+ id: what
13
+ attributes:
14
+ label: What happened, and what did you expect?
15
+ validations:
16
+ required: true
17
+ - type: textarea
18
+ id: code
19
+ attributes:
20
+ label: Minimal code to reproduce
21
+ render: python
22
+ validations:
23
+ required: true
24
+ - type: input
25
+ id: versions
26
+ attributes:
27
+ label: Versions
28
+ placeholder: statwarrant 0.5.0, Python 3.12, SciPy 1.14, Windows 11
29
+ validations:
30
+ required: true
@@ -0,0 +1,5 @@
1
+ blank_issues_enabled: true
2
+ contact_links:
3
+ - name: Questions and ideas
4
+ url: https://github.com/Haifawaeedd/statwarrant/discussions
5
+ about: Ask how to use statwarrant or suggest a direction.
@@ -0,0 +1,75 @@
1
+ name: Feedback
2
+ description: Tell us how statwarrant worked for you. Takes about 3 minutes.
3
+ title: "[Feedback] "
4
+ labels: ["feedback"]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Thank you for trying statwarrant. Everything you write here is public and is used to improve the software.
10
+ Please do not paste confidential or unpublished data.
11
+ - type: dropdown
12
+ id: role
13
+ attributes:
14
+ label: What best describes you?
15
+ options:
16
+ - Master's student
17
+ - PhD student
18
+ - Researcher or academic
19
+ - Data scientist or ML engineer
20
+ - Teacher of statistics
21
+ - Other
22
+ validations:
23
+ required: true
24
+ - type: input
25
+ id: field
26
+ attributes:
27
+ label: Your field
28
+ placeholder: e.g. education, psychology, NLP, public health
29
+ - type: textarea
30
+ id: use
31
+ attributes:
32
+ label: What did you use it for?
33
+ description: The kind of comparison and where the numbers came from (scipy, statsmodels, a paper, model scores...).
34
+ validations:
35
+ required: true
36
+ - type: dropdown
37
+ id: changed
38
+ attributes:
39
+ label: Did the output change what you would have written?
40
+ options:
41
+ - "Yes, it stopped a claim I would have made"
42
+ - "Yes, it gave me better wording"
43
+ - "No, it agreed with what I would have written"
44
+ - "No, and I think it was wrong"
45
+ validations:
46
+ required: true
47
+ - type: dropdown
48
+ id: clarity
49
+ attributes:
50
+ label: How clear was the output?
51
+ options:
52
+ - "5 - very clear"
53
+ - "4"
54
+ - "3"
55
+ - "2"
56
+ - "1 - confusing"
57
+ validations:
58
+ required: true
59
+ - type: textarea
60
+ id: misjudged
61
+ attributes:
62
+ label: A sentence the linter handled wrongly (if any)
63
+ description: Paste the sentence, the warnings you got, and what you expected (a false warning, or a misreading it missed). These reports are the most useful.
64
+ render: text
65
+ - type: textarea
66
+ id: missing
67
+ attributes:
68
+ label: What was missing or getting in the way?
69
+ - type: checkboxes
70
+ id: public
71
+ attributes:
72
+ label: Public feedback
73
+ options:
74
+ - label: I understand this feedback is public and will be used to improve statwarrant.
75
+ required: true
@@ -0,0 +1,57 @@
1
+ name: A sentence the linter got wrong
2
+ description: A false warning, or a misreading it missed. About one minute; the most useful report you can send.
3
+ title: "[Linter] "
4
+ labels: ["linter", "feedback"]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Thank you. These reports are how the sentence checker improves. Everything here is public:
10
+ do not paste confidential or unpublished text. A rephrased or invented sentence with the same
11
+ structure is fine.
12
+ - type: textarea
13
+ id: sentence
14
+ attributes:
15
+ label: The sentence
16
+ placeholder: "Neither a difference from zero nor equivalence was established."
17
+ validations:
18
+ required: true
19
+ - type: textarea
20
+ id: result
21
+ attributes:
22
+ label: The result it was checked against
23
+ description: The declare(...) and analyze(...) call, or the estimate, SE (or CI), df and SESOI.
24
+ render: python
25
+ placeholder: |
26
+ plan = sw.declare(sesoi=0.2, sesoi_source="...", units="points")
27
+ res = plan.analyze(estimate=0.15, se=0.1, df=80)
28
+ validations:
29
+ required: true
30
+ - type: dropdown
31
+ id: kind
32
+ attributes:
33
+ label: What went wrong?
34
+ options:
35
+ - "False warning: the sentence is fine but got a warning"
36
+ - "Missed problem: the sentence misreads the result but got no warning"
37
+ - "Right warning, wrong reason or misleading explanation"
38
+ - "Other"
39
+ validations:
40
+ required: true
41
+ - type: textarea
42
+ id: output
43
+ attributes:
44
+ label: What statwarrant printed
45
+ description: Paste the output of print(res.check(sentence)).
46
+ render: text
47
+ - type: textarea
48
+ id: expected
49
+ attributes:
50
+ label: What you expected, and why
51
+ validations:
52
+ required: true
53
+ - type: input
54
+ id: version
55
+ attributes:
56
+ label: statwarrant version
57
+ placeholder: "0.5.0 (python -c \"import statwarrant; print(statwarrant.__version__)\")"
@@ -0,0 +1,94 @@
1
+ name: release
2
+
3
+ # Manual publishing with PyPI Trusted Publishing (no API token in the repository).
4
+ # Nothing is published automatically: only the repository owner can run it, by hand, typing
5
+ # a confirmation; PyPI uploads must run from a version tag such as v0.5.0.
6
+ #
7
+ # Naming an environment below does NOT by itself require approval, and this workflow cannot
8
+ # check the environment's settings. Before configuring any trusted publisher:
9
+ # 1. GitHub: Settings -> Environments -> create "testpypi" and "pypi"; for "pypi" add
10
+ # yourself as a required reviewer and restrict it to tags v*, so every PyPI upload waits
11
+ # for your approval.
12
+ # 2. test.pypi.org and pypi.org: Account -> Publishing -> add a pending publisher with
13
+ # project statwarrant, owner Haifawaeedd, repository statwarrant, workflow release.yml,
14
+ # and environment testpypi (on TestPyPI) or pypi (on PyPI).
15
+
16
+ on:
17
+ workflow_dispatch:
18
+ inputs:
19
+ target:
20
+ description: "Where to publish"
21
+ type: choice
22
+ options: [testpypi, pypi]
23
+ default: testpypi
24
+ confirm:
25
+ description: "Type: publish statwarrant VERSION to TARGET (for example: publish statwarrant 0.5.0 to testpypi)"
26
+ required: true
27
+
28
+ permissions:
29
+ contents: read
30
+
31
+ jobs:
32
+ build:
33
+ if: github.actor == github.repository_owner
34
+ runs-on: ubuntu-latest
35
+ steps:
36
+ - uses: actions/checkout@v4
37
+ - uses: actions/setup-python@v5
38
+ with:
39
+ python-version: "3.12"
40
+ - name: Check the version and the confirmation
41
+ env:
42
+ TARGET: ${{ inputs.target }}
43
+ CONFIRM: ${{ inputs.confirm }}
44
+ run: |
45
+ version=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
46
+ echo "version $version, ref ${GITHUB_REF}"
47
+ test "$CONFIRM" = "publish statwarrant $version to $TARGET" || { echo "confirmation does not match"; exit 1; }
48
+ if [ "$TARGET" = "pypi" ]; then
49
+ test "${GITHUB_REF}" = "refs/tags/v$version" || { echo "PyPI uploads must run from tag v$version"; exit 1; }
50
+ case "$version" in *dev*) echo "development versions are not uploaded to PyPI"; exit 1;; esac
51
+ fi
52
+ - name: Build and check
53
+ run: |
54
+ python -m pip install --upgrade pip build twine
55
+ python -m build
56
+ twine check --strict dist/*
57
+ - uses: actions/upload-artifact@v4
58
+ with:
59
+ name: dist
60
+ path: dist/
61
+
62
+ testpypi:
63
+ if: inputs.target == 'testpypi'
64
+ needs: build
65
+ runs-on: ubuntu-latest
66
+ environment:
67
+ name: testpypi
68
+ url: https://test.pypi.org/project/statwarrant/
69
+ permissions:
70
+ id-token: write
71
+ steps:
72
+ - uses: actions/download-artifact@v4
73
+ with:
74
+ name: dist
75
+ path: dist/
76
+ - uses: pypa/gh-action-pypi-publish@release/v1
77
+ with:
78
+ repository-url: https://test.pypi.org/legacy/
79
+
80
+ pypi:
81
+ if: inputs.target == 'pypi'
82
+ needs: build
83
+ runs-on: ubuntu-latest
84
+ environment:
85
+ name: pypi
86
+ url: https://pypi.org/project/statwarrant/
87
+ permissions:
88
+ id-token: write
89
+ steps:
90
+ - uses: actions/download-artifact@v4
91
+ with:
92
+ name: dist
93
+ path: dist/
94
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,83 @@
1
+ name: tests
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ test:
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - uses: actions/setup-python@v5
20
+ with:
21
+ python-version: ${{ matrix.python-version }}
22
+ - name: Install
23
+ run: |
24
+ python -m pip install --upgrade pip
25
+ pip install -e ".[test]" pytest-cov
26
+ - name: Test with coverage
27
+ run: pytest --cov=statwarrant --cov-report=term-missing
28
+
29
+ other-platforms:
30
+ # pip install and the full suite on macOS and Windows.
31
+ runs-on: ${{ matrix.os }}
32
+ strategy:
33
+ fail-fast: false
34
+ matrix:
35
+ os: [macos-latest, windows-latest]
36
+ steps:
37
+ - uses: actions/checkout@v4
38
+ - uses: actions/setup-python@v5
39
+ with:
40
+ python-version: "3.12"
41
+ - name: Install
42
+ run: |
43
+ python -m pip install --upgrade pip
44
+ pip install ".[test]"
45
+ - name: Test
46
+ run: pytest
47
+
48
+ oldest-dependencies:
49
+ # The lowest versions pyproject.toml promises to support.
50
+ runs-on: ubuntu-latest
51
+ steps:
52
+ - uses: actions/checkout@v4
53
+ - uses: actions/setup-python@v5
54
+ with:
55
+ python-version: "3.10"
56
+ - name: Install oldest supported NumPy and SciPy
57
+ run: |
58
+ python -m pip install --upgrade pip
59
+ pip install "numpy==1.22.4" "scipy==1.11.4" "statsmodels==0.14.0" "pandas<2.1" pytest hypothesis
60
+ pip install --no-deps -e .
61
+ - name: Test
62
+ run: pytest
63
+
64
+ package:
65
+ # Build the sdist and wheel, then install the wheel in a clean environment.
66
+ runs-on: ubuntu-latest
67
+ steps:
68
+ - uses: actions/checkout@v4
69
+ - uses: actions/setup-python@v5
70
+ with:
71
+ python-version: "3.12"
72
+ - name: Build
73
+ run: |
74
+ python -m pip install --upgrade pip build twine
75
+ python -m build
76
+ twine check dist/*
77
+ - name: Install the wheel outside the source tree and test it
78
+ run: |
79
+ python -m venv /tmp/clean
80
+ /tmp/clean/bin/pip install dist/*.whl pytest hypothesis statsmodels
81
+ cp -r tests /tmp/wheel-tests
82
+ cd /tmp && /tmp/clean/bin/python -c "import statwarrant, sys; print(statwarrant.__version__, statwarrant.__file__)"
83
+ cd /tmp && /tmp/clean/bin/python -m pytest -q /tmp/wheel-tests -p no:cacheprovider --rootdir /tmp/wheel-tests
@@ -0,0 +1,9 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ build/
6
+ dist/
7
+ .pytest_cache/
8
+ .hypothesis/
9
+ .coverage