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.
Files changed (154) hide show
  1. decider-0.0.1/.dockerignore +25 -0
  2. decider-0.0.1/.gitattributes +5 -0
  3. decider-0.0.1/.github/workflows/pr.yml +31 -0
  4. decider-0.0.1/.github/workflows/release.yml +220 -0
  5. decider-0.0.1/.gitignore +180 -0
  6. decider-0.0.1/CODE_OF_CONDUCT.md +128 -0
  7. decider-0.0.1/CONTRIBUTING.md +117 -0
  8. decider-0.0.1/LICENSE +21 -0
  9. decider-0.0.1/PKG-INFO +268 -0
  10. decider-0.0.1/README.md +218 -0
  11. decider-0.0.1/SECURITY.md +19 -0
  12. decider-0.0.1/Tasks.md +15 -0
  13. decider-0.0.1/decider/__init__.py +7 -0
  14. decider-0.0.1/decider/_ext.py +106 -0
  15. decider-0.0.1/decider/cli/__init__.py +15 -0
  16. decider-0.0.1/decider/cli/_graph.py +310 -0
  17. decider-0.0.1/decider/cli/_visualise_app.py +236 -0
  18. decider-0.0.1/decider/cli/serve.py +92 -0
  19. decider-0.0.1/decider/cli/template.py +86 -0
  20. decider-0.0.1/decider/cli/visualise.py +92 -0
  21. decider-0.0.1/decider/config/__init__.py +22 -0
  22. decider-0.0.1/decider/config/_ext.py +17 -0
  23. decider-0.0.1/decider/config/_ext.pyi +16 -0
  24. decider-0.0.1/decider/config/base.py +113 -0
  25. decider-0.0.1/decider/config/core.py +156 -0
  26. decider-0.0.1/decider/config/file.py +189 -0
  27. decider-0.0.1/decider/config/versioned.py +57 -0
  28. decider-0.0.1/decider/exceptions.py +113 -0
  29. decider-0.0.1/decider/executor.py +146 -0
  30. decider-0.0.1/decider/graphutil.py +40 -0
  31. decider-0.0.1/decider/initialization.py +52 -0
  32. decider-0.0.1/decider/magics/__init__.py +162 -0
  33. decider-0.0.1/decider/modules/__init__.py +22 -0
  34. decider-0.0.1/decider/modules/_ext.py +15 -0
  35. decider-0.0.1/decider/modules/_ext.pyi +16 -0
  36. decider-0.0.1/decider/modules/core.py +92 -0
  37. decider-0.0.1/decider/modules/credit/__init__.py +24 -0
  38. decider-0.0.1/decider/modules/credit/decision_table/__init__.py +27 -0
  39. decider-0.0.1/decider/modules/credit/decision_table/config.py +290 -0
  40. decider-0.0.1/decider/modules/credit/decision_table/impl.py +66 -0
  41. decider-0.0.1/decider/modules/credit/decision_table/module.py +71 -0
  42. decider-0.0.1/decider/modules/credit/scorecard/__init__.py +42 -0
  43. decider-0.0.1/decider/modules/credit/scorecard/impl.py +312 -0
  44. decider-0.0.1/decider/modules/credit/scorecard/module.py +359 -0
  45. decider-0.0.1/decider/modules/expression.py +245 -0
  46. decider-0.0.1/decider/modules/functional.py +202 -0
  47. decider-0.0.1/decider/modules/primitives/__init__.py +5 -0
  48. decider-0.0.1/decider/modules/primitives/join.py +90 -0
  49. decider-0.0.1/decider/modules/primitives/sequential.py +105 -0
  50. decider-0.0.1/decider/modules/primitives/union.py +22 -0
  51. decider-0.0.1/decider/modules/rules/__init__.py +162 -0
  52. decider-0.0.1/decider/modules/rules/common/__init__.py +0 -0
  53. decider-0.0.1/decider/modules/rules/common/feature.py +128 -0
  54. decider-0.0.1/decider/modules/rules/common/nodes/__init__.py +82 -0
  55. decider-0.0.1/decider/modules/rules/common/nodes/cases.py +208 -0
  56. decider-0.0.1/decider/modules/rules/common/nodes/composite.py +40 -0
  57. decider-0.0.1/decider/modules/rules/common/nodes/conditions.py +301 -0
  58. decider-0.0.1/decider/modules/rules/common/nodes/operators.py +323 -0
  59. decider-0.0.1/decider/modules/rules/common/nodes/unary.py +25 -0
  60. decider-0.0.1/decider/modules/rules/common/nodetypes.py +128 -0
  61. decider-0.0.1/decider/modules/rules/common/parameters.py +143 -0
  62. decider-0.0.1/decider/modules/rules/common/shared.py +184 -0
  63. decider-0.0.1/decider/modules/rules/flat_rules/__init__.py +0 -0
  64. decider-0.0.1/decider/modules/rules/flat_rules/impl.py +542 -0
  65. decider-0.0.1/decider/modules/rules/flat_rules/module.py +287 -0
  66. decider-0.0.1/decider/modules/rules/flat_rules/nodes.py +582 -0
  67. decider-0.0.1/decider/modules/rules/modules.py +61 -0
  68. decider-0.0.1/decider/modules/rules/tree/__init__.py +31 -0
  69. decider-0.0.1/decider/modules/rules/tree/tree.py +117 -0
  70. decider-0.0.1/decider/modules/rules/tree/v1/__init__.py +0 -0
  71. decider-0.0.1/decider/modules/rules/tree/v1/edges.py +37 -0
  72. decider-0.0.1/decider/modules/rules/tree/v1/nodes.py +122 -0
  73. decider-0.0.1/decider/modules/rules/tree/v1/schema.py +383 -0
  74. decider-0.0.1/decider/modules/rules/tree/v1/tree.py +586 -0
  75. decider-0.0.1/decider/modules/rules/tree/v1/variables.py +71 -0
  76. decider-0.0.1/decider/modules/rules/tree/v2/__init__.py +0 -0
  77. decider-0.0.1/decider/modules/rules/tree/v2/nodes.py +230 -0
  78. decider-0.0.1/decider/modules/rules/tree/v2/tree.py +113 -0
  79. decider-0.0.1/decider/modules/rules/tree/v3/__init__.py +94 -0
  80. decider-0.0.1/decider/modules/rules/tree/v3/nodes_ui.py +307 -0
  81. decider-0.0.1/decider/modules/rules/tree/v3/tree.py +177 -0
  82. decider-0.0.1/decider/modules/util.py +88 -0
  83. decider-0.0.1/decider/serializable/__init__.py +0 -0
  84. decider-0.0.1/decider/serializable/dataframe.py +61 -0
  85. decider-0.0.1/decider/serializable/dtypes.py +148 -0
  86. decider-0.0.1/decider/serializable/function.py +24 -0
  87. decider-0.0.1/decider/serializable/schema.py +368 -0
  88. decider-0.0.1/decider/serving/__init__.py +0 -0
  89. decider-0.0.1/decider/serving/format.py +47 -0
  90. decider-0.0.1/decider/serving/handler.py +113 -0
  91. decider-0.0.1/decider/serving/media_types.py +11 -0
  92. decider-0.0.1/decider/serving/parse.py +49 -0
  93. decider-0.0.1/decider/serving/servers/__init__.py +0 -0
  94. decider-0.0.1/decider/serving/servers/core.py +19 -0
  95. decider-0.0.1/decider/serving/servers/sanic.py +56 -0
  96. decider-0.0.1/decider/serving/servers/starlette.py +68 -0
  97. decider-0.0.1/decider/settings.py +93 -0
  98. decider-0.0.1/decider/templates/__init__.py +3 -0
  99. decider-0.0.1/decider/templates/scaffold.py +154 -0
  100. decider-0.0.1/decider/templates/static/extension_module.py +13 -0
  101. decider-0.0.1/decider/templates/static/extension_package/module.py +13 -0
  102. decider-0.0.1/decider/templates/static/extension_package/pyproject.toml +19 -0
  103. decider-0.0.1/decider/templates/static/project/generate.py +65 -0
  104. decider-0.0.1/decider/templates/static/project/speedtest.py +66 -0
  105. decider-0.0.1/decider/types.py +6 -0
  106. decider-0.0.1/docker/Dockerfile +56 -0
  107. decider-0.0.1/docs/Makefile +12 -0
  108. decider-0.0.1/docs/_templates/custom-class-template.rst +34 -0
  109. decider-0.0.1/docs/_templates/custom-module-template.rst +66 -0
  110. decider-0.0.1/docs/api.rst +8 -0
  111. decider-0.0.1/docs/concepts/config.md +51 -0
  112. decider-0.0.1/docs/concepts/extensions.md +67 -0
  113. decider-0.0.1/docs/concepts/index.md +12 -0
  114. decider-0.0.1/docs/concepts/modules.md +54 -0
  115. decider-0.0.1/docs/concepts/pipelines.md +48 -0
  116. decider-0.0.1/docs/conf.py +62 -0
  117. decider-0.0.1/docs/contributing/index.md +4 -0
  118. decider-0.0.1/docs/examples/01_getting_started.ipynb +204 -0
  119. decider-0.0.1/docs/examples/02_pipelines_and_joins.ipynb +260 -0
  120. decider-0.0.1/docs/examples/03_config_and_persistence.ipynb +227 -0
  121. decider-0.0.1/docs/examples/projects/01_loan_scoring.ipynb +229 -0
  122. decider-0.0.1/docs/examples/projects/02_fraud_detection.ipynb +215 -0
  123. decider-0.0.1/docs/examples/projects/03_affordability_check.ipynb +239 -0
  124. decider-0.0.1/docs/examples/projects/04_multi_bureau_pipeline.ipynb +239 -0
  125. decider-0.0.1/docs/examples/projects/05_notebook_to_serving/.gitignore +2 -0
  126. decider-0.0.1/docs/examples/projects/05_notebook_to_serving/05_notebook_to_serving.ipynb +414 -0
  127. decider-0.0.1/docs/getting_started/index.md +9 -0
  128. decider-0.0.1/docs/getting_started/install.md +46 -0
  129. decider-0.0.1/docs/getting_started/quick_start.md +24 -0
  130. decider-0.0.1/docs/index.rst +11 -0
  131. decider-0.0.1/docs/main.md +32 -0
  132. decider-0.0.1/docs/robots.txt +2 -0
  133. decider-0.0.1/projects/loan_scoring/decider_extensions/loan_scoring/__init__.py +40 -0
  134. decider-0.0.1/projects/loan_scoring/generate.py +133 -0
  135. decider-0.0.1/projects/loan_scoring/notebook.ipynb +297 -0
  136. decider-0.0.1/projects/loan_scoring/speedtest.py +83 -0
  137. decider-0.0.1/pyproject.toml +84 -0
  138. decider-0.0.1/tests/__init__.py +0 -0
  139. decider-0.0.1/tests/conftest.py +6 -0
  140. decider-0.0.1/tests/credit/__init__.py +0 -0
  141. decider-0.0.1/tests/credit/decision_table/__init__.py +0 -0
  142. decider-0.0.1/tests/credit/decision_table/test_decision_table.py +147 -0
  143. decider-0.0.1/tests/credit/scorecard/__init__.py +0 -0
  144. decider-0.0.1/tests/credit/scorecard/test_scorecard.py +146 -0
  145. decider-0.0.1/tests/rules/__init__.py +0 -0
  146. decider-0.0.1/tests/rules/test_conditions.py +551 -0
  147. decider-0.0.1/tests/rules/test_parameters.py +177 -0
  148. decider-0.0.1/tests/rules/test_tree_end_to_end.py +772 -0
  149. decider-0.0.1/tests/rules/test_tree_migration.py +197 -0
  150. decider-0.0.1/tests/test_config_roundtrip.py +113 -0
  151. decider-0.0.1/tests/test_expression_module.py +144 -0
  152. decider-0.0.1/tests/test_graph_module_registry.py +69 -0
  153. decider-0.0.1/tests/test_sequential_and_join.py +140 -0
  154. 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,5 @@
1
+ # Ensure consistent line endings
2
+ * text=auto
3
+
4
+ # Mark generated version file so it survives `git archive --export-subst`
5
+ decider/_version.py export-subst
@@ -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/*
@@ -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.