validibot-shared 0.3.1__tar.gz → 0.4.2__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 (23) hide show
  1. {validibot_shared-0.3.1 → validibot_shared-0.4.2}/PKG-INFO +25 -13
  2. {validibot_shared-0.3.1 → validibot_shared-0.4.2}/README.md +21 -9
  3. {validibot_shared-0.3.1 → validibot_shared-0.4.2}/pyproject.toml +4 -14
  4. {validibot_shared-0.3.1 → validibot_shared-0.4.2}/validibot_shared/energyplus/models.py +2 -2
  5. {validibot_shared-0.3.1 → validibot_shared-0.4.2}/validibot_shared/fmu/envelopes.py +18 -10
  6. {validibot_shared-0.3.1 → validibot_shared-0.4.2}/validibot_shared/fmu/models.py +2 -1
  7. {validibot_shared-0.3.1 → validibot_shared-0.4.2}/.gitignore +0 -0
  8. {validibot_shared-0.3.1 → validibot_shared-0.4.2}/LICENSE +0 -0
  9. {validibot_shared-0.3.1 → validibot_shared-0.4.2}/NOTICE +0 -0
  10. {validibot_shared-0.3.1 → validibot_shared-0.4.2}/tests/__init__.py +0 -0
  11. {validibot_shared-0.3.1 → validibot_shared-0.4.2}/tests/test_energyplus_envelopes.py +0 -0
  12. {validibot_shared-0.3.1 → validibot_shared-0.4.2}/tests/test_energyplus_models.py +0 -0
  13. {validibot_shared-0.3.1 → validibot_shared-0.4.2}/tests/test_fmu_envelopes.py +0 -0
  14. {validibot_shared-0.3.1 → validibot_shared-0.4.2}/tests/test_fmu_models.py +0 -0
  15. {validibot_shared-0.3.1 → validibot_shared-0.4.2}/tests/test_package_init.py +0 -0
  16. {validibot_shared-0.3.1 → validibot_shared-0.4.2}/tests/test_validations_envelopes.py +0 -0
  17. {validibot_shared-0.3.1 → validibot_shared-0.4.2}/validibot_shared/__init__.py +0 -0
  18. {validibot_shared-0.3.1 → validibot_shared-0.4.2}/validibot_shared/energyplus/__init__.py +0 -0
  19. {validibot_shared-0.3.1 → validibot_shared-0.4.2}/validibot_shared/energyplus/envelopes.py +0 -0
  20. {validibot_shared-0.3.1 → validibot_shared-0.4.2}/validibot_shared/fmu/__init__.py +0 -0
  21. {validibot_shared-0.3.1 → validibot_shared-0.4.2}/validibot_shared/py.typed +0 -0
  22. {validibot_shared-0.3.1 → validibot_shared-0.4.2}/validibot_shared/validations/__init__.py +0 -0
  23. {validibot_shared-0.3.1 → validibot_shared-0.4.2}/validibot_shared/validations/envelopes.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: validibot-shared
3
- Version: 0.3.1
3
+ Version: 0.4.2
4
4
  Summary: Shared library for data interchange between Validibot and validator containers
5
5
  Project-URL: Homepage, https://validibot.com
6
6
  Project-URL: Documentation, https://docs.validibot.com
@@ -24,10 +24,10 @@ Classifier: Programming Language :: Python :: 3.13
24
24
  Classifier: Topic :: Scientific/Engineering
25
25
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
26
26
  Requires-Python: >=3.10
27
- Requires-Dist: pydantic>=2.8.0
27
+ Requires-Dist: pydantic==2.12.3
28
28
  Provides-Extra: dev
29
- Requires-Dist: pytest>=8.3.0; extra == 'dev'
30
- Requires-Dist: ruff>=0.8.0; extra == 'dev'
29
+ Requires-Dist: pytest==9.0.2; extra == 'dev'
30
+ Requires-Dist: ruff==0.14.8; extra == 'dev'
31
31
  Description-Content-Type: text/markdown
32
32
 
33
33
  <div align="center">
@@ -212,18 +212,32 @@ validibot_shared/
212
212
  ```python
213
213
  from validibot_shared.energyplus import EnergyPlusInputEnvelope, EnergyPlusInputs
214
214
  from validibot_shared.validations.envelopes import (
215
+ ExecutionContext,
215
216
  InputFileItem,
217
+ OrganizationInfo,
218
+ SupportedMimeType,
216
219
  ValidatorInfo,
217
- ExecutionContext,
220
+ ValidatorType,
221
+ WorkflowInfo,
218
222
  )
219
223
 
220
224
  envelope = EnergyPlusInputEnvelope(
221
225
  run_id="run-123",
222
- validator=ValidatorInfo(id="v1", type="energyplus", version="24.2.0"),
226
+ validator=ValidatorInfo(
227
+ id="v1",
228
+ type=ValidatorType.ENERGYPLUS,
229
+ version="24.2.0",
230
+ ),
231
+ org=OrganizationInfo(id="org-123", name="Example Org"),
232
+ workflow=WorkflowInfo(
233
+ id="workflow-456",
234
+ step_id="step-789",
235
+ step_name="EnergyPlus Simulation",
236
+ ),
223
237
  input_files=[
224
238
  InputFileItem(
225
239
  name="model.idf",
226
- mime_type="application/vnd.energyplus.idf",
240
+ mime_type=SupportedMimeType.ENERGYPLUS_IDF,
227
241
  role="primary-model",
228
242
  uri="gs://bucket/model.idf",
229
243
  ),
@@ -243,15 +257,16 @@ json_payload = envelope.model_dump_json()
243
257
 
244
258
  ```python
245
259
  from validibot_shared.energyplus import EnergyPlusOutputEnvelope
260
+ from validibot_shared.validations.envelopes import ValidationStatus
246
261
 
247
262
  # Parse JSON response from validator
248
263
  envelope = EnergyPlusOutputEnvelope.model_validate_json(response_json)
249
264
 
250
265
  # Check status
251
- if envelope.status == "success":
266
+ if envelope.status == ValidationStatus.SUCCESS:
252
267
  # Access typed outputs with full autocomplete
253
268
  if envelope.outputs and envelope.outputs.metrics:
254
- print(f"EUI: {envelope.outputs.metrics.eui_kbtu_per_sqft} kBtu/sqft")
269
+ print(f"EUI: {envelope.outputs.metrics.site_eui_kwh_m2} kWh/")
255
270
 
256
271
  # Iterate over validation messages
257
272
  for message in envelope.messages:
@@ -401,13 +416,10 @@ cd validibot-shared
401
416
  uv sync --extra dev
402
417
 
403
418
  # Run tests
404
- uv run pytest
419
+ uv run python -m pytest
405
420
 
406
421
  # Run linter
407
422
  uv run ruff check .
408
-
409
- # Run type checker
410
- uv run mypy src/
411
423
  ```
412
424
 
413
425
  ## Trademarks
@@ -180,18 +180,32 @@ validibot_shared/
180
180
  ```python
181
181
  from validibot_shared.energyplus import EnergyPlusInputEnvelope, EnergyPlusInputs
182
182
  from validibot_shared.validations.envelopes import (
183
+ ExecutionContext,
183
184
  InputFileItem,
185
+ OrganizationInfo,
186
+ SupportedMimeType,
184
187
  ValidatorInfo,
185
- ExecutionContext,
188
+ ValidatorType,
189
+ WorkflowInfo,
186
190
  )
187
191
 
188
192
  envelope = EnergyPlusInputEnvelope(
189
193
  run_id="run-123",
190
- validator=ValidatorInfo(id="v1", type="energyplus", version="24.2.0"),
194
+ validator=ValidatorInfo(
195
+ id="v1",
196
+ type=ValidatorType.ENERGYPLUS,
197
+ version="24.2.0",
198
+ ),
199
+ org=OrganizationInfo(id="org-123", name="Example Org"),
200
+ workflow=WorkflowInfo(
201
+ id="workflow-456",
202
+ step_id="step-789",
203
+ step_name="EnergyPlus Simulation",
204
+ ),
191
205
  input_files=[
192
206
  InputFileItem(
193
207
  name="model.idf",
194
- mime_type="application/vnd.energyplus.idf",
208
+ mime_type=SupportedMimeType.ENERGYPLUS_IDF,
195
209
  role="primary-model",
196
210
  uri="gs://bucket/model.idf",
197
211
  ),
@@ -211,15 +225,16 @@ json_payload = envelope.model_dump_json()
211
225
 
212
226
  ```python
213
227
  from validibot_shared.energyplus import EnergyPlusOutputEnvelope
228
+ from validibot_shared.validations.envelopes import ValidationStatus
214
229
 
215
230
  # Parse JSON response from validator
216
231
  envelope = EnergyPlusOutputEnvelope.model_validate_json(response_json)
217
232
 
218
233
  # Check status
219
- if envelope.status == "success":
234
+ if envelope.status == ValidationStatus.SUCCESS:
220
235
  # Access typed outputs with full autocomplete
221
236
  if envelope.outputs and envelope.outputs.metrics:
222
- print(f"EUI: {envelope.outputs.metrics.eui_kbtu_per_sqft} kBtu/sqft")
237
+ print(f"EUI: {envelope.outputs.metrics.site_eui_kwh_m2} kWh/")
223
238
 
224
239
  # Iterate over validation messages
225
240
  for message in envelope.messages:
@@ -369,13 +384,10 @@ cd validibot-shared
369
384
  uv sync --extra dev
370
385
 
371
386
  # Run tests
372
- uv run pytest
387
+ uv run python -m pytest
373
388
 
374
389
  # Run linter
375
390
  uv run ruff check .
376
-
377
- # Run type checker
378
- uv run mypy src/
379
391
  ```
380
392
 
381
393
  ## Trademarks
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "validibot-shared"
7
- version = "0.3.1"
7
+ version = "0.4.2"
8
8
  description = "Shared library for data interchange between Validibot and validator containers"
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
@@ -32,15 +32,10 @@ classifiers = [
32
32
  "Topic :: Software Development :: Libraries :: Python Modules",
33
33
  "Topic :: Scientific/Engineering",
34
34
  ]
35
- dependencies = [
36
- "pydantic>=2.8.0",
37
- ]
35
+ dependencies = ["pydantic==2.12.3"]
38
36
 
39
37
  [project.optional-dependencies]
40
- dev = [
41
- "pytest>=8.3.0",
42
- "ruff>=0.8.0",
43
- ]
38
+ dev = ["pytest==9.0.2", "ruff==0.14.8"]
44
39
 
45
40
  [project.urls]
46
41
  Homepage = "https://validibot.com"
@@ -52,12 +47,7 @@ Issues = "https://github.com/danielmcquillen/validibot-shared/issues"
52
47
  packages = ["validibot_shared"]
53
48
 
54
49
  [tool.hatch.build.targets.sdist]
55
- include = [
56
- "/validibot_shared",
57
- "/tests",
58
- "/README.md",
59
- "/LICENSE",
60
- ]
50
+ include = ["/validibot_shared", "/tests", "/README.md", "/LICENSE"]
61
51
 
62
52
  [tool.ruff]
63
53
  line-length = 88
@@ -48,8 +48,8 @@ class EnergyPlusSimulationMetrics(BaseModel):
48
48
  Extracted EnergyPlus simulation metrics.
49
49
 
50
50
  These are the core output signals extracted from EnergyPlus simulation results.
51
- Field names here must match the binding_config["key"] values in the EnergyPlus
52
- provider catalog (see validibot/validations/providers/energyplus.py).
51
+ Field names here are the canonical EnergyPlus signal names expected by core
52
+ Validibot. The core Django app maps these names to SignalDefinition rows.
53
53
 
54
54
  The validator extracts these values from the EnergyPlus SQL database
55
55
  (eplusout.sql) and they become available as output signals for assertions.
@@ -7,9 +7,9 @@ the contract between Django and the FMU validator container:
7
7
  - Input envelope: FMU URI plus resolved input values and simulation config
8
8
  - Output envelope: FMU outputs, metrics, messages, and artifacts
9
9
 
10
- Inputs/outputs are keyed by validator catalog slugs. Workflow authors cannot
11
- remap signals; bindings live on catalog entries (input_binding_path) and
12
- default to slug-name lookups.
10
+ Inputs/outputs use native FMU variable names as declared in the FMU's
11
+ modelDescription.xml (e.g. "h" or "Temperature"). The core Django app
12
+ resolves these names when building the envelope and when ingesting results.
13
13
  """
14
14
 
15
15
  from __future__ import annotations
@@ -54,11 +54,14 @@ class FMUSimulationConfig(BaseModel):
54
54
 
55
55
 
56
56
  class FMUInputs(BaseModel):
57
- """Resolved inputs plus simulation config, keyed by catalog slugs."""
57
+ """Resolved inputs plus simulation config, keyed by native FMU variable names."""
58
58
 
59
59
  input_values: dict[str, Any] = Field(
60
60
  default_factory=dict,
61
- description="Input values keyed by catalog slugs.",
61
+ description=(
62
+ "Input values keyed by native FMU variable "
63
+ "names (from modelDescription.xml)."
64
+ ),
62
65
  )
63
66
  simulation: FMUSimulationConfig = Field(
64
67
  default_factory=FMUSimulationConfig,
@@ -67,17 +70,21 @@ class FMUInputs(BaseModel):
67
70
  output_variables: list[str] = Field(
68
71
  default_factory=list,
69
72
  description=(
70
- "Catalog slugs to capture as outputs. Empty means all output slugs."
73
+ "Native FMU variable names to capture as outputs. "
74
+ "Empty means all output variables from modelDescription.xml."
71
75
  ),
72
76
  )
73
77
 
74
78
 
75
79
  class FMUOutputs(BaseModel):
76
- """FMU execution results keyed by catalog slugs."""
80
+ """FMU execution results keyed by native FMU variable names."""
77
81
 
78
82
  output_values: dict[str, Any] = Field(
79
83
  default_factory=dict,
80
- description="Output values keyed by catalog slugs.",
84
+ description=(
85
+ "Output values keyed by native FMU variable "
86
+ "names (from modelDescription.xml)."
87
+ ),
81
88
  )
82
89
  fmu_guid: str | None = Field(default=None, description="FMU GUID, if reported.")
83
90
  fmi_version: str | None = Field(default=None, description="FMI version.")
@@ -139,11 +146,12 @@ def build_fmu_input_envelope(
139
146
  step_id: Workflow step ID
140
147
  step_name: Optional step name
141
148
  fmu_uri: FMU storage URI (gs://... or local path in dev)
142
- input_values: Resolved inputs keyed by catalog slug
149
+ input_values: Resolved inputs keyed by native FMU variable name
143
150
  callback_url: URL to POST callback
144
151
  execution_bundle_uri: Base URI/path for this run's files
145
152
  simulation: Optional FMUSimulationConfig
146
- output_variables: Optional list of catalog slugs to capture (empty=all outputs)
153
+ output_variables: Optional list of native FMU variable
154
+ names to capture (empty=all outputs)
147
155
  """
148
156
 
149
157
  input_files = [
@@ -2,7 +2,8 @@
2
2
  FMU probe result models.
3
3
 
4
4
  These models define the contract for FMU probing operations - extracting
5
- metadata from modelDescription.xml to populate validator catalog entries.
5
+ metadata from modelDescription.xml. Probe results feed into SignalDefinition
6
+ rows in the core Django app.
6
7
 
7
8
  Probing is done in-process in the Django worker (not in containers) since
8
9
  it's just XML parsing with no FMU execution.