-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Errors in Loading the “Template Writing” BuildingMOTIF Tutorial #212
Comments
hello @wehuang16! Thank you for the ticket. I've got two small fixes that'll get this running. Given the imports and building motif inti from buildingmotif import BuildingMOTIF
from buildingmotif.dataclasses import Library
bm = BuildingMOTIF("sqlite://") the lines lib = Library.load(directory="./my-templates")
templ = lib.get_template_by_name("vav-terminal-reheat") results in WARNING: Warning: could not resolve dependency dep<name=https://brickschema.org/schema/Brick#Supply_Air_Flow_Sensor bindings={'name': 'sa-flow'} library=https://brickschema.org/schema/1.3/Brick id=None>
...
sqlalchemy.exc.NoResultFound: No row was found when one was required This is because brick = Library.load(ontology_graph="./libraries/brick/Brick-subset.ttl")
lib = Library.load(directory="./my-templates")
templ = lib.get_template_by_name("vav-terminal-reheat") We get the error ValueError: In vav-terminal-reheat the values of the bindings to https://brickschema.org/schema/Brick#Occupancy_Sensor must correspond to the parameters in the dependant template.Dependency https://brickschema.org/schema/Brick#Occupancy_Sensor refers to params {'occ'} that do not appear in template vav-terminal-reheat This is because |
Thank you so much for your information! |
This should be a straightforward fix on my end. Sorry you ran into this! |
Basically what I did was, with the “template writing” tutorial (https://nrel.github.io/BuildingMOTIF/tutorials/template_writing.html), I copied the following codes to a Jupyter notebook file named “template_writing_tutorial.ipynb”:
from rdflib import Namespace, Graph
from buildingmotif import BuildingMOTIF
from buildingmotif.dataclasses import Model, Library
lib = Library.load(directory="my-templates")
templ = lib.get_template_by_name("vav-terminal-reheat")
I also copied the following codes to a “.yaml” file named “vav-terminal-reheat.yaml”, where the file “vav-terminal-reheat.yaml” is inside a folder named “my-templates”:
The setup of the aforementioned Jupyter Notebook file and the “my-templates” folder (containing the “.yaml” file) was shown here (https://drive.google.com/drive/folders/1mcN42q8JbkM-3Rwx2jNqdGPRvYg9GgUs?usp=share_link). The Jupyter Notebook file and the “my-templates” folder were stored in the “BuildingMOTIF/docs/tutorials” file path.
I first ran the “template_writing_tutorial.ipynb” file, but it returned the following error at the line
lib = Library.load(directory="my-templates")
:Then I added the line
bm = BuildingMOTIF("sqlite://")
, so that the file “template_writing_tutorial.ipynb” now looks like the following:from rdflib import Namespace, Graph
from buildingmotif import BuildingMOTIF
from buildingmotif.dataclasses import Model, Library
bm = BuildingMOTIF("sqlite://")
lib = Library.load(directory="my-templates")
templ = lib.get_template_by_name("vav-terminal-reheat")
I ran “template_writing_tutorial.ipynb” again. It returned the following error at the line
templ = lib.get_template_by_name("vav-terminal-reheat")
:Therefore, I would like to raise this issue here to learn more about how we could resolve the above errors.
The text was updated successfully, but these errors were encountered: