bsl546 / energym

Energym is an open source building simulation library designed to test climate control and energy management strategies on buildings in a systematic and reproducible way.
Other
65 stars 11 forks source link

SwissHouseRSlaTank-v0 return NoneType #11

Closed filippobertolotti0 closed 2 months ago

filippobertolotti0 commented 4 months ago

hi! trying the code copied by the notebook example into the documentation of SwissHouseRSlaTank-v0 model i found an error. The compilation return the following error: AttributeError: 'NoneType' object has no attribute 'get_inputs_names'.

Seems that it can't build the environment correctly. i've tried other models, and all of them work properly.

Following, the full error log:

Unable to build model. Failed to validate modelDescription.xml:

The code:

import energym weather = "CH_BS_Basel" env = energym.make("SwissHouseRSlaTank-v0", weather=weather, simulation_days=20) inputs = env.get_inputs_names() outputs = env.get_outputs_names() print("inputs:", inputs) print("outputs:", outputs)

thanks in advance. Filippo

psh987 commented 2 months ago

Hi Filippo, Sorry for the late response. I tried to reproduce the error on my side, but your code seems to work fine for me. Does the error also occur for other models, especially Modelica based ones, or only for "SwissHouseRSlaTank-v0"? I am not sure if it could be related to that, but it seems like you have FMPy version 0.3.20 installed, whereas in the requirements, version 0.2.14 is requested. You could try if using the package versions specified in the requirements solves the issue.

filippobertolotti0 commented 2 months ago

It works properly after the installation of the correct version of FMPy 4. thank you for the support!