NREL / BuildingMOTIF

Building Metadata OnTology Interoperability Framework (BuildingMOTIF). For models, see https://models.open223.info/
https://buildingmotif.readthedocs.io/
Other
50 stars 7 forks source link

Required Point Not Generated When Referenced by an Optional Point #326

Closed wehuang16 closed 2 months ago

wehuang16 commented 5 months ago

When using BuildingMOTIF templates, I found that if I specify an optional point in a BuildingMOTIF template, and that optional point references a required point, if then I specify "require_optional_args=False" in my ".ttl" generation script, I saw that neither the optional point nor the required point are generated in the ".ttl" file. This is despite the expectation that only the optional point won't be generated, and the required point will be generated.

My simple workflow with BuildingMOTIF is in the “test_package.zip” file. Within the zip file, There are “.ttl” generation scripts: “test_require_optional_point.ipynb” and “test_require_optional_point.py”. They have the exact same content as each other. The BuildingMOTIF template file is “test_require_optional_point.yml”, and the “.ttl” result file is “test_require_optional_point_result.ttl”.

test_package.zip

I have downloaded BuildingMOTIF using the instructions here: (https://buildingmotif.readthedocs.io/en/latest/reference/developer_documentation.html).

I first used the “test_require_optional_point.py” file to generate a “.ttl” graph using the “hot-water-coil” template within the “test_require_optional_point.yml” file. The “test_require_optional_point.py” file had the argument “require_optional_args=False”. The “.ttl” graph result was stored in the “test_require_optional_point_result.ttl” file. Notice that the “optional” clause was commented out in the “test_require_optional_point.yml” file. Here, I had defined the point “supply-water-temp-sensor” as an optional point, and the point “supply-water-temp” as a required point. Also notice that in the dependencies section in the “test_require_optional_point.yml” file, the optional “supply-water-temp-sensor” point was referencing the required “supply-water-temp” point.

However, when I un-commented the “optional” clause in the “test_require_optional_point.yml” file, and then use the “test_require_optional_point.py” file to re-generate “.ttl” graph for “hot-water-coil”, I saw that while the “supply-water-temp-sensor” point was not generated in the “.ttl” graph, as expected, the “supply-water-temp” point was also not generated in the “.ttl” graph even though it was a required point. This phenomenon was happening because I believed that it was due to the optional “supply-water-temp-sensor” point referencing the required “supply-water-temp” point.

My question is, is there a way for me to generate the “hot-water-coil” “.ttl” graph in such a way that when the “optional” clause was un-commented (aka. setting the “supply-water-temp-sensor” point as an optional point), the “supply-water-temp” point will be generated while the ““supply-water-temp-sensor” point will not be generated?

gtfierro commented 5 months ago

Hi @wehuang16 ! Are you using the latest BuildingMOTIF from GitHub, or did you install via pypi?

gtfierro commented 5 months ago

I've been able to reproduce the error and I should be able to do a fix by next week.

wehuang16 commented 5 months ago

Hi @wehuang16 ! Are you using the latest BuildingMOTIF from GitHub, or did you install via pypi?

I used the latest Building MOTIF from Github, not the one from pypi

wehuang16 commented 5 months ago

I've been able to reproduce the error and I should be able to do a fix by next week.

sounds good!

gtfierro commented 5 months ago

Looks like the fix was pretty straight forward. It's in https://github.com/NREL/BuildingMOTIF/pull/327 if you want to try it out!