validibot-shared 0.1.0__py3-none-any.whl
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.
- validibot_shared/__init__.py +16 -0
- validibot_shared/energyplus/__init__.py +25 -0
- validibot_shared/energyplus/envelopes.py +300 -0
- validibot_shared/energyplus/models.py +140 -0
- validibot_shared/fmi/__init__.py +6 -0
- validibot_shared/fmi/envelopes.py +190 -0
- validibot_shared/fmi/models.py +70 -0
- validibot_shared/py.typed +0 -0
- validibot_shared/validations/__init__.py +0 -0
- validibot_shared/validations/envelopes.py +607 -0
- validibot_shared-0.1.0.dist-info/METADATA +168 -0
- validibot_shared-0.1.0.dist-info/RECORD +15 -0
- validibot_shared-0.1.0.dist-info/WHEEL +4 -0
- validibot_shared-0.1.0.dist-info/licenses/LICENSE +21 -0
- validibot_shared-0.1.0.dist-info/licenses/NOTICE +23 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: validibot-shared
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Shared library for data interchange between Validibot and validator containers
|
|
5
|
+
Project-URL: Homepage, https://validibot.com
|
|
6
|
+
Project-URL: Documentation, https://docs.validibot.com
|
|
7
|
+
Project-URL: Repository, https://github.com/danielmcquillen/validibot-shared
|
|
8
|
+
Project-URL: Issues, https://github.com/danielmcquillen/validibot-shared/issues
|
|
9
|
+
Author-email: Daniel McQuillen <daniel@validibot.com>
|
|
10
|
+
Maintainer-email: Daniel McQuillen <daniel@validibot.com>
|
|
11
|
+
License: MIT
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
License-File: NOTICE
|
|
14
|
+
Keywords: data-interchange,energyplus,fmu,simulation,validation,validibot
|
|
15
|
+
Classifier: Development Status :: 4 - Beta
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Topic :: Scientific/Engineering
|
|
25
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
26
|
+
Requires-Python: >=3.10
|
|
27
|
+
Requires-Dist: pydantic>=2.8.0
|
|
28
|
+
Provides-Extra: dev
|
|
29
|
+
Requires-Dist: pytest>=8.3.0; extra == 'dev'
|
|
30
|
+
Requires-Dist: ruff>=0.8.0; extra == 'dev'
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
|
|
33
|
+
# validibot-shared
|
|
34
|
+
|
|
35
|
+
Shared Pydantic models for [Validibot](https://validibot.com) validator containers.
|
|
36
|
+
|
|
37
|
+
This library defines the data interchange types used between Validibot and its advanced validator services, ensuring type safety and contract consistency.
|
|
38
|
+
|
|
39
|
+
## Installation
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pip install validibot-shared
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Or with uv:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
uv add validibot-shared
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Package Structure
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
validibot_shared/
|
|
55
|
+
├── validations/ # Base validation envelope schemas
|
|
56
|
+
│ └── envelopes.py # Input/output envelopes for all validators
|
|
57
|
+
├── energyplus/ # EnergyPlus-specific models and envelopes
|
|
58
|
+
│ ├── models.py # Simulation output models
|
|
59
|
+
│ └── envelopes.py # Typed envelope subclasses
|
|
60
|
+
└── fmi/ # FMI/FMU-specific models
|
|
61
|
+
├── models.py # Probe result models
|
|
62
|
+
└── envelopes.py # FMI envelope subclasses
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Core Concepts
|
|
66
|
+
|
|
67
|
+
### Validation Envelopes
|
|
68
|
+
|
|
69
|
+
The library provides base envelope classes for validator communication:
|
|
70
|
+
|
|
71
|
+
- `ValidationInputEnvelope` - Standard input format for validation jobs
|
|
72
|
+
- `ValidationOutputEnvelope` - Standard output format with results
|
|
73
|
+
- `ValidationCallback` - Callback payload for async job completion
|
|
74
|
+
|
|
75
|
+
Supporting classes include `InputFileItem`, `ValidatorInfo`, `ExecutionContext`, `ValidationMessage`, `ValidationMetric`, and `ValidationArtifact`.
|
|
76
|
+
|
|
77
|
+
### Typed Subclassing Pattern
|
|
78
|
+
|
|
79
|
+
Domain-specific validators extend the base envelopes with typed fields:
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
from validibot_shared.energyplus import EnergyPlusInputEnvelope, EnergyPlusInputs
|
|
83
|
+
|
|
84
|
+
# The envelope has typed inputs instead of dict[str, Any]
|
|
85
|
+
envelope = EnergyPlusInputEnvelope(
|
|
86
|
+
run_id="abc-123",
|
|
87
|
+
inputs=EnergyPlusInputs(timestep_per_hour=4),
|
|
88
|
+
# ... other fields
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
# IDE autocomplete and type checking work
|
|
92
|
+
timestep = envelope.inputs.timestep_per_hour
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
This provides:
|
|
96
|
+
|
|
97
|
+
- **Type safety** - mypy/pyright catch errors at compile time
|
|
98
|
+
- **Runtime validation** - Pydantic validates all data
|
|
99
|
+
- **IDE support** - Full autocomplete for domain-specific fields
|
|
100
|
+
|
|
101
|
+
## Usage Examples
|
|
102
|
+
|
|
103
|
+
### Creating an Input Envelope
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
from validibot_shared.energyplus import EnergyPlusInputEnvelope, EnergyPlusInputs
|
|
107
|
+
from validibot_shared.validations.envelopes import (
|
|
108
|
+
InputFileItem,
|
|
109
|
+
ValidatorInfo,
|
|
110
|
+
ExecutionContext,
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
envelope = EnergyPlusInputEnvelope(
|
|
114
|
+
run_id="run-123",
|
|
115
|
+
validator=ValidatorInfo(id="v1", type="energyplus", version="24.2.0"),
|
|
116
|
+
input_files=[
|
|
117
|
+
InputFileItem(
|
|
118
|
+
name="model.idf",
|
|
119
|
+
mime_type="application/vnd.energyplus.idf",
|
|
120
|
+
role="primary-model",
|
|
121
|
+
uri="gs://bucket/model.idf",
|
|
122
|
+
),
|
|
123
|
+
],
|
|
124
|
+
inputs=EnergyPlusInputs(timestep_per_hour=4),
|
|
125
|
+
context=ExecutionContext(
|
|
126
|
+
callback_url="https://api.example.com/callback",
|
|
127
|
+
execution_bundle_uri="gs://bucket/run-123/",
|
|
128
|
+
),
|
|
129
|
+
)
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Deserializing Results
|
|
133
|
+
|
|
134
|
+
```python
|
|
135
|
+
from validibot_shared.energyplus import EnergyPlusOutputEnvelope
|
|
136
|
+
|
|
137
|
+
# Parse JSON response from validator
|
|
138
|
+
envelope = EnergyPlusOutputEnvelope.model_validate_json(response_json)
|
|
139
|
+
|
|
140
|
+
# Access typed outputs
|
|
141
|
+
if envelope.outputs:
|
|
142
|
+
print(f"EUI: {envelope.outputs.metrics.eui_kbtu_per_sqft}")
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### FMI Probe Results
|
|
146
|
+
|
|
147
|
+
```python
|
|
148
|
+
from validibot_shared.fmi.models import FMIProbeResult, FMIVariableMeta
|
|
149
|
+
|
|
150
|
+
# Create a successful probe result
|
|
151
|
+
result = FMIProbeResult.success(
|
|
152
|
+
variables=[
|
|
153
|
+
FMIVariableMeta(name="temperature", causality="output", value_type="Real"),
|
|
154
|
+
],
|
|
155
|
+
execution_seconds=0.5,
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
# Create a failure result
|
|
159
|
+
result = FMIProbeResult.failure(errors=["Invalid FMU: missing modelDescription.xml"])
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Dependencies
|
|
163
|
+
|
|
164
|
+
- `pydantic>=2.8.0`
|
|
165
|
+
|
|
166
|
+
## License
|
|
167
|
+
|
|
168
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
validibot_shared/__init__.py,sha256=ZecaJniQW7349MWfs6RZGWQwSRAnxZuXkidc-j3xp_8,447
|
|
2
|
+
validibot_shared/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
validibot_shared/energyplus/__init__.py,sha256=PbrCDa9WEoky5_L6iqtlBHE2B1OYBGeTl3tTQu5YZSM,652
|
|
4
|
+
validibot_shared/energyplus/envelopes.py,sha256=GreSRPiZzlJyDsUZfYqNWN-VbHzzLTEPEL4rkH11-I4,10629
|
|
5
|
+
validibot_shared/energyplus/models.py,sha256=gAtJL6WJ9gNS1tM5tZu39kPi7PZDVEl0AWdfDRVjWb8,4713
|
|
6
|
+
validibot_shared/fmi/__init__.py,sha256=ezn5KmwtCph5w0sZRHtZ_Odx-pseuLp_RLUf1lfnuK8,132
|
|
7
|
+
validibot_shared/fmi/envelopes.py,sha256=H0HvGzZu11mHLZ8FW1hBlFf4RQUfkzolay63MCFbC1k,5468
|
|
8
|
+
validibot_shared/fmi/models.py,sha256=iHYE_HtOGPtb77MJ8KTS4MuSBL5QA7h8FWxFAuy3Btg,1840
|
|
9
|
+
validibot_shared/validations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
+
validibot_shared/validations/envelopes.py,sha256=QvLXHxYJniBxn3N3QUNfdUZoGrckeyBh6AvirE2F_0g,20006
|
|
11
|
+
validibot_shared-0.1.0.dist-info/METADATA,sha256=8w_Koeuw2k6swbsdfqCk6LqxY4_noJr-8YGMq0XuIhs,5152
|
|
12
|
+
validibot_shared-0.1.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
13
|
+
validibot_shared-0.1.0.dist-info/licenses/LICENSE,sha256=T123ZvRRmFe8WtQNa7b2TELu87bW4BZ-k9enaH-5u-k,1093
|
|
14
|
+
validibot_shared-0.1.0.dist-info/licenses/NOTICE,sha256=gR4UbHXacA-Uey1tOAA0LsLC9Ca5UL-QK3oLT5fY-4k,782
|
|
15
|
+
validibot_shared-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-2026 McQuillen Interactive Pty. Ltd.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Validibot Shared Library
|
|
2
|
+
Copyright (c) 2024-2026 McQuillen Interactive Pty. Ltd.
|
|
3
|
+
|
|
4
|
+
This product is licensed under the MIT License.
|
|
5
|
+
See the LICENSE file for the full license text.
|
|
6
|
+
|
|
7
|
+
TRADEMARKS
|
|
8
|
+
|
|
9
|
+
"Validibot", the Validibot logo, and the Validibot robot character are
|
|
10
|
+
trademarks of McQuillen Interactive Pty. Ltd. The MIT license grants rights
|
|
11
|
+
to the source code only, not to the trademarks.
|
|
12
|
+
|
|
13
|
+
You may use the Validibot name to accurately describe that your software
|
|
14
|
+
uses or integrates with Validibot, but not in a way that suggests official
|
|
15
|
+
endorsement or affiliation beyond that relationship.
|
|
16
|
+
|
|
17
|
+
THIRD-PARTY COMPONENTS
|
|
18
|
+
|
|
19
|
+
This software includes the following third-party components:
|
|
20
|
+
|
|
21
|
+
- Pydantic (MIT License) - https://docs.pydantic.dev/
|
|
22
|
+
|
|
23
|
+
Each component is subject to its own license terms.
|