xeries 0.1.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 (49) hide show
  1. xeries-0.1.0/.cursor/plans/AGENTS.md +1 -0
  2. xeries-0.1.0/.github/workflows/ci.yml +136 -0
  3. xeries-0.1.0/.github/workflows/docs.yml +54 -0
  4. xeries-0.1.0/.github/workflows/release.yml +140 -0
  5. xeries-0.1.0/.gitignore +84 -0
  6. xeries-0.1.0/.pre-commit-config.yaml +25 -0
  7. xeries-0.1.0/LICENSE +21 -0
  8. xeries-0.1.0/PKG-INFO +379 -0
  9. xeries-0.1.0/README.md +324 -0
  10. xeries-0.1.0/RELEASING.md +131 -0
  11. xeries-0.1.0/docs/Initial_plan.md +304 -0
  12. xeries-0.1.0/docs/api/adapters.md +23 -0
  13. xeries-0.1.0/docs/api/importance.md +25 -0
  14. xeries-0.1.0/docs/api/partitioners.md +28 -0
  15. xeries-0.1.0/docs/api/reference.md +41 -0
  16. xeries-0.1.0/docs/getting-started.md +139 -0
  17. xeries-0.1.0/docs/index.md +76 -0
  18. xeries-0.1.0/docs/tutorials/quickstart.md +206 -0
  19. xeries-0.1.0/examples/01_quickstart.ipynb +741 -0
  20. xeries-0.1.0/examples/02_skforecast_integration.ipynb +402 -0
  21. xeries-0.1.0/examples/README.md +50 -0
  22. xeries-0.1.0/mkdocs.yml +85 -0
  23. xeries-0.1.0/pyproject.toml +146 -0
  24. xeries-0.1.0/src/xeries/_version.py +3 -0
  25. xeries-0.1.0/src/xeries/adapters/__init__.py +15 -0
  26. xeries-0.1.0/src/xeries/adapters/base.py +61 -0
  27. xeries-0.1.0/src/xeries/adapters/skforecast.py +222 -0
  28. xeries-0.1.0/src/xeries/adapters/sklearn.py +61 -0
  29. xeries-0.1.0/src/xeries/core/__init__.py +18 -0
  30. xeries-0.1.0/src/xeries/core/base.py +199 -0
  31. xeries-0.1.0/src/xeries/core/types.py +160 -0
  32. xeries-0.1.0/src/xeries/importance/__init__.py +17 -0
  33. xeries-0.1.0/src/xeries/importance/permutation.py +193 -0
  34. xeries-0.1.0/src/xeries/importance/shap.py +215 -0
  35. xeries-0.1.0/src/xeries/partitioners/__init__.py +9 -0
  36. xeries-0.1.0/src/xeries/partitioners/manual.py +97 -0
  37. xeries-0.1.0/src/xeries/partitioners/tree.py +164 -0
  38. xeries-0.1.0/src/xeries/visualization/__init__.py +17 -0
  39. xeries-0.1.0/src/xeries/visualization/plots.py +304 -0
  40. xeries-0.1.0/tests/__init__.py +1 -0
  41. xeries-0.1.0/tests/conftest.py +128 -0
  42. xeries-0.1.0/tests/integration/__init__.py +1 -0
  43. xeries-0.1.0/tests/integration/test_skforecast.py +156 -0
  44. xeries-0.1.0/tests/test_notebooks.py +121 -0
  45. xeries-0.1.0/tests/unit/__init__.py +1 -0
  46. xeries-0.1.0/tests/unit/test_partitioners.py +198 -0
  47. xeries-0.1.0/tests/unit/test_permutation.py +269 -0
  48. xeries-0.1.0/tests/unit/test_shap.py +235 -0
  49. xeries-0.1.0/ty.toml +17 -0
@@ -0,0 +1 @@
1
+ https://skforecast.org/latest/llms-full.txt
@@ -0,0 +1,136 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, master]
6
+ pull_request:
7
+ branches: [main, master]
8
+
9
+ env:
10
+ UV_SYSTEM_PYTHON: 1
11
+
12
+ jobs:
13
+ lint:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+
18
+ - name: Install uv
19
+ uses: astral-sh/setup-uv@v4
20
+ with:
21
+ version: "latest"
22
+
23
+ - name: Set up Python
24
+ uses: actions/setup-python@v5
25
+ with:
26
+ python-version: "3.11"
27
+
28
+ - name: Install dependencies
29
+ run: uv sync --dev
30
+
31
+ - name: Run ruff check
32
+ run: uv run ruff check src tests
33
+
34
+ - name: Run ruff format check
35
+ run: uv run ruff format --check src tests
36
+
37
+ type-check:
38
+ runs-on: ubuntu-latest
39
+ steps:
40
+ - uses: actions/checkout@v4
41
+
42
+ - name: Install uv
43
+ uses: astral-sh/setup-uv@v4
44
+ with:
45
+ version: "latest"
46
+
47
+ - name: Set up Python
48
+ uses: actions/setup-python@v5
49
+ with:
50
+ python-version: "3.11"
51
+
52
+ - name: Install dependencies
53
+ run: uv sync --dev
54
+
55
+ - name: Run ty
56
+ run: uv run ty check src
57
+
58
+ test:
59
+ runs-on: ubuntu-latest
60
+ strategy:
61
+ fail-fast: false
62
+ matrix:
63
+ python-version: ["3.11", "3.12"]
64
+
65
+ steps:
66
+ - uses: actions/checkout@v4
67
+
68
+ - name: Install uv
69
+ uses: astral-sh/setup-uv@v4
70
+ with:
71
+ version: "latest"
72
+
73
+ - name: Set up Python ${{ matrix.python-version }}
74
+ uses: actions/setup-python@v5
75
+ with:
76
+ python-version: ${{ matrix.python-version }}
77
+
78
+ - name: Install dependencies
79
+ run: uv sync --dev
80
+
81
+ - name: Run tests
82
+ run: uv run pytest tests -v --cov=xeries --cov-report=xml -m "not slow and not integration"
83
+
84
+ - name: Upload coverage to Codecov
85
+ if: matrix.python-version == '3.11'
86
+ uses: codecov/codecov-action@v4
87
+ with:
88
+ files: ./coverage.xml
89
+ fail_ci_if_error: false
90
+
91
+ integration-test:
92
+ runs-on: ubuntu-latest
93
+ steps:
94
+ - uses: actions/checkout@v4
95
+
96
+ - name: Install uv
97
+ uses: astral-sh/setup-uv@v4
98
+ with:
99
+ version: "latest"
100
+
101
+ - name: Set up Python
102
+ uses: actions/setup-python@v5
103
+ with:
104
+ python-version: "3.11"
105
+
106
+ - name: Install dependencies with optional deps
107
+ run: |
108
+ uv sync --dev
109
+ uv pip install skforecast
110
+
111
+ - name: Run integration tests
112
+ run: uv run pytest tests -v -m "integration" --tb=short
113
+
114
+ notebook-test:
115
+ runs-on: ubuntu-latest
116
+ steps:
117
+ - uses: actions/checkout@v4
118
+
119
+ - name: Install uv
120
+ uses: astral-sh/setup-uv@v4
121
+ with:
122
+ version: "latest"
123
+
124
+ - name: Set up Python
125
+ uses: actions/setup-python@v5
126
+ with:
127
+ python-version: "3.11"
128
+
129
+ - name: Install dependencies with notebook support
130
+ run: uv sync --dev
131
+
132
+ - name: Run notebook structure tests
133
+ run: uv run pytest tests/test_notebooks.py -v -m "notebook and not slow" --tb=short
134
+
135
+ - name: Run notebook execution tests
136
+ run: uv run pytest tests/test_notebooks.py -v -m "notebook and slow" --tb=short
@@ -0,0 +1,54 @@
1
+ name: Documentation
2
+
3
+ on:
4
+ push:
5
+ branches: [main, master]
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+ pages: write
11
+ id-token: write
12
+
13
+ concurrency:
14
+ group: pages
15
+ cancel-in-progress: false
16
+
17
+ jobs:
18
+ build:
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+
23
+ - name: Install uv
24
+ uses: astral-sh/setup-uv@v4
25
+ with:
26
+ version: "latest"
27
+
28
+ - name: Set up Python
29
+ uses: actions/setup-python@v5
30
+ with:
31
+ python-version: "3.11"
32
+
33
+ - name: Install dependencies
34
+ run: uv sync --group docs
35
+
36
+ - name: Build documentation
37
+ run: uv run mkdocs build
38
+
39
+ - name: Upload artifact
40
+ uses: actions/upload-pages-artifact@v3
41
+ with:
42
+ path: site/
43
+
44
+ deploy:
45
+ needs: build
46
+ runs-on: ubuntu-latest
47
+ environment:
48
+ name: github-pages
49
+ url: ${{ steps.deployment.outputs.page_url }}
50
+
51
+ steps:
52
+ - name: Deploy to GitHub Pages
53
+ id: deployment
54
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,140 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+ workflow_dispatch:
8
+ inputs:
9
+ target:
10
+ description: "Release target"
11
+ required: true
12
+ default: "testpypi"
13
+ type: choice
14
+ options:
15
+ - testpypi
16
+ - pypi
17
+
18
+ permissions:
19
+ contents: read
20
+ id-token: write
21
+
22
+ jobs:
23
+ build:
24
+ runs-on: ubuntu-latest
25
+ outputs:
26
+ version: ${{ steps.version.outputs.version }}
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+
30
+ - name: Install uv
31
+ uses: astral-sh/setup-uv@v4
32
+ with:
33
+ version: "latest"
34
+
35
+ - name: Set up Python
36
+ uses: actions/setup-python@v5
37
+ with:
38
+ python-version: "3.11"
39
+
40
+ - name: Extract version
41
+ id: version
42
+ run: |
43
+ VERSION=$(grep -Po '(?<=__version__ = ")[^"]*' src/xeries/_version.py)
44
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
45
+ echo "Package version: $VERSION"
46
+
47
+ - name: Validate tag matches version
48
+ if: startsWith(github.ref, 'refs/tags/v')
49
+ run: |
50
+ TAG_VERSION="${GITHUB_REF#refs/tags/v}"
51
+ PKG_VERSION="${{ steps.version.outputs.version }}"
52
+ if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
53
+ echo "Error: Tag version ($TAG_VERSION) does not match package version ($PKG_VERSION)"
54
+ exit 1
55
+ fi
56
+ echo "Tag version matches package version: $PKG_VERSION"
57
+
58
+ - name: Build package
59
+ run: uv build
60
+
61
+ - name: Verify build artifacts
62
+ run: |
63
+ ls -la dist/
64
+ echo "--- Wheel contents ---"
65
+ python -m zipfile -l dist/*.whl | head -30
66
+
67
+ - name: Upload artifacts
68
+ uses: actions/upload-artifact@v4
69
+ with:
70
+ name: dist
71
+ path: dist/
72
+
73
+ publish-testpypi:
74
+ needs: build
75
+ if: >
76
+ github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'testpypi'
77
+ runs-on: ubuntu-latest
78
+ environment:
79
+ name: testpypi
80
+ url: https://test.pypi.org/project/xeries/
81
+
82
+ steps:
83
+ - name: Download artifacts
84
+ uses: actions/download-artifact@v4
85
+ with:
86
+ name: dist
87
+ path: dist/
88
+
89
+ - name: Publish to TestPyPI
90
+ uses: pypa/gh-action-pypi-publish@release/v1
91
+ with:
92
+ repository-url: https://test.pypi.org/legacy/
93
+ skip-existing: true
94
+
95
+ publish-pypi:
96
+ needs: build
97
+ if: >
98
+ startsWith(github.ref, 'refs/tags/v') ||
99
+ (github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'pypi')
100
+ runs-on: ubuntu-latest
101
+ environment:
102
+ name: pypi
103
+ url: https://pypi.org/project/xeries/
104
+
105
+ steps:
106
+ - name: Download artifacts
107
+ uses: actions/download-artifact@v4
108
+ with:
109
+ name: dist
110
+ path: dist/
111
+
112
+ - name: Publish to PyPI
113
+ uses: pypa/gh-action-pypi-publish@release/v1
114
+ with:
115
+ # Uses trusted publishing (OIDC) - no API token needed
116
+ # Configure at: https://pypi.org/manage/project/xeries/settings/publishing/
117
+ skip-existing: true
118
+
119
+ github-release:
120
+ needs: [build, publish-pypi]
121
+ if: startsWith(github.ref, 'refs/tags/v')
122
+ runs-on: ubuntu-latest
123
+ permissions:
124
+ contents: write
125
+
126
+ steps:
127
+ - uses: actions/checkout@v4
128
+
129
+ - name: Download artifacts
130
+ uses: actions/download-artifact@v4
131
+ with:
132
+ name: dist
133
+ path: dist/
134
+
135
+ - name: Create GitHub Release
136
+ uses: softprops/action-gh-release@v2
137
+ with:
138
+ files: dist/*
139
+ generate_release_notes: true
140
+ name: "xeries v${{ needs.build.outputs.version }}"
@@ -0,0 +1,84 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ *.egg-info/
24
+ .installed.cfg
25
+ *.egg
26
+
27
+ # PyInstaller
28
+ *.manifest
29
+ *.spec
30
+
31
+ # Installer logs
32
+ pip-log.txt
33
+ pip-delete-this-directory.txt
34
+
35
+ # Unit test / coverage reports
36
+ htmlcov/
37
+ .tox/
38
+ .nox/
39
+ .coverage
40
+ .coverage.*
41
+ .cache
42
+ nosetests.xml
43
+ coverage.xml
44
+ *.cover
45
+ *.py,cover
46
+ .hypothesis/
47
+ .pytest_cache/
48
+
49
+ # Translations
50
+ *.mo
51
+ *.pot
52
+
53
+ # Environments
54
+ .env
55
+ .venv
56
+ env/
57
+ venv/
58
+ ENV/
59
+ env.bak/
60
+ venv.bak/
61
+
62
+ # UV
63
+ .uv/
64
+ uv.lock
65
+
66
+ # Ruff
67
+ .ruff_cache/
68
+
69
+ # IDEs
70
+ .idea/
71
+ .vscode/
72
+ *.swp
73
+ *.swo
74
+ *~
75
+
76
+ # Jupyter Notebook
77
+ .ipynb_checkpoints
78
+
79
+ # Documentation
80
+ site/
81
+
82
+ # OS
83
+ .DS_Store
84
+ Thumbs.db
@@ -0,0 +1,25 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v4.5.0
4
+ hooks:
5
+ - id: trailing-whitespace
6
+ - id: end-of-file-fixer
7
+ - id: check-yaml
8
+ args: [--unsafe]
9
+ - id: check-added-large-files
10
+ - id: check-toml
11
+
12
+ - repo: https://github.com/astral-sh/ruff-pre-commit
13
+ rev: v0.4.4
14
+ hooks:
15
+ - id: ruff
16
+ args: [--fix]
17
+ - id: ruff-format
18
+
19
+ - repo: local
20
+ hooks:
21
+ - id: ty
22
+ name: ty
23
+ entry: uv run ty check src tests
24
+ language: system
25
+ pass_filenames: false
xeries-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Your Name
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 shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.