Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
3d96bdf
test(quality): clear PA-307 STX-TQ002/TQ007 in test__test_anova (22->…
ywatanabe1989 May 27, 2026
4372c8f
docs(sphinx_html): refresh from CI build
github-actions[bot] May 27, 2026
03bc24c
refactor(deps): migrate optional imports to try_import_optional (src/…
ywatanabe1989 May 27, 2026
4c8f9a5
docs(sphinx_html): refresh from CI build
github-actions[bot] May 27, 2026
f426857
test(quality): clear PA-307 in _mcp/test_handlers.py (128->0) (#40)
ywatanabe1989 May 27, 2026
49c54ef
docs(sphinx_html): refresh from CI build
github-actions[bot] May 27, 2026
702f86f
test(quality): clear PA-307 in test__schema.py (95->0) (#41)
ywatanabe1989 May 27, 2026
c2933b8
docs(sphinx_html): refresh from CI build
github-actions[bot] May 27, 2026
c67a5b6
docs: refresh stale command names and env-var references
ywatanabe1989 May 27, 2026
9419fd1
Merge pull request #42 from ywatanabe1989/docs/refresh
ywatanabe1989 May 27, 2026
f0b0777
docs(sphinx_html): refresh from CI build
github-actions[bot] May 27, 2026
8044ed8
ci: auto-merge green PRs to develop (CI-native, check_suite)
ywatanabe1989 May 27, 2026
54df1df
docs(sphinx_html): refresh from CI build
github-actions[bot] May 27, 2026
18e2b11
feat(_dataclasses): own the Stats schema dataclasses
ywatanabe1989 May 28, 2026
773ec0f
docs(sphinx_html): refresh from CI build
github-actions[bot] May 28, 2026
6a1b2e2
feat(io): add .stats.zip bundle format
ywatanabe1989 May 28, 2026
125fd0c
Merge remote-tracking branch 'origin/develop' into develop
ywatanabe1989 May 28, 2026
cb17336
docs(sphinx_html): refresh from CI build
github-actions[bot] May 28, 2026
46af204
test(_dataclasses): mirror tests for new _dataclasses subpackage (PS-…
ywatanabe1989 May 28, 2026
17cb175
Merge remote-tracking branch 'origin/develop' into develop
ywatanabe1989 May 28, 2026
58b7f8b
docs(sphinx_html): refresh from CI build
github-actions[bot] May 28, 2026
621f5ca
test(integration): drop stale 'scitex' from cross-package gate
ywatanabe1989 May 28, 2026
4372c5e
Merge remote-tracking branch 'origin/develop' into develop
ywatanabe1989 May 28, 2026
296f892
docs(sphinx_html): refresh from CI build
github-actions[bot] May 28, 2026
9f3cf2b
refactor(stats): gate figrecipe imports through try_import_optional (…
ywatanabe1989 May 29, 2026
8146ac2
test: figrecipe integration + degradation edge tests
ywatanabe1989 May 29, 2026
966d978
Merge pull request #44 from ywatanabe1989/test/figrecipe-edge
ywatanabe1989 May 29, 2026
a166434
docs(sphinx_html): refresh from CI build
github-actions[bot] May 29, 2026
0d9e7d3
Merge pull request #43 from ywatanabe1989/refactor/figrecipe-optional-r4
ywatanabe1989 May 29, 2026
ffc33cc
docs(sphinx_html): refresh from CI build
github-actions[bot] May 29, 2026
9dade54
release: v0.2.22 — publish scitex_stats._dataclasses Stats schema
ywatanabe1989 May 29, 2026
56adee3
Merge pull request #45 from ywatanabe1989/release/v0.2.22
ywatanabe1989 May 29, 2026
4032a23
docs(sphinx_html): refresh from CI build
github-actions[bot] May 29, 2026
9b8ef95
feat(bundle): host stats↔bundle I/O (test_result_to_stats/save_stats/…
ywatanabe1989 May 29, 2026
698350e
Merge pull request #47 from ywatanabe1989/feat/bundle-io
ywatanabe1989 May 29, 2026
8c2543f
docs(sphinx_html): refresh from CI build
github-actions[bot] May 29, 2026
7805fac
feat: move scitex stats integration (Stats/annotate/to_figrecipe/bund…
ywatanabe1989 May 29, 2026
62e3228
release: v0.2.23
ywatanabe1989 May 29, 2026
2d682dc
docs(sphinx_html): refresh from CI build
github-actions[bot] May 29, 2026
db634d3
feat(tests/agreement): add Kendall's W and ICC (Shrout & Fleiss 1979)
ywatanabe1989 Jun 3, 2026
3dedf67
Merge pull request #49 from ywatanabe1989/feat/agreement-tests-kendal…
ywatanabe1989 Jun 3, 2026
cd13842
docs(sphinx_html): refresh from CI build
github-actions[bot] Jun 3, 2026
b8a2700
chore(release): v0.2.24 — tests/agreement (Kendall's W + ICC)
ywatanabe1989 Jun 3, 2026
951c5d8
Merge pull request #50 from ywatanabe1989/chore/bump-v0.2.24
ywatanabe1989 Jun 3, 2026
b46dd77
docs(sphinx_html): refresh from CI build
github-actions[bot] Jun 3, 2026
898adc6
ci(cla): owner-bypass for direct pushes (closes sync-main wedge on re…
ywatanabe1989 Jun 4, 2026
70112ab
docs(sphinx_html): refresh from CI build
github-actions[bot] Jun 4, 2026
bd0afb3
ci(cla): migrate cla.yml secret to GH_PERSONAL_ACCESS_TOKEN (PS-168)
ywatanabe1989 Jun 6, 2026
f661964
docs(sphinx_html): refresh from CI build
github-actions[bot] Jun 6, 2026
48e65c3
feat: port describe_pandas from scitex-gen misc.py (v0.2.25)
ywatanabe1989 Jun 6, 2026
45590f7
fix(test): adapt test_mean_correct to ndarray return shape
ywatanabe1989 Jun 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/auto-merge-to-develop.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: auto-merge-to-develop
# Merge green PRs that TARGET develop, the moment their checks complete.
# GitHub reads check_suite-triggered workflows from the DEFAULT branch (main),
# so this file lives on main but acts ONLY on PRs whose base is develop.
# codecov + readthedocs checks are ignored (advisory). Fail-safe: if a merge
# is blocked by branch policy the PR simply stays open.
on:
check_suite:
types: [completed]
workflow_dispatch: {}

permissions:
contents: write
pull-requests: write

jobs:
automerge:
if: ${{ github.event_name == 'workflow_dispatch' || github.event.check_suite.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: merge green PRs targeting develop
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
HEAD_SHA: ${{ github.event.check_suite.head_sha }}
run: |
set -uo pipefail
if [ -n "${HEAD_SHA:-}" ]; then
prs=$(gh api "repos/$REPO/commits/$HEAD_SHA/pulls" --jq '.[] | select(.state=="open") | .number' 2>/dev/null || true)
else
prs=$(gh pr list --repo "$REPO" --base develop --state open --json number --jq '.[].number' 2>/dev/null || true)
fi
[ -z "${prs:-}" ] && { echo "no open PRs"; exit 0; }
for pr in $prs; do
base=$(gh pr view "$pr" --repo "$REPO" --json baseRefName --jq .baseRefName 2>/dev/null || echo "")
[ "$base" = "develop" ] || { echo "skip #$pr (base=$base, not develop)"; continue; }
draft=$(gh pr view "$pr" --repo "$REPO" --json isDraft --jq .isDraft 2>/dev/null || echo true)
[ "$draft" = "true" ] && continue
pending=$(gh pr view "$pr" --repo "$REPO" --json statusCheckRollup --jq '
[ .statusCheckRollup[]
| select(((.name // .context // "") | ascii_downcase | test("codecov|readthedocs")) | not)
| (.conclusion // .state // "")
| select(. != "SUCCESS" and . != "NEUTRAL" and . != "SKIPPED" and . != "") ] | length' 2>/dev/null || echo 1)
if [ "$pending" = "0" ]; then
gh pr merge "$pr" --repo "$REPO" --merge --admin --delete-branch && echo "MERGED #$pr -> develop" || echo "blocked #$pr"
else
echo "PR #$pr not green ($pending) — skip"
fi
done
42 changes: 40 additions & 2 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
name: CLA Assistant

# Two trigger paths:
# 1. PRs from contributors → CLAssistant action checks signature.
# allowlist already short-circuits to
# success for `bot*` and the repo
# owner, so owner PRs land instantly.
# 2. Direct pushes / tag pushes → owner-bypass job posts a synthetic
# by the repo owner `CLAssistant=success` status on the
# SHA so the release pipeline's
# sync-main step (a direct ref PATCH)
# doesn't get rejected by main's
# branch-protection rule that requires
# CLAssistant. Operator-direct: 2026-06-04.

on:
issue_comment:
types: [created]
pull_request_target:
types: [opened, closed, synchronize]
push:
branches: [main, develop]
tags: ['v*']

permissions:
actions: write
Expand All @@ -13,14 +29,36 @@ permissions:
statuses: write

jobs:
owner-bypass:
# Fires only for direct pushes by the repo owner. PR events keep
# going through the full CLAssistant action below.
if: github.event_name == 'push' && github.actor == 'ywatanabe1989'
runs-on: ubuntu-latest
permissions:
statuses: write
steps:
- name: Mark CLAssistant=success on this SHA (owner-allowlisted direct push)
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
SHA: ${{ github.sha }}
run: |
set -euo pipefail
gh api "repos/${REPO}/statuses/${SHA}" \
-f state=success \
-f context=CLAssistant \
-f description="Owner-triggered direct push (CLA bypass per repo allowlist)"

CLAssistant:
# PR / comment path — unchanged from the pre-2026-06-04 workflow.
if: github.event_name != 'push'
runs-on: ubuntu-latest
steps:
- name: CLA Assistant
uses: contributor-assistant/github-action@v2.6.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_PERSONAL_ACCESS_TOKEN }}
PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
with:
path-to-signatures: "signatures/cla.json"
path-to-document: "https://github.com/ywatanabe1989/scitex-stats/blob/main/CLA.md"
Expand All @@ -30,4 +68,4 @@ jobs:
Thank you for signing the SciTeX CLA. Your contribution can now be reviewed.
custom-notsigned-prcomment: |
Please sign the [SciTeX CLA](https://github.com/ywatanabe1989/scitex-stats/blob/main/CLA.md) before your contribution can be merged.
Comment `I have read and agree to the SciTeX CLA.` to sign.
Comment `I have read and agree to the SciTeX CLA.` to sign.
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,40 @@ versions follow [Semantic Versioning](https://semver.org/).

## [Unreleased]

## [0.2.25] — 2026-06-07

- feat: port `describe_pandas` from `scitex-gen` `misc.py` (Phase B of
the scitex-gen full retirement wave). The legacy symbol name was
`describe`, but `scitex_stats.descriptive.describe` already exists
with a richer torch/numpy signature; to keep both forms available
without a silent breakage the pandas variant is exposed here as
`describe_pandas` (DataFrame in, `mean_std`/`mean_ci`/`median_iqr`
summary dict out).

## [0.2.24] — 2026-06-03

### Added
- `tests/agreement` category (new) with two inter-rater agreement scalars:
- `test_kendalls_w(matrix, use_abs=False)` — Kendall's coefficient of
concordance W ∈ [0, 1] (Kendall & Babington Smith 1939). Accepts a
2-D `(n_subjects, k_raters)` matrix or a long-format DataFrame with
`(subj, rater, score)` triples. Returns `W`, `S`, `n`, `k`, χ² and
p-value via the Friedman χ² approximation, plus effect-size
interpretation and a publication-ready `formatted` string.
- `test_icc(matrix, form="3,k")` — ICC (Shrout & Fleiss 1979).
Computes all six classical forms from one variance decomposition
(McGraw & Wong 1996) and surfaces the selected form at the top level;
F / p / df / CI / effect size / Koo & Li 2016 interpretation in the
result dict.
- Top-level aliases `sts.test_kendalls_w` and `sts.test_icc` via the
PEP-562 lazy attribute loader.
- 27 pytest tests in `tests/scitex_stats/tests/agreement/`.

## [0.2.22]

- feat(schema): publish the `scitex_stats._dataclasses` Stats schema (`_Stats.py`) — previously only on develop, which forced scitex-io's bundle to git-pin scitex-stats. Publishing it lets scitex-io depend on `scitex-stats>=0.2.22` and exercises the `.stats.zip` bundle integration on PyPI.
- (incorporates the figrecipe-optional R4 changes merged in #43)

## [0.2.20] — 2026-05-26

### Changed
Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ MCP Subcommands

scitex-stats mcp start # Start MCP server
scitex-stats mcp doctor # Check MCP dependencies
scitex-stats mcp installation # Show installation instructions
scitex-stats mcp install # Show installation instructions
scitex-stats mcp list-tools # List available MCP tools
scitex-stats mcp list-tools -v # With signatures
15 changes: 13 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ build-backend = "hatchling.build"

[project]
name = "scitex-stats"
version = "0.2.21"
description = "Publication-ready statistical testing framework with 23 tests, effect sizes, power analysis, and MCP server"
version = "0.2.25"
description = "Publication-ready statistical testing framework with 25 tests, effect sizes, power analysis, and MCP server"
readme = "README.md"
license = "AGPL-3.0-only"
requires-python = ">=3.10"
Expand Down Expand Up @@ -69,6 +69,13 @@ all = [
"figrecipe>=0.28.0",
"torch>=2.0",
]
# Stats ↔ SciTeX bundle I/O: test_result_to_stats / save_stats / load_stats
# in scitex_stats._bundle_io require scitex-io's bundle subpackage. scitex-io
# imports the Stats schema back from scitex_stats, so it stays an optional
# extra (no hard/circular dep).
bundle = [
"scitex-io>=0.2.16",
]
dev = [
"pytest>=7.0.0",
"pytest-cov>=4.0.0",
Expand All @@ -81,6 +88,10 @@ dev = [
"nbconvert>=7.0", # executes example .ipynb in tests (PS-505)
"ipykernel>=6.0", # kernel for nbconvert --execute
"openpyxl>=3.1", # pandas to_excel used by _demo_*.py
# Optional cross-package integrations whose tests live in the suite,
# so a fresh `pip install -e .[dev]` runs the full suite (PS-210).
"scitex-io>=0.2.16", # [bundle] extra: stats↔bundle I/O round-trip tests
"figrecipe>=0.28.0", # [all] extra: stats↔figrecipe annotation tests
# Note: fastmcp / mcp / scitex-dev / scitex-logging / pingouin come in via [project.dependencies].
]
docs = [
Expand Down
28 changes: 28 additions & 0 deletions src/scitex_stats/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@
"run_test": "_dispatch",
# JSON
"to_json_safe": "_utils._serialize",
# Stats ↔ SciTeX bundle I/O (optional scitex-io; extra [bundle])
"Stats": "_integration",
"BUNDLE_AVAILABLE": "_integration",
"test_result_to_stats": "_bundle_io",
"save_stats": "_bundle_io",
"load_stats": "_bundle_io",
# Stats ↔ figrecipe annotations (optional figrecipe; extra [figrecipe])
"to_figrecipe": "_figrecipe_integration",
"annotate": "_figrecipe_integration",
"load_and_annotate": "_figrecipe_integration",
# Auto convenience
"StatContext": "auto",
"StatStyle": "auto",
Expand All @@ -123,6 +133,7 @@
"recommend_tests": "auto",
# Descriptive
"describe": "descriptive",
"describe_pandas": "descriptive",
# Parametric (6)
"test_ttest_ind": "tests",
"test_ttest_rel": "tests",
Expand Down Expand Up @@ -151,6 +162,9 @@
"test_normality": "tests",
"test_ks_1samp": "tests",
"test_ks_2samp": "tests",
# Agreement (2)
"test_kendalls_w": "tests",
"test_icc": "tests",
}


Expand Down Expand Up @@ -203,8 +217,19 @@ def __dir__() -> list[str]:
"available_tests",
# Descriptive
"describe",
"describe_pandas",
# JSON serialization
"to_json_safe",
# Stats ↔ SciTeX bundle I/O (optional scitex-io; extra [bundle])
"Stats",
"BUNDLE_AVAILABLE",
"test_result_to_stats",
"save_stats",
"load_stats",
# Stats ↔ figrecipe annotations (optional figrecipe; extra [figrecipe])
"to_figrecipe",
"annotate",
"load_and_annotate",
# Auto convenience
"StatContext",
"TestRule",
Expand Down Expand Up @@ -241,4 +266,7 @@ def __dir__() -> list[str]:
"test_normality",
"test_ks_1samp",
"test_ks_2samp",
# Agreement (2)
"test_kendalls_w",
"test_icc",
]
Loading
Loading