decider 0.0.1__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.
- decider-0.0.1/.dockerignore +25 -0
- decider-0.0.1/.gitattributes +5 -0
- decider-0.0.1/.github/workflows/pr.yml +31 -0
- decider-0.0.1/.github/workflows/release.yml +220 -0
- decider-0.0.1/.gitignore +180 -0
- decider-0.0.1/CODE_OF_CONDUCT.md +128 -0
- decider-0.0.1/CONTRIBUTING.md +117 -0
- decider-0.0.1/LICENSE +21 -0
- decider-0.0.1/PKG-INFO +268 -0
- decider-0.0.1/README.md +218 -0
- decider-0.0.1/SECURITY.md +19 -0
- decider-0.0.1/Tasks.md +15 -0
- decider-0.0.1/decider/__init__.py +7 -0
- decider-0.0.1/decider/_ext.py +106 -0
- decider-0.0.1/decider/cli/__init__.py +15 -0
- decider-0.0.1/decider/cli/_graph.py +310 -0
- decider-0.0.1/decider/cli/_visualise_app.py +236 -0
- decider-0.0.1/decider/cli/serve.py +92 -0
- decider-0.0.1/decider/cli/template.py +86 -0
- decider-0.0.1/decider/cli/visualise.py +92 -0
- decider-0.0.1/decider/config/__init__.py +22 -0
- decider-0.0.1/decider/config/_ext.py +17 -0
- decider-0.0.1/decider/config/_ext.pyi +16 -0
- decider-0.0.1/decider/config/base.py +113 -0
- decider-0.0.1/decider/config/core.py +156 -0
- decider-0.0.1/decider/config/file.py +189 -0
- decider-0.0.1/decider/config/versioned.py +57 -0
- decider-0.0.1/decider/exceptions.py +113 -0
- decider-0.0.1/decider/executor.py +146 -0
- decider-0.0.1/decider/graphutil.py +40 -0
- decider-0.0.1/decider/initialization.py +52 -0
- decider-0.0.1/decider/magics/__init__.py +162 -0
- decider-0.0.1/decider/modules/__init__.py +22 -0
- decider-0.0.1/decider/modules/_ext.py +15 -0
- decider-0.0.1/decider/modules/_ext.pyi +16 -0
- decider-0.0.1/decider/modules/core.py +92 -0
- decider-0.0.1/decider/modules/credit/__init__.py +24 -0
- decider-0.0.1/decider/modules/credit/decision_table/__init__.py +27 -0
- decider-0.0.1/decider/modules/credit/decision_table/config.py +290 -0
- decider-0.0.1/decider/modules/credit/decision_table/impl.py +66 -0
- decider-0.0.1/decider/modules/credit/decision_table/module.py +71 -0
- decider-0.0.1/decider/modules/credit/scorecard/__init__.py +42 -0
- decider-0.0.1/decider/modules/credit/scorecard/impl.py +312 -0
- decider-0.0.1/decider/modules/credit/scorecard/module.py +359 -0
- decider-0.0.1/decider/modules/expression.py +245 -0
- decider-0.0.1/decider/modules/functional.py +202 -0
- decider-0.0.1/decider/modules/primitives/__init__.py +5 -0
- decider-0.0.1/decider/modules/primitives/join.py +90 -0
- decider-0.0.1/decider/modules/primitives/sequential.py +105 -0
- decider-0.0.1/decider/modules/primitives/union.py +22 -0
- decider-0.0.1/decider/modules/rules/__init__.py +162 -0
- decider-0.0.1/decider/modules/rules/common/__init__.py +0 -0
- decider-0.0.1/decider/modules/rules/common/feature.py +128 -0
- decider-0.0.1/decider/modules/rules/common/nodes/__init__.py +82 -0
- decider-0.0.1/decider/modules/rules/common/nodes/cases.py +208 -0
- decider-0.0.1/decider/modules/rules/common/nodes/composite.py +40 -0
- decider-0.0.1/decider/modules/rules/common/nodes/conditions.py +301 -0
- decider-0.0.1/decider/modules/rules/common/nodes/operators.py +323 -0
- decider-0.0.1/decider/modules/rules/common/nodes/unary.py +25 -0
- decider-0.0.1/decider/modules/rules/common/nodetypes.py +128 -0
- decider-0.0.1/decider/modules/rules/common/parameters.py +143 -0
- decider-0.0.1/decider/modules/rules/common/shared.py +184 -0
- decider-0.0.1/decider/modules/rules/flat_rules/__init__.py +0 -0
- decider-0.0.1/decider/modules/rules/flat_rules/impl.py +542 -0
- decider-0.0.1/decider/modules/rules/flat_rules/module.py +287 -0
- decider-0.0.1/decider/modules/rules/flat_rules/nodes.py +582 -0
- decider-0.0.1/decider/modules/rules/modules.py +61 -0
- decider-0.0.1/decider/modules/rules/tree/__init__.py +31 -0
- decider-0.0.1/decider/modules/rules/tree/tree.py +117 -0
- decider-0.0.1/decider/modules/rules/tree/v1/__init__.py +0 -0
- decider-0.0.1/decider/modules/rules/tree/v1/edges.py +37 -0
- decider-0.0.1/decider/modules/rules/tree/v1/nodes.py +122 -0
- decider-0.0.1/decider/modules/rules/tree/v1/schema.py +383 -0
- decider-0.0.1/decider/modules/rules/tree/v1/tree.py +586 -0
- decider-0.0.1/decider/modules/rules/tree/v1/variables.py +71 -0
- decider-0.0.1/decider/modules/rules/tree/v2/__init__.py +0 -0
- decider-0.0.1/decider/modules/rules/tree/v2/nodes.py +230 -0
- decider-0.0.1/decider/modules/rules/tree/v2/tree.py +113 -0
- decider-0.0.1/decider/modules/rules/tree/v3/__init__.py +94 -0
- decider-0.0.1/decider/modules/rules/tree/v3/nodes_ui.py +307 -0
- decider-0.0.1/decider/modules/rules/tree/v3/tree.py +177 -0
- decider-0.0.1/decider/modules/util.py +88 -0
- decider-0.0.1/decider/serializable/__init__.py +0 -0
- decider-0.0.1/decider/serializable/dataframe.py +61 -0
- decider-0.0.1/decider/serializable/dtypes.py +148 -0
- decider-0.0.1/decider/serializable/function.py +24 -0
- decider-0.0.1/decider/serializable/schema.py +368 -0
- decider-0.0.1/decider/serving/__init__.py +0 -0
- decider-0.0.1/decider/serving/format.py +47 -0
- decider-0.0.1/decider/serving/handler.py +113 -0
- decider-0.0.1/decider/serving/media_types.py +11 -0
- decider-0.0.1/decider/serving/parse.py +49 -0
- decider-0.0.1/decider/serving/servers/__init__.py +0 -0
- decider-0.0.1/decider/serving/servers/core.py +19 -0
- decider-0.0.1/decider/serving/servers/sanic.py +56 -0
- decider-0.0.1/decider/serving/servers/starlette.py +68 -0
- decider-0.0.1/decider/settings.py +93 -0
- decider-0.0.1/decider/templates/__init__.py +3 -0
- decider-0.0.1/decider/templates/scaffold.py +154 -0
- decider-0.0.1/decider/templates/static/extension_module.py +13 -0
- decider-0.0.1/decider/templates/static/extension_package/module.py +13 -0
- decider-0.0.1/decider/templates/static/extension_package/pyproject.toml +19 -0
- decider-0.0.1/decider/templates/static/project/generate.py +65 -0
- decider-0.0.1/decider/templates/static/project/speedtest.py +66 -0
- decider-0.0.1/decider/types.py +6 -0
- decider-0.0.1/docker/Dockerfile +56 -0
- decider-0.0.1/docs/Makefile +12 -0
- decider-0.0.1/docs/_templates/custom-class-template.rst +34 -0
- decider-0.0.1/docs/_templates/custom-module-template.rst +66 -0
- decider-0.0.1/docs/api.rst +8 -0
- decider-0.0.1/docs/concepts/config.md +51 -0
- decider-0.0.1/docs/concepts/extensions.md +67 -0
- decider-0.0.1/docs/concepts/index.md +12 -0
- decider-0.0.1/docs/concepts/modules.md +54 -0
- decider-0.0.1/docs/concepts/pipelines.md +48 -0
- decider-0.0.1/docs/conf.py +62 -0
- decider-0.0.1/docs/contributing/index.md +4 -0
- decider-0.0.1/docs/examples/01_getting_started.ipynb +204 -0
- decider-0.0.1/docs/examples/02_pipelines_and_joins.ipynb +260 -0
- decider-0.0.1/docs/examples/03_config_and_persistence.ipynb +227 -0
- decider-0.0.1/docs/examples/projects/01_loan_scoring.ipynb +229 -0
- decider-0.0.1/docs/examples/projects/02_fraud_detection.ipynb +215 -0
- decider-0.0.1/docs/examples/projects/03_affordability_check.ipynb +239 -0
- decider-0.0.1/docs/examples/projects/04_multi_bureau_pipeline.ipynb +239 -0
- decider-0.0.1/docs/examples/projects/05_notebook_to_serving/.gitignore +2 -0
- decider-0.0.1/docs/examples/projects/05_notebook_to_serving/05_notebook_to_serving.ipynb +414 -0
- decider-0.0.1/docs/getting_started/index.md +9 -0
- decider-0.0.1/docs/getting_started/install.md +46 -0
- decider-0.0.1/docs/getting_started/quick_start.md +24 -0
- decider-0.0.1/docs/index.rst +11 -0
- decider-0.0.1/docs/main.md +32 -0
- decider-0.0.1/docs/robots.txt +2 -0
- decider-0.0.1/projects/loan_scoring/decider_extensions/loan_scoring/__init__.py +40 -0
- decider-0.0.1/projects/loan_scoring/generate.py +133 -0
- decider-0.0.1/projects/loan_scoring/notebook.ipynb +297 -0
- decider-0.0.1/projects/loan_scoring/speedtest.py +83 -0
- decider-0.0.1/pyproject.toml +84 -0
- decider-0.0.1/tests/__init__.py +0 -0
- decider-0.0.1/tests/conftest.py +6 -0
- decider-0.0.1/tests/credit/__init__.py +0 -0
- decider-0.0.1/tests/credit/decision_table/__init__.py +0 -0
- decider-0.0.1/tests/credit/decision_table/test_decision_table.py +147 -0
- decider-0.0.1/tests/credit/scorecard/__init__.py +0 -0
- decider-0.0.1/tests/credit/scorecard/test_scorecard.py +146 -0
- decider-0.0.1/tests/rules/__init__.py +0 -0
- decider-0.0.1/tests/rules/test_conditions.py +551 -0
- decider-0.0.1/tests/rules/test_parameters.py +177 -0
- decider-0.0.1/tests/rules/test_tree_end_to_end.py +772 -0
- decider-0.0.1/tests/rules/test_tree_migration.py +197 -0
- decider-0.0.1/tests/test_config_roundtrip.py +113 -0
- decider-0.0.1/tests/test_expression_module.py +144 -0
- decider-0.0.1/tests/test_graph_module_registry.py +69 -0
- decider-0.0.1/tests/test_sequential_and_join.py +140 -0
- decider-0.0.1/uv.lock +3700 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Ignore everything then whitelist what the image actually needs
|
|
2
|
+
*
|
|
3
|
+
|
|
4
|
+
# Package source and build artefacts
|
|
5
|
+
!/decider
|
|
6
|
+
!/dist
|
|
7
|
+
!/pyproject.toml
|
|
8
|
+
!/uv.lock
|
|
9
|
+
|
|
10
|
+
# Strip noise from allowed directories
|
|
11
|
+
**/__pycache__
|
|
12
|
+
**/*.pyc
|
|
13
|
+
**/*.pyo
|
|
14
|
+
**/*.pyd
|
|
15
|
+
**/*.egg-info
|
|
16
|
+
**/.DS_Store
|
|
17
|
+
**/Thumbs.db
|
|
18
|
+
**/*.log
|
|
19
|
+
**/.git
|
|
20
|
+
**/.mypy_cache
|
|
21
|
+
**/.pytest_cache
|
|
22
|
+
**/.hypothesis
|
|
23
|
+
**/.coverage
|
|
24
|
+
**/.coverage.*
|
|
25
|
+
**/.tox
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: PR Checks
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
with:
|
|
17
|
+
fetch-depth: 0
|
|
18
|
+
|
|
19
|
+
- name: Install uv
|
|
20
|
+
uses: astral-sh/setup-uv@v4
|
|
21
|
+
|
|
22
|
+
- name: Set up Python
|
|
23
|
+
uses: actions/setup-python@v5
|
|
24
|
+
with:
|
|
25
|
+
python-version: "3.12"
|
|
26
|
+
|
|
27
|
+
- name: Install dependencies
|
|
28
|
+
run: uv sync --group dev
|
|
29
|
+
|
|
30
|
+
- name: Run tests
|
|
31
|
+
run: uv run pytest
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v[0-9]*'
|
|
7
|
+
|
|
8
|
+
env:
|
|
9
|
+
DOCKER_IMAGE: capitecbankltd/decider
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
# โโ 1. Resolve version from git tags (hatch-vcs) โโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
13
|
+
version:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
outputs:
|
|
16
|
+
version: ${{ steps.get.outputs.version }}
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
with:
|
|
20
|
+
fetch-depth: 0 # full history so hatch-vcs can read tags
|
|
21
|
+
|
|
22
|
+
- name: Install uv
|
|
23
|
+
uses: astral-sh/setup-uv@v5
|
|
24
|
+
|
|
25
|
+
- name: Set up Python
|
|
26
|
+
uses: actions/setup-python@v5
|
|
27
|
+
with:
|
|
28
|
+
python-version: "3.12"
|
|
29
|
+
|
|
30
|
+
- name: Resolve version
|
|
31
|
+
id: get
|
|
32
|
+
run: |
|
|
33
|
+
uv sync --group dev
|
|
34
|
+
VERSION=$(uv run python -c "from importlib.metadata import version; print(version('decider'))")
|
|
35
|
+
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
|
36
|
+
|
|
37
|
+
# โโ 2a. Build wheel โ PyPI โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
38
|
+
publish-pypi:
|
|
39
|
+
needs: version
|
|
40
|
+
runs-on: ubuntu-latest
|
|
41
|
+
environment:
|
|
42
|
+
name: release
|
|
43
|
+
url: https://pypi.org/p/decider
|
|
44
|
+
permissions:
|
|
45
|
+
id-token: write # OIDC trusted publishing โ no token secret needed
|
|
46
|
+
steps:
|
|
47
|
+
- uses: actions/checkout@v4
|
|
48
|
+
with:
|
|
49
|
+
fetch-depth: 0
|
|
50
|
+
|
|
51
|
+
- name: Install uv
|
|
52
|
+
uses: astral-sh/setup-uv@v5
|
|
53
|
+
|
|
54
|
+
- name: Set up Python
|
|
55
|
+
uses: actions/setup-python@v5
|
|
56
|
+
with:
|
|
57
|
+
python-version: "3.12"
|
|
58
|
+
|
|
59
|
+
- name: Run tests
|
|
60
|
+
run: |
|
|
61
|
+
uv sync --group dev
|
|
62
|
+
uv run pytest
|
|
63
|
+
|
|
64
|
+
- name: Build wheel + sdist
|
|
65
|
+
run: uv build
|
|
66
|
+
|
|
67
|
+
- name: Upload wheel artifact
|
|
68
|
+
uses: actions/upload-artifact@v4
|
|
69
|
+
with:
|
|
70
|
+
name: dist
|
|
71
|
+
path: dist/
|
|
72
|
+
retention-days: 1
|
|
73
|
+
|
|
74
|
+
- name: Publish to PyPI
|
|
75
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
76
|
+
with:
|
|
77
|
+
skip-existing: true
|
|
78
|
+
|
|
79
|
+
# โโ 2b. Build and push Docker image โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
80
|
+
publish-docker:
|
|
81
|
+
needs: [version, publish-pypi]
|
|
82
|
+
runs-on: ubuntu-latest
|
|
83
|
+
environment:
|
|
84
|
+
name: release
|
|
85
|
+
permissions:
|
|
86
|
+
contents: read
|
|
87
|
+
steps:
|
|
88
|
+
- uses: actions/checkout@v4
|
|
89
|
+
with:
|
|
90
|
+
fetch-depth: 0
|
|
91
|
+
|
|
92
|
+
- name: Download wheel artifact
|
|
93
|
+
uses: actions/download-artifact@v4
|
|
94
|
+
with:
|
|
95
|
+
name: dist
|
|
96
|
+
path: dist/
|
|
97
|
+
|
|
98
|
+
- name: Set up QEMU
|
|
99
|
+
uses: docker/setup-qemu-action@v3
|
|
100
|
+
|
|
101
|
+
- name: Set up Docker Buildx
|
|
102
|
+
uses: docker/setup-buildx-action@v3
|
|
103
|
+
|
|
104
|
+
- name: Log in to Docker Hub
|
|
105
|
+
uses: docker/login-action@v3
|
|
106
|
+
with:
|
|
107
|
+
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
108
|
+
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
109
|
+
|
|
110
|
+
- name: Build and push versioned image
|
|
111
|
+
uses: docker/build-push-action@v6
|
|
112
|
+
with:
|
|
113
|
+
context: .
|
|
114
|
+
file: docker/Dockerfile
|
|
115
|
+
push: true
|
|
116
|
+
tags: ${{ env.DOCKER_IMAGE }}:${{ needs.version.outputs.version }}
|
|
117
|
+
cache-from: type=gha
|
|
118
|
+
cache-to: type=gha,mode=max
|
|
119
|
+
|
|
120
|
+
- name: Re-tag as latest
|
|
121
|
+
uses: docker/build-push-action@v6
|
|
122
|
+
with:
|
|
123
|
+
context: .
|
|
124
|
+
file: docker/Dockerfile
|
|
125
|
+
push: true
|
|
126
|
+
tags: ${{ env.DOCKER_IMAGE }}:latest
|
|
127
|
+
cache-from: type=gha
|
|
128
|
+
|
|
129
|
+
# โโ 2c. Build and deploy versioned docs to GitHub Pages โโโโโโโโโโโโโโโโโโโ
|
|
130
|
+
publish-docs:
|
|
131
|
+
needs: version
|
|
132
|
+
runs-on: ubuntu-latest
|
|
133
|
+
environment:
|
|
134
|
+
name: release
|
|
135
|
+
url: https://capitecbankltd.github.io/dsp_north-polrs
|
|
136
|
+
permissions:
|
|
137
|
+
pages: write
|
|
138
|
+
id-token: write
|
|
139
|
+
steps:
|
|
140
|
+
- uses: actions/checkout@v4
|
|
141
|
+
with:
|
|
142
|
+
fetch-depth: 0
|
|
143
|
+
|
|
144
|
+
- name: Install uv
|
|
145
|
+
uses: astral-sh/setup-uv@v5
|
|
146
|
+
|
|
147
|
+
- name: Set up Python
|
|
148
|
+
uses: actions/setup-python@v5
|
|
149
|
+
with:
|
|
150
|
+
python-version: "3.12"
|
|
151
|
+
|
|
152
|
+
- name: Install docs dependencies
|
|
153
|
+
run: uv sync --extra docs
|
|
154
|
+
|
|
155
|
+
- name: Restore previous gh-pages (for versioned history)
|
|
156
|
+
# Pull whatever is already deployed so we can layer this release on top.
|
|
157
|
+
# If the branch doesn't exist yet the step silently skips.
|
|
158
|
+
run: |
|
|
159
|
+
git fetch origin gh-pages:gh-pages 2>/dev/null || true
|
|
160
|
+
if git show-ref --quiet refs/heads/gh-pages; then
|
|
161
|
+
git worktree add _site gh-pages
|
|
162
|
+
else
|
|
163
|
+
mkdir -p _site
|
|
164
|
+
fi
|
|
165
|
+
|
|
166
|
+
- name: Build docs for this version
|
|
167
|
+
env:
|
|
168
|
+
VERSION: ${{ needs.version.outputs.version }}
|
|
169
|
+
run: |
|
|
170
|
+
uv run python -m sphinx docs docs/_build/html -b html
|
|
171
|
+
# Copy into a versioned subdirectory so older releases stay accessible.
|
|
172
|
+
mkdir -p _site/$VERSION
|
|
173
|
+
cp -r docs/_build/html/. _site/$VERSION/
|
|
174
|
+
# Also update the root (latest) copy.
|
|
175
|
+
cp -r docs/_build/html/. _site/
|
|
176
|
+
|
|
177
|
+
- name: Upload Pages artifact
|
|
178
|
+
uses: actions/upload-pages-artifact@v3
|
|
179
|
+
with:
|
|
180
|
+
path: _site/
|
|
181
|
+
|
|
182
|
+
- name: Deploy to GitHub Pages
|
|
183
|
+
uses: actions/deploy-pages@v4
|
|
184
|
+
|
|
185
|
+
# โโ 3. Tag and create GitHub Release (after all three deploys succeed) โโโโโ
|
|
186
|
+
github-release:
|
|
187
|
+
needs: [version, publish-pypi, publish-docker, publish-docs]
|
|
188
|
+
runs-on: ubuntu-latest
|
|
189
|
+
environment:
|
|
190
|
+
name: release
|
|
191
|
+
permissions:
|
|
192
|
+
contents: write
|
|
193
|
+
steps:
|
|
194
|
+
- uses: actions/checkout@v4
|
|
195
|
+
with:
|
|
196
|
+
fetch-depth: 0
|
|
197
|
+
|
|
198
|
+
- name: Download wheel artifact
|
|
199
|
+
uses: actions/download-artifact@v4
|
|
200
|
+
with:
|
|
201
|
+
name: dist
|
|
202
|
+
path: dist/
|
|
203
|
+
|
|
204
|
+
- name: Push version tag
|
|
205
|
+
env:
|
|
206
|
+
VERSION: ${{ needs.version.outputs.version }}
|
|
207
|
+
run: |
|
|
208
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
209
|
+
git config user.name "github-actions[bot]"
|
|
210
|
+
# Skip if tag already exists (e.g. re-run on same commit).
|
|
211
|
+
git tag "v${VERSION}" || true
|
|
212
|
+
git push origin "v${VERSION}" || true
|
|
213
|
+
|
|
214
|
+
- name: Create GitHub Release
|
|
215
|
+
uses: softprops/action-gh-release@v2
|
|
216
|
+
with:
|
|
217
|
+
tag_name: v${{ needs.version.outputs.version }}
|
|
218
|
+
name: Release ${{ needs.version.outputs.version }}
|
|
219
|
+
generate_release_notes: true
|
|
220
|
+
files: dist/*
|
decider-0.0.1/.gitignore
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# Template used from https://github.com/github/gitignore/blob/main/Python.gitignore
|
|
2
|
+
# Byte-compiled / optimized / DLL files
|
|
3
|
+
__pycache__/
|
|
4
|
+
*.py[cod]
|
|
5
|
+
*$py.class
|
|
6
|
+
|
|
7
|
+
# C extensions
|
|
8
|
+
*.so
|
|
9
|
+
|
|
10
|
+
# Distribution / packaging
|
|
11
|
+
.Python
|
|
12
|
+
build/
|
|
13
|
+
develop-eggs/
|
|
14
|
+
dist/
|
|
15
|
+
downloads/
|
|
16
|
+
eggs/
|
|
17
|
+
.eggs/
|
|
18
|
+
lib/
|
|
19
|
+
lib64/
|
|
20
|
+
parts/
|
|
21
|
+
sdist/
|
|
22
|
+
var/
|
|
23
|
+
wheels/
|
|
24
|
+
share/python-wheels/
|
|
25
|
+
*.egg-info/
|
|
26
|
+
.installed.cfg
|
|
27
|
+
*.egg
|
|
28
|
+
MANIFEST
|
|
29
|
+
|
|
30
|
+
# PyInstaller
|
|
31
|
+
# Usually these files are written by a python script from a template
|
|
32
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
33
|
+
*.manifest
|
|
34
|
+
*.spec
|
|
35
|
+
|
|
36
|
+
# Installer logs
|
|
37
|
+
pip-log.txt
|
|
38
|
+
pip-delete-this-directory.txt
|
|
39
|
+
|
|
40
|
+
# Unit test / coverage reports
|
|
41
|
+
htmlcov/
|
|
42
|
+
.tox/
|
|
43
|
+
.nox/
|
|
44
|
+
.coverage
|
|
45
|
+
.coverage.*
|
|
46
|
+
.cache
|
|
47
|
+
nosetests.xml
|
|
48
|
+
coverage.xml
|
|
49
|
+
*.cover
|
|
50
|
+
*.py,cover
|
|
51
|
+
.hypothesis/
|
|
52
|
+
.pytest_cache/
|
|
53
|
+
cover/
|
|
54
|
+
|
|
55
|
+
# Translations
|
|
56
|
+
*.mo
|
|
57
|
+
*.pot
|
|
58
|
+
|
|
59
|
+
# Django stuff:
|
|
60
|
+
*.log
|
|
61
|
+
local_settings.py
|
|
62
|
+
db.sqlite3
|
|
63
|
+
db.sqlite3-journal
|
|
64
|
+
|
|
65
|
+
# Flask stuff:
|
|
66
|
+
instance/
|
|
67
|
+
.webassets-cache
|
|
68
|
+
|
|
69
|
+
# Scrapy stuff:
|
|
70
|
+
.scrapy
|
|
71
|
+
|
|
72
|
+
# Sphinx documentation
|
|
73
|
+
docs/_build/
|
|
74
|
+
docs/_autosummary/
|
|
75
|
+
|
|
76
|
+
# PyBuilder
|
|
77
|
+
.pybuilder/
|
|
78
|
+
target/
|
|
79
|
+
|
|
80
|
+
# Jupyter Notebook
|
|
81
|
+
.ipynb_checkpoints
|
|
82
|
+
|
|
83
|
+
# IPython
|
|
84
|
+
profile_default/
|
|
85
|
+
ipython_config.py
|
|
86
|
+
|
|
87
|
+
# pyenv
|
|
88
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
89
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
90
|
+
# .python-version
|
|
91
|
+
|
|
92
|
+
# pipenv
|
|
93
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
94
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
95
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
96
|
+
# install all needed dependencies.
|
|
97
|
+
#Pipfile.lock
|
|
98
|
+
|
|
99
|
+
# poetry
|
|
100
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
101
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
102
|
+
# commonly ignored for libraries.
|
|
103
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
104
|
+
#poetry.lock
|
|
105
|
+
|
|
106
|
+
# pdm
|
|
107
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
108
|
+
#pdm.lock
|
|
109
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
110
|
+
# in version control.
|
|
111
|
+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
|
112
|
+
.pdm.toml
|
|
113
|
+
.pdm-python
|
|
114
|
+
.pdm-build/
|
|
115
|
+
|
|
116
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
117
|
+
__pypackages__/
|
|
118
|
+
|
|
119
|
+
# Celery stuff
|
|
120
|
+
celerybeat-schedule
|
|
121
|
+
celerybeat.pid
|
|
122
|
+
|
|
123
|
+
# SageMath parsed files
|
|
124
|
+
*.sage.py
|
|
125
|
+
|
|
126
|
+
# Environments
|
|
127
|
+
.env
|
|
128
|
+
.venv
|
|
129
|
+
env/
|
|
130
|
+
venv/
|
|
131
|
+
ENV/
|
|
132
|
+
env.bak/
|
|
133
|
+
venv.bak/
|
|
134
|
+
|
|
135
|
+
# Spyder project settings
|
|
136
|
+
.spyderproject
|
|
137
|
+
.spyproject
|
|
138
|
+
|
|
139
|
+
# Rope project settings
|
|
140
|
+
.ropeproject
|
|
141
|
+
|
|
142
|
+
# mkdocs documentation
|
|
143
|
+
/site
|
|
144
|
+
|
|
145
|
+
# mypy
|
|
146
|
+
.mypy_cache/
|
|
147
|
+
.dmypy.json
|
|
148
|
+
dmypy.json
|
|
149
|
+
|
|
150
|
+
# Pyre type checker
|
|
151
|
+
.pyre/
|
|
152
|
+
|
|
153
|
+
# pytype static type analyzer
|
|
154
|
+
.pytype/
|
|
155
|
+
|
|
156
|
+
# Cython debug symbols
|
|
157
|
+
cython_debug/
|
|
158
|
+
|
|
159
|
+
# PyCharm
|
|
160
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
161
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
162
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
163
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
164
|
+
.idea/
|
|
165
|
+
|
|
166
|
+
# General
|
|
167
|
+
.DS_Store
|
|
168
|
+
|
|
169
|
+
.vscode
|
|
170
|
+
.claude
|
|
171
|
+
|
|
172
|
+
# uv
|
|
173
|
+
# uv.lock is committed for reproducible installs โ do not ignore it
|
|
174
|
+
.python-version
|
|
175
|
+
|
|
176
|
+
# hatch-vcs generated version file
|
|
177
|
+
decider/_version.py
|
|
178
|
+
|
|
179
|
+
# project-level extension configs (generated by decider_extensions)
|
|
180
|
+
projects/*/configs/
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity
|
|
10
|
+
and orientation.
|
|
11
|
+
|
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
+
diverse, inclusive, and healthy community.
|
|
14
|
+
|
|
15
|
+
## Our Standards
|
|
16
|
+
|
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
|
18
|
+
community include:
|
|
19
|
+
|
|
20
|
+
* Demonstrating empathy and kindness toward other people
|
|
21
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
+
* Giving and gracefully accepting constructive feedback
|
|
23
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
24
|
+
and learning from the experience
|
|
25
|
+
* Focusing on what is best not just for us as individuals, but for the
|
|
26
|
+
overall community
|
|
27
|
+
|
|
28
|
+
Examples of unacceptable behavior include:
|
|
29
|
+
|
|
30
|
+
* The use of sexualized language or imagery, and sexual attention or
|
|
31
|
+
advances of any kind
|
|
32
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
33
|
+
* Public or private harassment
|
|
34
|
+
* Publishing others' private information, such as a physical or email
|
|
35
|
+
address, without their explicit permission
|
|
36
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
37
|
+
professional setting
|
|
38
|
+
|
|
39
|
+
## Enforcement Responsibilities
|
|
40
|
+
|
|
41
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
|
42
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
|
43
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
44
|
+
or harmful.
|
|
45
|
+
|
|
46
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
|
47
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
48
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
49
|
+
decisions when appropriate.
|
|
50
|
+
|
|
51
|
+
## Scope
|
|
52
|
+
|
|
53
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
|
54
|
+
an individual is officially representing the community in public spaces.
|
|
55
|
+
Examples of representing our community include using an official e-mail address,
|
|
56
|
+
posting via an official social media account, or acting as an appointed
|
|
57
|
+
representative at an online or offline event.
|
|
58
|
+
|
|
59
|
+
## Enforcement
|
|
60
|
+
|
|
61
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
62
|
+
reported to the community leaders responsible for enforcement at
|
|
63
|
+
opensource@capitecbank.co.za.
|
|
64
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
|
65
|
+
|
|
66
|
+
All community leaders are obligated to respect the privacy and security of the
|
|
67
|
+
reporter of any incident.
|
|
68
|
+
|
|
69
|
+
## Enforcement Guidelines
|
|
70
|
+
|
|
71
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
|
72
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
|
73
|
+
|
|
74
|
+
### 1. Correction
|
|
75
|
+
|
|
76
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
77
|
+
unprofessional or unwelcome in the community.
|
|
78
|
+
|
|
79
|
+
**Consequence**: A private, written warning from community leaders, providing
|
|
80
|
+
clarity around the nature of the violation and an explanation of why the
|
|
81
|
+
behavior was inappropriate. A public apology may be requested.
|
|
82
|
+
|
|
83
|
+
### 2. Warning
|
|
84
|
+
|
|
85
|
+
**Community Impact**: A violation through a single incident or series
|
|
86
|
+
of actions.
|
|
87
|
+
|
|
88
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
|
89
|
+
interaction with the people involved, including unsolicited interaction with
|
|
90
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
|
91
|
+
includes avoiding interactions in community spaces as well as external channels
|
|
92
|
+
like social media. Violating these terms may lead to a temporary or
|
|
93
|
+
permanent ban.
|
|
94
|
+
|
|
95
|
+
### 3. Temporary Ban
|
|
96
|
+
|
|
97
|
+
**Community Impact**: A serious violation of community standards, including
|
|
98
|
+
sustained inappropriate behavior.
|
|
99
|
+
|
|
100
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
|
101
|
+
communication with the community for a specified period of time. No public or
|
|
102
|
+
private interaction with the people involved, including unsolicited interaction
|
|
103
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
|
104
|
+
Violating these terms may lead to a permanent ban.
|
|
105
|
+
|
|
106
|
+
### 4. Permanent Ban
|
|
107
|
+
|
|
108
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
|
109
|
+
standards, including sustained inappropriate behavior, harassment of an
|
|
110
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
|
111
|
+
|
|
112
|
+
**Consequence**: A permanent ban from any sort of public interaction within
|
|
113
|
+
the community.
|
|
114
|
+
|
|
115
|
+
## Attribution
|
|
116
|
+
|
|
117
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
118
|
+
version 2.0, available at
|
|
119
|
+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
|
120
|
+
|
|
121
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
|
122
|
+
enforcement ladder](https://github.com/mozilla/diversity).
|
|
123
|
+
|
|
124
|
+
[homepage]: https://www.contributor-covenant.org
|
|
125
|
+
|
|
126
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
|
127
|
+
https://www.contributor-covenant.org/faq. Translations are available at
|
|
128
|
+
https://www.contributor-covenant.org/translations.
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
We value and encourage community contributions. To get started, please follow these guidelines:
|
|
4
|
+
|
|
5
|
+
1. [Code of Conduct](#1-code-of-conduct)
|
|
6
|
+
2. [Issues](#2-issues)
|
|
7
|
+
3. [Vulnerabilities](#3-vulnerabilities)
|
|
8
|
+
4. [Development](#4-development)
|
|
9
|
+
5. [Pull Requests](#5-pull-requests)
|
|
10
|
+
|
|
11
|
+
## 1. Code of Conduct
|
|
12
|
+
|
|
13
|
+
Please read and follow our [Code of Conduct](CODE_OF_CONDUCT.md).
|
|
14
|
+
|
|
15
|
+
## 2. Issues
|
|
16
|
+
|
|
17
|
+
Engagement starts with an Issue where conversations and debates can occur around [bugs](#bugs) and [feature requests](#feature-requests):
|
|
18
|
+
|
|
19
|
+
- โ
**Do** search for a similar or existing Issue prior to submitting a new one.
|
|
20
|
+
- โ **Do not** use Issues for personal support. Use [Discussions](https://github.com/capitecbankltd/dsp_north-polrs/discussions) or [StackOverflow](https://stackoverflow.com/) instead.
|
|
21
|
+
- โ **Do not** side-track or derail Issue threads. Stick to the topic, please.
|
|
22
|
+
- โ **Do not** post comments using just "+1", "++" or "๐". Use [Reactions](https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) instead.
|
|
23
|
+
|
|
24
|
+
<h3 id="bugs">๐พ Bugs</h3>
|
|
25
|
+
|
|
26
|
+
- โ
**Do** search for a similar or existing Issue prior to submitting a new one.
|
|
27
|
+
- โ
**Do** describe the bug concisely. **Avoid** adding extraneous code, logs, or screenshots.
|
|
28
|
+
- โ
**Do** attach a minimal test or example to demonstrate the bug.
|
|
29
|
+
|
|
30
|
+
<h3 id="feature-requests">๐ก Feature Requests</h3>
|
|
31
|
+
|
|
32
|
+
- โ
**Do** search for a similar or existing Issue prior to submitting a new one.
|
|
33
|
+
- โ
**Do** provide sufficient motivation and use case(s) for the feature.
|
|
34
|
+
- โ **Do not** submit multiple unrelated requests within one request.
|
|
35
|
+
|
|
36
|
+
> **TIP:** Engage as much as possible within an Issue before proceeding with contributions.
|
|
37
|
+
|
|
38
|
+
## 3. Vulnerabilities
|
|
39
|
+
|
|
40
|
+
- โ
**Do** refer to our [Security Policy](https://github.com/capitecbankltd/dsp_north-polrs/security/policy) for more information.
|
|
41
|
+
- โ
**Do** report vulnerabilities via this [link](https://github.com/capitec/ml-decision-engine/security/advisories/new).
|
|
42
|
+
- โ **Do not** open a public Issue or Discussion for security vulnerabilities.
|
|
43
|
+
|
|
44
|
+
## 4. Development
|
|
45
|
+
|
|
46
|
+
<h3 id="branches">๐ฑ Branches</h3>
|
|
47
|
+
|
|
48
|
+
- `feature/*` โ feature development; PR target is `main`.
|
|
49
|
+
- `main` โ stable branch; tagged releases are cut from here.
|
|
50
|
+
|
|
51
|
+
<h3 id="dependencies">๐ Dependencies</h3>
|
|
52
|
+
|
|
53
|
+
- Python >= 3.10
|
|
54
|
+
- [uv](https://docs.astral.sh/uv/) for environment and dependency management.
|
|
55
|
+
|
|
56
|
+
<h3 id="project-setup">๐ฆ Project Setup</h3>
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# 1. Clone and enter the repo
|
|
60
|
+
git clone https://github.com/capitecbankltd/dsp_north-polrs.git
|
|
61
|
+
cd dsp_north-polrs
|
|
62
|
+
|
|
63
|
+
# 2. Install all dependencies (creates .venv automatically)
|
|
64
|
+
uv sync --all-extras
|
|
65
|
+
|
|
66
|
+
# 3. Run the tests
|
|
67
|
+
uv run pytest
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
If you are behind a corporate proxy that uses a private CA, `uv` is already
|
|
71
|
+
configured to use the system certificate store (`system-certs = true` in
|
|
72
|
+
`pyproject.toml`).
|
|
73
|
+
|
|
74
|
+
<h3 id="directory-structure">๐ Directory Structure</h3>
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
decider/ Core library
|
|
78
|
+
cli/ `decider` CLI (click)
|
|
79
|
+
config/ Versioned config management
|
|
80
|
+
modules/ Module primitives (expression, join, sequential, union)
|
|
81
|
+
serving/ HTTP servers (Starlette, Sanic)
|
|
82
|
+
templates/ Scaffolding templates and scaffold.py renderer
|
|
83
|
+
magics/ Jupyter %%module magic
|
|
84
|
+
docs/examples/ Example notebooks
|
|
85
|
+
projects/ End-to-end project examples
|
|
86
|
+
tests/ pytest suite
|
|
87
|
+
pyproject.toml Project metadata, dependencies, tool config
|
|
88
|
+
uv.lock Locked dependency graph (committed)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
<h3 id="naming-conventions">๐ท Naming Conventions</h3>
|
|
92
|
+
|
|
93
|
+
- โ
**Do** follow PEP 8.
|
|
94
|
+
- โ
**Do** name classes in `CamelCase` and functions/modules in `snake_case`.
|
|
95
|
+
|
|
96
|
+
<h3 id="code-quality">๐ Code Quality</h3>
|
|
97
|
+
|
|
98
|
+
- โ
**Do** adhere to PEP 8 style guidelines.
|
|
99
|
+
- โ
**Do** use `ruff` or `black` for formatting before opening a PR.
|
|
100
|
+
|
|
101
|
+
<h3 id="testing">๐งช Testing</h3>
|
|
102
|
+
|
|
103
|
+
- โ
**Do** write tests under `tests/` using `pytest`.
|
|
104
|
+
- โ
**Do** ensure all tests pass before submitting a Pull Request (`uv run pytest`).
|
|
105
|
+
|
|
106
|
+
## 5. Pull Requests
|
|
107
|
+
|
|
108
|
+
- โ
**Do** ensure your branch is up to date with `main`.
|
|
109
|
+
- โ
**Do** ensure there are no merge conflicts.
|
|
110
|
+
- โ
**Do** make sure all tests pass.
|
|
111
|
+
- โ
**Do** provide a clear description of the changes and their purpose.
|
|
112
|
+
|
|
113
|
+
> **TIP:** Review the existing codebase and follow the conventions used throughout the project.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
Thank you for contributing! We appreciate your efforts to improve the project.
|