dirigent-contrib 0.28.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.
- dirigent_contrib-0.28.0/LICENSE +15 -0
- dirigent_contrib-0.28.0/PKG-INFO +91 -0
- dirigent_contrib-0.28.0/README.md +74 -0
- dirigent_contrib-0.28.0/pyproject.toml +122 -0
- dirigent_contrib-0.28.0/pyproject.toml.orig +93 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/__init__.py +1 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/chap/__init__.py +103 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/chap/alerts.py +240 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/chap/backtests.py +110 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/chap/bodies.py +120 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/chap/configured_models.py +44 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/chap/connection.py +183 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/chap/datasets.py +175 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/chap/jobs.py +155 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/chap/messages.py +83 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/chap/predictions.py +143 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/chap/shelves/chap/README.md +22 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/chap/shelves/chap/chap-backtest.yaml +61 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/chap/shelves/chap/chap-import-dataset-dry-run.yaml +56 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/chap/shelves/chap/chap-models.yaml +42 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/chap/shelves/chap/chap-predict-and-read.yaml +87 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/chap/shelves/chap/chap-thresholds.yaml +54 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/chap/shelves/chap-climate/README.md +9 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/chap/shelves/chap-climate/climate-to-chap-backtest.yaml +135 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/chap/shelves/chap-dhis2/README.md +8 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/chap/shelves/chap-dhis2/chap-predict-alert-review-notify.yaml +187 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/chap/thresholds.py +75 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/chap/web.py +80 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/climate/__init__.py +95 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/climate/aggregate.py +58 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/climate/batch.py +251 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/climate/connection.py +175 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/climate/datasets.py +50 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/climate/exports.py +232 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/climate/graphs.py +99 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/climate/ingestions.py +244 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/climate/messages.py +73 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/climate/payload.py +99 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/climate/shelves/climate/README.md +21 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/climate/shelves/climate/climate-aggregate-to-dhis2.yaml +80 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/climate/shelves/climate/climate-batch-and-export.yaml +95 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/climate/shelves/climate/climate-datasets.yaml +41 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/climate/shelves/climate/climate-ingest.yaml +44 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/climate/shelves/climate/climate-sync.yaml +42 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/climate/shelves/climate-dhis2/README.md +8 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/climate/shelves/climate-dhis2/climate-sync-to-dhis2.yaml +141 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/climate/web.py +80 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/limits.py +145 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/paths.py +20 -0
- dirigent_contrib-0.28.0/src/dirigent_contrib/py.typed +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Copyright (c) 2026 Morten Olav Hansen <morten@winterop.com>. All rights reserved.
|
|
2
|
+
|
|
3
|
+
This source code and accompanying documentation are the property of
|
|
4
|
+
Morten Olav Hansen. No license, express or implied, is granted to use, copy,
|
|
5
|
+
modify, merge, publish, distribute, sublicense, or sell copies of this
|
|
6
|
+
software or its derivatives.
|
|
7
|
+
|
|
8
|
+
The source is published for reference only. Any use beyond reading
|
|
9
|
+
requires written permission from the copyright holder.
|
|
10
|
+
|
|
11
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
12
|
+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
13
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT.
|
|
14
|
+
IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES,
|
|
15
|
+
OR OTHER LIABILITY ARISING FROM THE USE OF THE SOFTWARE.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dirigent-contrib
|
|
3
|
+
Version: 0.28.0
|
|
4
|
+
Summary: Block packs for dirigent that reach outside systems: Chap and the open climate service.
|
|
5
|
+
License-Expression: LicenseRef-Proprietary
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
9
|
+
Requires-Dist: dirigent-common==0.28.0
|
|
10
|
+
Requires-Dist: dirigent-plugin==0.28.0
|
|
11
|
+
Requires-Dist: httpx2>=2.12.0
|
|
12
|
+
Requires-Dist: pydantic>=2.13.5
|
|
13
|
+
Requires-Python: >=3.13
|
|
14
|
+
Project-URL: Documentation, https://winterop-com.github.io/dirigent-contrib/
|
|
15
|
+
Project-URL: Repository, https://github.com/winterop-com/dirigent-contrib
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
|
|
18
|
+
# dirigent-contrib
|
|
19
|
+
|
|
20
|
+
[](https://github.com/winterop-com/dirigent-contrib/actions/workflows/ci.yaml)
|
|
21
|
+
[](https://winterop-com.github.io/dirigent-contrib/)
|
|
22
|
+
|
|
23
|
+
Block packs for [dirigent](https://github.com/winterop-com/dirigent) that reach outside systems,
|
|
24
|
+
all in one package. Installing `dirigent-contrib` is the whole of the configuration: the host
|
|
25
|
+
finds each pack through its entry point.
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
uv tool install dirigent-cli --with dirigent-contrib
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Documentation: <https://winterop-com.github.io/dirigent-contrib/>.
|
|
32
|
+
|
|
33
|
+
## Chap
|
|
34
|
+
|
|
35
|
+
The `chap` connection kind and the blocks that drive one Chap (chap-core) server, in
|
|
36
|
+
`dirigent_contrib.chap`: import observations as a dataset, run a backtest, forecast from a saved
|
|
37
|
+
prediction setup, read the forecast's quantiles, list the configured models, compute the endemic
|
|
38
|
+
channel, and record a forecast's alerts and wait for a person to review them in Chap.
|
|
39
|
+
|
|
40
|
+
| Block | Kind | What it does |
|
|
41
|
+
| --- | --- | --- |
|
|
42
|
+
| `chap.dataset.import` | operator, probed | Validates observations, imports them as a dataset, and waits for the import job. |
|
|
43
|
+
| `chap.backtest.run` | operator, probed | Runs a backtest of a configured model on a stored dataset. |
|
|
44
|
+
| `chap.prediction.run` | operator, probed | Forecasts from a saved prediction setup with fresh observations. |
|
|
45
|
+
| `chap.prediction.read` | operator | Reads a prediction's forecasts at the quantiles asked for. |
|
|
46
|
+
| `chap.models.list` | operator | Lists the server's configured models. |
|
|
47
|
+
| `chap.thresholds` | operator | Computes outbreak thresholds, the endemic channel, for a dataset. |
|
|
48
|
+
| `chap.alerts.record` | operator | Records alerts against a policy, each one waiting for review. |
|
|
49
|
+
| `chap.alerts.reviewed` | sensor | Waits until a prediction's alerts are reviewed, and hands on the approved ones. |
|
|
50
|
+
| `chap.alerts.list` | operator | Reads where alerts stand in the review, once. |
|
|
51
|
+
|
|
52
|
+
## The open climate service
|
|
53
|
+
|
|
54
|
+
The `climate` connection kind and the blocks that drive one instance of the open climate service,
|
|
55
|
+
in `dirigent_contrib.climate`: list its datasets, aggregate one to org units, run a batch job and
|
|
56
|
+
download what it made, deliver a saved export to DHIS2, and ingest or sync a managed dataset.
|
|
57
|
+
|
|
58
|
+
| Block | Kind | What it does |
|
|
59
|
+
| --- | --- | --- |
|
|
60
|
+
| `climate.datasets.list` | operator | Lists the published datasets. |
|
|
61
|
+
| `climate.aggregate` | operator | Runs a process graph synchronously and keeps its payload. |
|
|
62
|
+
| `climate.job.run` | operator, probed | Runs a process graph as an openEO batch job. |
|
|
63
|
+
| `climate.job.result` | operator | Downloads a finished job's payload into the run's storage. |
|
|
64
|
+
| `climate.export` | operator, probed | Delivers a job's saved export through the service's own DHIS2 connection. |
|
|
65
|
+
| `climate.ingest` | operator, probed | Creates or updates a managed dataset. |
|
|
66
|
+
| `climate.sync` | operator, probed | Brings a managed dataset forward from its latest time step. |
|
|
67
|
+
|
|
68
|
+
## Working on it
|
|
69
|
+
|
|
70
|
+
One package, with a subpackage per system under `src/dirigent_contrib/` and its tests under
|
|
71
|
+
`tests/`. The gates CI runs:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
make sync
|
|
75
|
+
make check
|
|
76
|
+
make test
|
|
77
|
+
make docs
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Live checks against a real server only read, and are opt-in:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
DIRIGENT_LIVE=1 uv run pytest -m live
|
|
84
|
+
DIRIGENT_LIVE=1 CHAP_LIVE_URL=http://localhost:8000 uv run pytest -m live
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Licence
|
|
88
|
+
|
|
89
|
+
Copyright (c) 2026 Morten Olav Hansen. All rights reserved. The source is published for
|
|
90
|
+
reference only: no licence to use, copy, modify or distribute it is granted, and any use
|
|
91
|
+
beyond reading requires written permission.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# dirigent-contrib
|
|
2
|
+
|
|
3
|
+
[](https://github.com/winterop-com/dirigent-contrib/actions/workflows/ci.yaml)
|
|
4
|
+
[](https://winterop-com.github.io/dirigent-contrib/)
|
|
5
|
+
|
|
6
|
+
Block packs for [dirigent](https://github.com/winterop-com/dirigent) that reach outside systems,
|
|
7
|
+
all in one package. Installing `dirigent-contrib` is the whole of the configuration: the host
|
|
8
|
+
finds each pack through its entry point.
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
uv tool install dirigent-cli --with dirigent-contrib
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Documentation: <https://winterop-com.github.io/dirigent-contrib/>.
|
|
15
|
+
|
|
16
|
+
## Chap
|
|
17
|
+
|
|
18
|
+
The `chap` connection kind and the blocks that drive one Chap (chap-core) server, in
|
|
19
|
+
`dirigent_contrib.chap`: import observations as a dataset, run a backtest, forecast from a saved
|
|
20
|
+
prediction setup, read the forecast's quantiles, list the configured models, compute the endemic
|
|
21
|
+
channel, and record a forecast's alerts and wait for a person to review them in Chap.
|
|
22
|
+
|
|
23
|
+
| Block | Kind | What it does |
|
|
24
|
+
| --- | --- | --- |
|
|
25
|
+
| `chap.dataset.import` | operator, probed | Validates observations, imports them as a dataset, and waits for the import job. |
|
|
26
|
+
| `chap.backtest.run` | operator, probed | Runs a backtest of a configured model on a stored dataset. |
|
|
27
|
+
| `chap.prediction.run` | operator, probed | Forecasts from a saved prediction setup with fresh observations. |
|
|
28
|
+
| `chap.prediction.read` | operator | Reads a prediction's forecasts at the quantiles asked for. |
|
|
29
|
+
| `chap.models.list` | operator | Lists the server's configured models. |
|
|
30
|
+
| `chap.thresholds` | operator | Computes outbreak thresholds, the endemic channel, for a dataset. |
|
|
31
|
+
| `chap.alerts.record` | operator | Records alerts against a policy, each one waiting for review. |
|
|
32
|
+
| `chap.alerts.reviewed` | sensor | Waits until a prediction's alerts are reviewed, and hands on the approved ones. |
|
|
33
|
+
| `chap.alerts.list` | operator | Reads where alerts stand in the review, once. |
|
|
34
|
+
|
|
35
|
+
## The open climate service
|
|
36
|
+
|
|
37
|
+
The `climate` connection kind and the blocks that drive one instance of the open climate service,
|
|
38
|
+
in `dirigent_contrib.climate`: list its datasets, aggregate one to org units, run a batch job and
|
|
39
|
+
download what it made, deliver a saved export to DHIS2, and ingest or sync a managed dataset.
|
|
40
|
+
|
|
41
|
+
| Block | Kind | What it does |
|
|
42
|
+
| --- | --- | --- |
|
|
43
|
+
| `climate.datasets.list` | operator | Lists the published datasets. |
|
|
44
|
+
| `climate.aggregate` | operator | Runs a process graph synchronously and keeps its payload. |
|
|
45
|
+
| `climate.job.run` | operator, probed | Runs a process graph as an openEO batch job. |
|
|
46
|
+
| `climate.job.result` | operator | Downloads a finished job's payload into the run's storage. |
|
|
47
|
+
| `climate.export` | operator, probed | Delivers a job's saved export through the service's own DHIS2 connection. |
|
|
48
|
+
| `climate.ingest` | operator, probed | Creates or updates a managed dataset. |
|
|
49
|
+
| `climate.sync` | operator, probed | Brings a managed dataset forward from its latest time step. |
|
|
50
|
+
|
|
51
|
+
## Working on it
|
|
52
|
+
|
|
53
|
+
One package, with a subpackage per system under `src/dirigent_contrib/` and its tests under
|
|
54
|
+
`tests/`. The gates CI runs:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
make sync
|
|
58
|
+
make check
|
|
59
|
+
make test
|
|
60
|
+
make docs
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Live checks against a real server only read, and are opt-in:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
DIRIGENT_LIVE=1 uv run pytest -m live
|
|
67
|
+
DIRIGENT_LIVE=1 CHAP_LIVE_URL=http://localhost:8000 uv run pytest -m live
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Licence
|
|
71
|
+
|
|
72
|
+
Copyright (c) 2026 Morten Olav Hansen. All rights reserved. The source is published for
|
|
73
|
+
reference only: no licence to use, copy, modify or distribute it is granted, and any use
|
|
74
|
+
beyond reading requires written permission.
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "dirigent-contrib"
|
|
3
|
+
version = "0.28.0"
|
|
4
|
+
description = "Block packs for dirigent that reach outside systems: Chap and the open climate service."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.13"
|
|
7
|
+
license = "LicenseRef-Proprietary"
|
|
8
|
+
license-files = ["LICENSE"]
|
|
9
|
+
classifiers = [
|
|
10
|
+
"Programming Language :: Python :: 3",
|
|
11
|
+
"Programming Language :: Python :: 3.13",
|
|
12
|
+
]
|
|
13
|
+
dependencies = [
|
|
14
|
+
"dirigent-common==0.28.0",
|
|
15
|
+
"dirigent-plugin==0.28.0",
|
|
16
|
+
"httpx2>=2.12.0",
|
|
17
|
+
"pydantic>=2.13.5",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
[project.urls]
|
|
21
|
+
Documentation = "https://winterop-com.github.io/dirigent-contrib/"
|
|
22
|
+
Repository = "https://github.com/winterop-com/dirigent-contrib"
|
|
23
|
+
|
|
24
|
+
[project.entry-points."dirigent.plugins.v1"]
|
|
25
|
+
chap = "dirigent_contrib.chap:plugin"
|
|
26
|
+
climate = "dirigent_contrib.climate:plugin"
|
|
27
|
+
|
|
28
|
+
[dependency-groups]
|
|
29
|
+
dev = [
|
|
30
|
+
"dirigent-testing==0.28.0",
|
|
31
|
+
"mkdocs>=1.6.1",
|
|
32
|
+
"mkdocs-material>=9.7.7",
|
|
33
|
+
"mypy>=1.19",
|
|
34
|
+
"pymdown-extensions>=11.0.2",
|
|
35
|
+
"pyright>=1.1",
|
|
36
|
+
"pytest>=8",
|
|
37
|
+
"pytest-asyncio>=0.24",
|
|
38
|
+
"pyyaml>=6",
|
|
39
|
+
"ruff>=0.16",
|
|
40
|
+
"types-pyyaml>=6",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
[build-system]
|
|
44
|
+
requires = ["uv_build>=0.12.0,<0.14.0"]
|
|
45
|
+
build-backend = "uv_build"
|
|
46
|
+
|
|
47
|
+
[tool.pytest.ini_options]
|
|
48
|
+
asyncio_mode = "auto"
|
|
49
|
+
asyncio_default_fixture_loop_scope = "function"
|
|
50
|
+
testpaths = ["tests"]
|
|
51
|
+
markers = ["live: reaches a real Chap or open climate service; opt in with DIRIGENT_LIVE=1 and the URLs it names"]
|
|
52
|
+
|
|
53
|
+
[tool.ruff]
|
|
54
|
+
target-version = "py313"
|
|
55
|
+
line-length = 120
|
|
56
|
+
src = [
|
|
57
|
+
"src",
|
|
58
|
+
".",
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
[tool.ruff.lint]
|
|
62
|
+
select = [
|
|
63
|
+
"E",
|
|
64
|
+
"W",
|
|
65
|
+
"F",
|
|
66
|
+
"I",
|
|
67
|
+
"D",
|
|
68
|
+
"SIM",
|
|
69
|
+
"UP",
|
|
70
|
+
"B",
|
|
71
|
+
"TID",
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
[tool.ruff.lint.per-file-ignores]
|
|
75
|
+
"tests/**" = [
|
|
76
|
+
"D103",
|
|
77
|
+
"D100",
|
|
78
|
+
"D101",
|
|
79
|
+
"D102",
|
|
80
|
+
"D104",
|
|
81
|
+
]
|
|
82
|
+
|
|
83
|
+
[tool.ruff.lint.pydocstyle]
|
|
84
|
+
convention = "google"
|
|
85
|
+
|
|
86
|
+
[tool.ruff.lint.isort]
|
|
87
|
+
known-first-party = [
|
|
88
|
+
"dirigent_common",
|
|
89
|
+
"dirigent_contrib",
|
|
90
|
+
"dirigent_plugin",
|
|
91
|
+
"dirigent_testing",
|
|
92
|
+
"tests",
|
|
93
|
+
]
|
|
94
|
+
|
|
95
|
+
[tool.ruff.format]
|
|
96
|
+
quote-style = "double"
|
|
97
|
+
docstring-code-format = true
|
|
98
|
+
|
|
99
|
+
[tool.mypy]
|
|
100
|
+
python_version = "3.13"
|
|
101
|
+
disallow_untyped_defs = true
|
|
102
|
+
warn_return_any = true
|
|
103
|
+
warn_unused_configs = true
|
|
104
|
+
warn_redundant_casts = true
|
|
105
|
+
warn_unused_ignores = true
|
|
106
|
+
no_implicit_optional = true
|
|
107
|
+
strict_equality = true
|
|
108
|
+
plugins = ["pydantic.mypy"]
|
|
109
|
+
files = [
|
|
110
|
+
"src",
|
|
111
|
+
"tests",
|
|
112
|
+
]
|
|
113
|
+
mypy_path = ["src"]
|
|
114
|
+
|
|
115
|
+
[tool.pyright]
|
|
116
|
+
pythonVersion = "3.13"
|
|
117
|
+
typeCheckingMode = "strict"
|
|
118
|
+
include = [
|
|
119
|
+
"src",
|
|
120
|
+
"tests",
|
|
121
|
+
]
|
|
122
|
+
reportMissingTypeStubs = false
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "dirigent-contrib"
|
|
3
|
+
version = "0.28.0"
|
|
4
|
+
description = "Block packs for dirigent that reach outside systems: Chap and the open climate service."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.13"
|
|
7
|
+
license = "LicenseRef-Proprietary"
|
|
8
|
+
license-files = ["LICENSE"]
|
|
9
|
+
classifiers = [
|
|
10
|
+
"Programming Language :: Python :: 3",
|
|
11
|
+
"Programming Language :: Python :: 3.13",
|
|
12
|
+
]
|
|
13
|
+
dependencies = [
|
|
14
|
+
"dirigent-common==0.28.0",
|
|
15
|
+
"dirigent-plugin==0.28.0",
|
|
16
|
+
"httpx2>=2.12.0",
|
|
17
|
+
"pydantic>=2.13.5",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
[project.urls]
|
|
21
|
+
Documentation = "https://winterop-com.github.io/dirigent-contrib/"
|
|
22
|
+
Repository = "https://github.com/winterop-com/dirigent-contrib"
|
|
23
|
+
|
|
24
|
+
[project.entry-points."dirigent.plugins.v1"]
|
|
25
|
+
chap = "dirigent_contrib.chap:plugin"
|
|
26
|
+
climate = "dirigent_contrib.climate:plugin"
|
|
27
|
+
|
|
28
|
+
[dependency-groups]
|
|
29
|
+
dev = [
|
|
30
|
+
"dirigent-testing==0.28.0",
|
|
31
|
+
"mkdocs>=1.6.1",
|
|
32
|
+
"mkdocs-material>=9.7.7",
|
|
33
|
+
"mypy>=1.19",
|
|
34
|
+
"pymdown-extensions>=11.0.2",
|
|
35
|
+
"pyright>=1.1",
|
|
36
|
+
"pytest>=8",
|
|
37
|
+
"pytest-asyncio>=0.24",
|
|
38
|
+
"pyyaml>=6",
|
|
39
|
+
"ruff>=0.16",
|
|
40
|
+
"types-pyyaml>=6",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
[build-system]
|
|
44
|
+
requires = ["uv_build>=0.12.0,<0.14.0"]
|
|
45
|
+
build-backend = "uv_build"
|
|
46
|
+
|
|
47
|
+
[tool.pytest.ini_options]
|
|
48
|
+
asyncio_mode = "auto"
|
|
49
|
+
asyncio_default_fixture_loop_scope = "function"
|
|
50
|
+
testpaths = ["tests"]
|
|
51
|
+
markers = [
|
|
52
|
+
"live: reaches a real Chap or open climate service; opt in with DIRIGENT_LIVE=1 and the URLs it names",
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
[tool.ruff]
|
|
56
|
+
target-version = "py313"
|
|
57
|
+
line-length = 120
|
|
58
|
+
src = ["src", "."]
|
|
59
|
+
|
|
60
|
+
[tool.ruff.lint]
|
|
61
|
+
select = ["E", "W", "F", "I", "D", "SIM", "UP", "B", "TID"]
|
|
62
|
+
|
|
63
|
+
[tool.ruff.lint.per-file-ignores]
|
|
64
|
+
"tests/**" = ["D103", "D100", "D101", "D102", "D104"]
|
|
65
|
+
|
|
66
|
+
[tool.ruff.lint.pydocstyle]
|
|
67
|
+
convention = "google"
|
|
68
|
+
|
|
69
|
+
[tool.ruff.lint.isort]
|
|
70
|
+
known-first-party = ["dirigent_common", "dirigent_contrib", "dirigent_plugin", "dirigent_testing", "tests"]
|
|
71
|
+
|
|
72
|
+
[tool.ruff.format]
|
|
73
|
+
quote-style = "double"
|
|
74
|
+
docstring-code-format = true
|
|
75
|
+
|
|
76
|
+
[tool.mypy]
|
|
77
|
+
python_version = "3.13"
|
|
78
|
+
disallow_untyped_defs = true
|
|
79
|
+
warn_return_any = true
|
|
80
|
+
warn_unused_configs = true
|
|
81
|
+
warn_redundant_casts = true
|
|
82
|
+
warn_unused_ignores = true
|
|
83
|
+
no_implicit_optional = true
|
|
84
|
+
strict_equality = true
|
|
85
|
+
plugins = ["pydantic.mypy"]
|
|
86
|
+
files = ["src", "tests"]
|
|
87
|
+
mypy_path = ["src"]
|
|
88
|
+
|
|
89
|
+
[tool.pyright]
|
|
90
|
+
pythonVersion = "3.13"
|
|
91
|
+
typeCheckingMode = "strict"
|
|
92
|
+
include = ["src", "tests"]
|
|
93
|
+
reportMissingTypeStubs = false
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Block packs for dirigent that reach outside systems, each a subpackage with an entry point of its own."""
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"""The Chap pack: the ``chap`` connection kind and the blocks for one Chap server."""
|
|
2
|
+
|
|
3
|
+
from collections.abc import Sequence
|
|
4
|
+
from importlib.resources import files
|
|
5
|
+
from importlib.resources.abc import Traversable
|
|
6
|
+
|
|
7
|
+
from dirigent_contrib.chap.alerts import (
|
|
8
|
+
ChapAlertCounts,
|
|
9
|
+
ChapAlertsListConfig,
|
|
10
|
+
ChapAlertsListOperator,
|
|
11
|
+
ChapAlertsOutput,
|
|
12
|
+
ChapAlertsRecordConfig,
|
|
13
|
+
ChapAlertsRecordOperator,
|
|
14
|
+
ChapAlertsRecordOutput,
|
|
15
|
+
ChapAlertsReviewedConfig,
|
|
16
|
+
ChapAlertsReviewedSensor,
|
|
17
|
+
)
|
|
18
|
+
from dirigent_contrib.chap.backtests import ChapBacktestRunConfig, ChapBacktestRunOperator, ChapBacktestRunOutput
|
|
19
|
+
from dirigent_contrib.chap.configured_models import ChapModelsListConfig, ChapModelsListOperator, ChapModelsListOutput
|
|
20
|
+
from dirigent_contrib.chap.connection import ChapConnectionConfig, ChapConnectionKind, build_client, client_for
|
|
21
|
+
from dirigent_contrib.chap.datasets import ChapDatasetImportConfig, ChapDatasetImportOperator, ChapDatasetImportOutput
|
|
22
|
+
from dirigent_contrib.chap.messages import CHAP
|
|
23
|
+
from dirigent_contrib.chap.predictions import (
|
|
24
|
+
ChapPredictionReadConfig,
|
|
25
|
+
ChapPredictionReadOperator,
|
|
26
|
+
ChapPredictionReadOutput,
|
|
27
|
+
ChapPredictionRunConfig,
|
|
28
|
+
ChapPredictionRunOperator,
|
|
29
|
+
ChapPredictionRunOutput,
|
|
30
|
+
)
|
|
31
|
+
from dirigent_contrib.chap.thresholds import ChapThresholdsConfig, ChapThresholdsOperator, ChapThresholdsOutput
|
|
32
|
+
from dirigent_plugin import Contribution, extension
|
|
33
|
+
|
|
34
|
+
#: The directory the pack's example shelves live in, inside this distribution.
|
|
35
|
+
SHELVES_DIRECTORY = "shelves"
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class ChapPlugin:
|
|
39
|
+
"""The plugin object the host discovers under the dirigent.plugins.v1 entry-point group."""
|
|
40
|
+
|
|
41
|
+
@extension
|
|
42
|
+
def contribute(self) -> Contribution:
|
|
43
|
+
"""Contribute the Chap blocks and the ``chap`` connection kind they are configured from."""
|
|
44
|
+
return Contribution(
|
|
45
|
+
operators=[
|
|
46
|
+
ChapDatasetImportOperator(),
|
|
47
|
+
ChapBacktestRunOperator(),
|
|
48
|
+
ChapPredictionRunOperator(),
|
|
49
|
+
ChapPredictionReadOperator(),
|
|
50
|
+
ChapModelsListOperator(),
|
|
51
|
+
ChapThresholdsOperator(),
|
|
52
|
+
ChapAlertsRecordOperator(),
|
|
53
|
+
ChapAlertsListOperator(),
|
|
54
|
+
],
|
|
55
|
+
sensors=[ChapAlertsReviewedSensor()],
|
|
56
|
+
connection_kinds=[ChapConnectionKind()],
|
|
57
|
+
labels=[CHAP],
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
@extension
|
|
61
|
+
def examples(self) -> Sequence[Traversable]:
|
|
62
|
+
"""Contribute the example shelves this distribution carries."""
|
|
63
|
+
return [files(__package__ or "dirigent_contrib.chap") / SHELVES_DIRECTORY]
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
plugin = ChapPlugin()
|
|
67
|
+
|
|
68
|
+
__all__ = [
|
|
69
|
+
"SHELVES_DIRECTORY",
|
|
70
|
+
"ChapAlertCounts",
|
|
71
|
+
"ChapAlertsListConfig",
|
|
72
|
+
"ChapAlertsListOperator",
|
|
73
|
+
"ChapAlertsOutput",
|
|
74
|
+
"ChapAlertsRecordConfig",
|
|
75
|
+
"ChapAlertsRecordOperator",
|
|
76
|
+
"ChapAlertsRecordOutput",
|
|
77
|
+
"ChapAlertsReviewedConfig",
|
|
78
|
+
"ChapAlertsReviewedSensor",
|
|
79
|
+
"ChapBacktestRunConfig",
|
|
80
|
+
"ChapBacktestRunOperator",
|
|
81
|
+
"ChapBacktestRunOutput",
|
|
82
|
+
"ChapConnectionConfig",
|
|
83
|
+
"ChapConnectionKind",
|
|
84
|
+
"ChapDatasetImportConfig",
|
|
85
|
+
"ChapDatasetImportOperator",
|
|
86
|
+
"ChapDatasetImportOutput",
|
|
87
|
+
"ChapModelsListConfig",
|
|
88
|
+
"ChapModelsListOperator",
|
|
89
|
+
"ChapModelsListOutput",
|
|
90
|
+
"ChapPlugin",
|
|
91
|
+
"ChapPredictionReadConfig",
|
|
92
|
+
"ChapPredictionReadOperator",
|
|
93
|
+
"ChapPredictionReadOutput",
|
|
94
|
+
"ChapPredictionRunConfig",
|
|
95
|
+
"ChapPredictionRunOperator",
|
|
96
|
+
"ChapPredictionRunOutput",
|
|
97
|
+
"ChapThresholdsConfig",
|
|
98
|
+
"ChapThresholdsOperator",
|
|
99
|
+
"ChapThresholdsOutput",
|
|
100
|
+
"build_client",
|
|
101
|
+
"client_for",
|
|
102
|
+
"plugin",
|
|
103
|
+
]
|