pycatdap 0.2.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 (47) hide show
  1. pycatdap-0.2.0/.editorconfig +19 -0
  2. pycatdap-0.2.0/.github/ISSUE_TEMPLATE/bug_report.md +26 -0
  3. pycatdap-0.2.0/.github/ISSUE_TEMPLATE/feature_request.md +16 -0
  4. pycatdap-0.2.0/.github/PULL_REQUEST_TEMPLATE.md +10 -0
  5. pycatdap-0.2.0/.github/dependabot.yml +10 -0
  6. pycatdap-0.2.0/.github/workflows/auto-release.yml +66 -0
  7. pycatdap-0.2.0/.github/workflows/ci.yml +90 -0
  8. pycatdap-0.2.0/.github/workflows/release.yml +73 -0
  9. pycatdap-0.2.0/.gitignore +43 -0
  10. pycatdap-0.2.0/.pre-commit-config.yaml +17 -0
  11. pycatdap-0.2.0/BLUEPRINT.md +417 -0
  12. pycatdap-0.2.0/CHANGELOG.md +24 -0
  13. pycatdap-0.2.0/CODE_OF_CONDUCT.md +29 -0
  14. pycatdap-0.2.0/CONTRIBUTING.md +108 -0
  15. pycatdap-0.2.0/LICENSE +21 -0
  16. pycatdap-0.2.0/Makefile +30 -0
  17. pycatdap-0.2.0/PKG-INFO +72 -0
  18. pycatdap-0.2.0/README.md +45 -0
  19. pycatdap-0.2.0/SECURITY.md +17 -0
  20. pycatdap-0.2.0/docs/r_reference/generate_reference.R +64 -0
  21. pycatdap-0.2.0/docs/tutorial.ipynb +438 -0
  22. pycatdap-0.2.0/pyproject.toml +88 -0
  23. pycatdap-0.2.0/scripts/release.py +81 -0
  24. pycatdap-0.2.0/src/pycatdap/__init__.py +30 -0
  25. pycatdap-0.2.0/src/pycatdap/_aic.py +194 -0
  26. pycatdap-0.2.0/src/pycatdap/_contingency.py +130 -0
  27. pycatdap-0.2.0/src/pycatdap/_pooling.py +349 -0
  28. pycatdap-0.2.0/src/pycatdap/_subset_search.py +136 -0
  29. pycatdap-0.2.0/src/pycatdap/_version.py +34 -0
  30. pycatdap-0.2.0/src/pycatdap/catdap1.py +143 -0
  31. pycatdap-0.2.0/src/pycatdap/catdap2.py +232 -0
  32. pycatdap-0.2.0/src/pycatdap/data/__init__.py +0 -0
  33. pycatdap-0.2.0/src/pycatdap/data/health_data.csv +53 -0
  34. pycatdap-0.2.0/src/pycatdap/data/hello_goodbye.csv.gz +0 -0
  35. pycatdap-0.2.0/src/pycatdap/datasets.py +91 -0
  36. pycatdap-0.2.0/src/pycatdap/plotting.py +202 -0
  37. pycatdap-0.2.0/src/pycatdap/py.typed +0 -0
  38. pycatdap-0.2.0/tests/__init__.py +0 -0
  39. pycatdap-0.2.0/tests/test_against_r.py +143 -0
  40. pycatdap-0.2.0/tests/test_aic.py +286 -0
  41. pycatdap-0.2.0/tests/test_catdap1.py +166 -0
  42. pycatdap-0.2.0/tests/test_catdap2.py +183 -0
  43. pycatdap-0.2.0/tests/test_contingency.py +176 -0
  44. pycatdap-0.2.0/tests/test_datasets.py +63 -0
  45. pycatdap-0.2.0/tests/test_plotting.py +75 -0
  46. pycatdap-0.2.0/tests/test_pooling.py +200 -0
  47. pycatdap-0.2.0/uv.lock +2116 -0
@@ -0,0 +1,19 @@
1
+ [*]
2
+ charset = utf-8
3
+ end_of_line = lf
4
+ insert_final_newline = true
5
+ trim_trailing_whitespace = true
6
+
7
+ [*.py]
8
+ indent_style = space
9
+ indent_size = 4
10
+
11
+ [*.{json,yaml,yml,toml}]
12
+ indent_style = space
13
+ indent_size = 2
14
+
15
+ [*.md]
16
+ trim_trailing_whitespace = false
17
+
18
+ [Makefile]
19
+ indent_style = tab
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: Bug report
3
+ about: Report a bug in pycatdap
4
+ title: ""
5
+ labels: bug
6
+ assignees: ""
7
+ ---
8
+
9
+ ## Description
10
+ <!-- A clear and concise description of the bug -->
11
+
12
+ ## Steps to reproduce
13
+ 1.
14
+ 2.
15
+ 3.
16
+
17
+ ## Expected behavior
18
+ <!-- What you expected to happen -->
19
+
20
+ ## Actual behavior
21
+ <!-- What actually happened -->
22
+
23
+ ## Environment
24
+ - pycatdap version:
25
+ - Python version:
26
+ - OS:
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest a new feature
4
+ title: ""
5
+ labels: enhancement
6
+ assignees: ""
7
+ ---
8
+
9
+ ## Problem
10
+ <!-- What problem does this feature solve? -->
11
+
12
+ ## Proposed solution
13
+ <!-- Describe the feature you'd like -->
14
+
15
+ ## Alternatives considered
16
+ <!-- Any alternative approaches? -->
@@ -0,0 +1,10 @@
1
+ ## Summary
2
+ <!-- 1-3 bullet points describing the change -->
3
+
4
+ ## Checklist
5
+ - [ ] Tests added/updated
6
+ - [ ] `make ci` passes locally
7
+ - [ ] CHANGELOG.md updated (if user-facing change)
8
+
9
+ ## Test plan
10
+ - [ ] ...
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: pip
4
+ directory: /
5
+ schedule:
6
+ interval: weekly
7
+ - package-ecosystem: github-actions
8
+ directory: /
9
+ schedule:
10
+ interval: weekly
@@ -0,0 +1,66 @@
1
+ name: Auto-tag and GitHub Release
2
+
3
+ on:
4
+ pull_request:
5
+ types: [closed]
6
+ branches: [main]
7
+
8
+ permissions:
9
+ contents: write
10
+
11
+ jobs:
12
+ tag-and-release:
13
+ if: >-
14
+ github.event.pull_request.merged == true &&
15
+ startsWith(github.event.pull_request.title, 'release:')
16
+ runs-on: ubuntu-latest
17
+
18
+ steps:
19
+ - uses: actions/checkout@v6
20
+ with:
21
+ fetch-depth: 0
22
+
23
+ - name: Extract version from PR title
24
+ id: version
25
+ run: |
26
+ TITLE="${{ github.event.pull_request.title }}"
27
+ VERSION=$(echo "$TITLE" | grep -oP 'v\d+\.\d+\.\d+')
28
+ if [ -z "$VERSION" ]; then
29
+ echo "::error::No version found in PR title: $TITLE"
30
+ exit 1
31
+ fi
32
+ echo "tag=$VERSION" >> "$GITHUB_OUTPUT"
33
+ echo "version=${VERSION#v}" >> "$GITHUB_OUTPUT"
34
+ echo "Detected version: $VERSION"
35
+
36
+ - name: Check tag does not already exist
37
+ run: |
38
+ if git rev-parse "${{ steps.version.outputs.tag }}" >/dev/null 2>&1; then
39
+ echo "::error::Tag ${{ steps.version.outputs.tag }} already exists"
40
+ exit 1
41
+ fi
42
+
43
+ - name: Extract release notes from CHANGELOG.md
44
+ id: notes
45
+ run: |
46
+ VERSION="${{ steps.version.outputs.version }}"
47
+ NOTES=$(awk "/^## \[${VERSION}\]/{flag=1; next} /^## \[/{flag=0} flag" CHANGELOG.md)
48
+ if [ -z "$NOTES" ]; then
49
+ NOTES="Release ${VERSION}"
50
+ fi
51
+ echo "$NOTES" > /tmp/release-notes.md
52
+ echo "Release notes extracted:"
53
+ cat /tmp/release-notes.md
54
+
55
+ - name: Create tag
56
+ run: |
57
+ git tag "${{ steps.version.outputs.tag }}"
58
+ git push origin "${{ steps.version.outputs.tag }}"
59
+
60
+ - name: Create GitHub Release
61
+ env:
62
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63
+ run: |
64
+ gh release create "${{ steps.version.outputs.tag }}" \
65
+ --title "${{ steps.version.outputs.tag }}" \
66
+ --notes-file /tmp/release-notes.md
@@ -0,0 +1,90 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [main, develop]
6
+ push:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ quality:
11
+ name: Quality (${{ matrix.python-version }})
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
17
+
18
+ steps:
19
+ - uses: actions/checkout@v6
20
+
21
+ - name: Install uv
22
+ uses: astral-sh/setup-uv@v7
23
+ with:
24
+ python-version: ${{ matrix.python-version }}
25
+
26
+ - name: Install dependencies
27
+ run: uv sync --frozen --dev
28
+
29
+ - name: Lint (ruff check)
30
+ run: uv run ruff check .
31
+
32
+ - name: Format check (ruff format)
33
+ run: uv run ruff format --check .
34
+
35
+ - name: Type check (mypy)
36
+ run: uv run mypy src/pycatdap/
37
+
38
+ - name: Test (pytest)
39
+ run: |
40
+ if [ "${{ github.base_ref }}" = "main" ]; then
41
+ uv run pytest tests/ -m "" --cov=pycatdap --cov-report=term-missing --cov-fail-under=80 -q
42
+ else
43
+ uv run pytest tests/ -m "not slow" --cov=pycatdap --cov-report=term-missing --cov-fail-under=80 -q
44
+ fi
45
+
46
+ quality-lowest-deps:
47
+ name: Quality (lowest-direct deps)
48
+ runs-on: ubuntu-latest
49
+
50
+ steps:
51
+ - uses: actions/checkout@v6
52
+
53
+ - name: Install uv
54
+ uses: astral-sh/setup-uv@v7
55
+ with:
56
+ python-version: "3.10"
57
+
58
+ - name: Install lowest direct dependencies
59
+ run: uv sync --frozen --dev --resolution lowest-direct
60
+
61
+ - name: Test (pytest)
62
+ run: uv run pytest tests/ -q
63
+
64
+ distribution:
65
+ name: Distribution check
66
+ runs-on: ubuntu-latest
67
+
68
+ steps:
69
+ - uses: actions/checkout@v6
70
+ with:
71
+ fetch-depth: 0
72
+
73
+ - name: Install uv
74
+ uses: astral-sh/setup-uv@v7
75
+ with:
76
+ python-version: "3.12"
77
+
78
+ - name: Install build tools
79
+ run: uv sync --frozen --dev
80
+
81
+ - name: Build sdist and wheel
82
+ run: uv build
83
+
84
+ - name: Check distribution
85
+ run: uv run twine check dist/*
86
+
87
+ - name: Smoke test installation from wheel
88
+ run: |
89
+ pip install dist/*.whl --quiet
90
+ python -c "from pycatdap import __version__; print('import ok:', __version__)"
@@ -0,0 +1,73 @@
1
+ name: Release to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ build:
13
+ name: Build distribution
14
+ runs-on: ubuntu-latest
15
+
16
+ steps:
17
+ - uses: actions/checkout@v6
18
+ with:
19
+ fetch-depth: 0
20
+
21
+ - name: Install uv
22
+ uses: astral-sh/setup-uv@v7
23
+ with:
24
+ python-version: "3.12"
25
+
26
+ - name: Build sdist and wheel
27
+ run: uv build
28
+
29
+ - name: Check distribution
30
+ run: |
31
+ uv sync --frozen --dev
32
+ uv run twine check dist/*
33
+
34
+ - uses: actions/upload-artifact@v7
35
+ with:
36
+ name: dist
37
+ path: dist/
38
+
39
+ publish-testpypi:
40
+ name: Publish to TestPyPI
41
+ needs: build
42
+ runs-on: ubuntu-latest
43
+ environment: testpypi
44
+ permissions:
45
+ id-token: write
46
+
47
+ steps:
48
+ - uses: actions/download-artifact@v8
49
+ with:
50
+ name: dist
51
+ path: dist/
52
+
53
+ - name: Publish to TestPyPI
54
+ uses: pypa/gh-action-pypi-publish@release/v1
55
+ with:
56
+ repository-url: https://test.pypi.org/legacy/
57
+
58
+ publish-pypi:
59
+ name: Publish to PyPI
60
+ needs: publish-testpypi
61
+ runs-on: ubuntu-latest
62
+ environment: pypi
63
+ permissions:
64
+ id-token: write
65
+
66
+ steps:
67
+ - uses: actions/download-artifact@v8
68
+ with:
69
+ name: dist
70
+ path: dist/
71
+
72
+ - name: Publish to PyPI
73
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,43 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.egg-info/
6
+ *.egg
7
+ dist/
8
+ build/
9
+ *.whl
10
+
11
+ # Virtual environments
12
+ .venv/
13
+ venv/
14
+
15
+ # IDE
16
+ .idea/
17
+ .vscode/
18
+ *.swp
19
+ *.swo
20
+
21
+ # Testing / Coverage
22
+ .coverage
23
+ htmlcov/
24
+ .pytest_cache/
25
+ .mypy_cache/
26
+
27
+ # OS
28
+ .DS_Store
29
+ Thumbs.db
30
+
31
+ # Generated version
32
+ src/pycatdap/_version.py
33
+
34
+ # AI
35
+ .ai_settings/
36
+ .agent/
37
+ .agents/
38
+ .claude/
39
+ .codex/
40
+ .gemini/
41
+ AGENTS.md
42
+ CLAUDE.md
43
+ GEMINI.md
@@ -0,0 +1,17 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ rev: v0.11.12
4
+ hooks:
5
+ - id: ruff
6
+ args: [--fix]
7
+ - id: ruff-format
8
+
9
+ - repo: https://github.com/pre-commit/pre-commit-hooks
10
+ rev: v5.0.0
11
+ hooks:
12
+ - id: trailing-whitespace
13
+ - id: end-of-file-fixer
14
+ - id: check-yaml
15
+ - id: check-added-large-files
16
+ args: [--maxkb=500]
17
+ - id: detect-private-key