BuildingMOTIF icon indicating copy to clipboard operation
BuildingMOTIF copied to clipboard

Required Point Not Generated When Referenced by an Optional Point

Open wehuang16 opened this issue 1 year ago • 5 comments

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?

wehuang16 avatar Jun 25 '24 22:06 wehuang16

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

gtfierro avatar Jun 26 '24 18:06 gtfierro

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

gtfierro avatar Jun 26 '24 18:06 gtfierro

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 avatar Jun 26 '24 18:06 wehuang16

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

sounds good!

wehuang16 avatar Jun 26 '24 18:06 wehuang16

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!

gtfierro avatar Jun 26 '24 19:06 gtfierro