Skip to content

Commit 8930ab3

Browse files
committed
fix missing imports
1 parent 7a2f115 commit 8930ab3

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

docs/tutorials/model_correction.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ constraints = Library.load(ontology_graph="constraints/constraints.ttl")
4949
5050
# load libraries excluded from the python package (available from the repository)
5151
brick = Library.load(ontology_graph="../../libraries/brick/Brick.ttl")
52+
Library.load(ontology_graph="../../libraries/qudt/unit.ttl")
53+
Library.load(ontology_graph="../../libraries/qudt/quantitykind.ttl")
5254
g36 = Library.load(directory="../../libraries/ashrae/guideline36")
5355
5456
# load tutorial 2 model and manifest
@@ -64,7 +66,7 @@ model.update_manifest(manifest.get_shape_collection())
6466
Let's validate the model again to see what's causing the failure.
6567

6668
```{code-cell}
67-
validation_result = model.validate()
69+
validation_result = model.validate(error_on_missing_imports=False)
6870
print(f"Model is valid? {validation_result.valid}")
6971
7072
# print reasons
@@ -153,7 +155,7 @@ for templ in generated_templates.get_templates():
153155
We use the same code as before to ask BuildingMOTIF if the model is now valid:
154156

155157
```{code-cell}
156-
validation_result = model.validate()
158+
validation_result = model.validate(error_on_missing_imports=False)
157159
print(f"Model is valid? {validation_result.valid}")
158160
# print reasons
159161
for uri, diffset in validation_result.diffset.items():
@@ -206,7 +208,7 @@ for templ in generated_templates_sf.get_templates():
206208
We can re-check the validation of the model now:
207209

208210
```{code-cell}
209-
validation_result = model.validate()
211+
validation_result = model.validate(error_on_missing_imports=False)
210212
print(f"Model is valid? {validation_result.valid}")
211213
print(validation_result.report.serialize())
212214

docs/tutorials/model_validation.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ constraints = Library.load(ontology_graph="../../buildingmotif/libraries/constra
7171
7272
# load libraries excluded from the python package (available from the repository)
7373
brick = Library.load(ontology_graph="../../libraries/brick/Brick.ttl")
74+
Library.load(ontology_graph="../../libraries/qudt/unit.ttl")
75+
Library.load(ontology_graph="../../libraries/qudt/quantitykind.ttl")
7476
g36 = Library.load(directory="../../libraries/ashrae/guideline36")
7577
```
7678

@@ -80,7 +82,7 @@ BuildingMOTIF organizes Shapes into `Shape Collections`. The shape collection as
8082

8183
```{code-cell}
8284
# pass a list of shape collections to .validate()
83-
validation_result = model.validate([brick.get_shape_collection()])
85+
validation_result = model.validate([brick.get_shape_collection()], error_on_missing_imports=False)
8486
print(f"Model is valid? {validation_result.valid}")
8587
```
8688

@@ -243,7 +245,7 @@ to load in the Brick and Guideline36 libraries at the top of this tutorial.
243245

244246

245247
```{code-cell}
246-
validation_result = model.validate()
248+
validation_result = model.validate(error_on_missing_imports=False)
247249
print(f"Model is valid? {validation_result.valid}")
248250
249251
# print reasons
@@ -269,7 +271,7 @@ shape_collections = [
269271
]
270272
271273
# pass a list of shape collections to .validate()
272-
validation_result = model.validate(shape_collections)
274+
validation_result = model.validate(shape_collections, error_on_missing_imports=False)
273275
print(f"Model is valid? {validation_result.valid}")
274276
275277
# print reasons
@@ -306,7 +308,7 @@ print(model.graph.serialize())
306308
We can see that the heating coil was added to the model and connected to the AHU so let's check if the manifest validation failure was fixed.
307309

308310
```{code-cell}
309-
validation_result = model.validate()
311+
validation_result = model.validate(error_on_missing_imports=False)
310312
print(f"Model is valid? {validation_result.valid}")
311313
312314
# print reasons
@@ -373,7 +375,7 @@ print(f"Model is valid? {validation_result.valid}")
373375
Now we can run validation to see if our AHU is ready to run the "single zone AHU" control sequence:
374376

375377
```{code-cell}
376-
validation_result = model.validate()
378+
validation_result = model.validate(error_on_missing_imports=False)
377379
print(f"Model is valid? {validation_result.valid}")
378380
```
379381

0 commit comments

Comments
 (0)