ugr-sail / sinergym

Gym environment for building simulation and control using reinforcement learning
https://ugr-sail.github.io/sinergym/
MIT License
127 stars 34 forks source link

[Bug] [Question]: New opyplus release seems to break sinergym import #418

Closed V-for-Vaggelis closed 2 months ago

V-for-Vaggelis commented 2 months ago

Bug, Question 🐛❓

On trying to verify installation by running the tests I get the error below. I noticed that opyplus released a new version yesterday (25/06/2024), could it be the issue?

ImportError while loading conftest '/workspaces/sinergym/tests/conftest.py'. tests/conftest.py:10: in <module> import sinergym sinergym/__init__.py:7: in <module> from sinergym.utils.common import convert_conf_to_env_parameters sinergym/utils/common.py:13: in <module> from opyplus.epm.record import Record E ModuleNotFoundError: No module named 'opyplus.epm.record'; 'opyplus.epm' is not a package

To Reproduce

Install sinergym and open a terminal on the running container. Try to validate installation by running

pytest /tests -vv

I followed the installation steps below a windows 11 system with docker desktop and git bash:

  1. git clone https://github.com/ugr-sail/sinergym.git
  2. docker build -t sinergym-image .
  3. winpty docker run -it "image-tag"
  4. pytest /tests -vv

Expected behavior

Successful test logs

AlejandroCN7 commented 2 months ago

Hi @V-for-Vaggelis!

First, thank you very much for informing me about the issue. Since I was working with the container and didn't rebuild, I hadn't noticed this problem.

I took advantage of the latest PR I was working on and added the patch that fixes it. Additionally, Sinergym is now compatible with the latest stable version of Python (3.12.3), as opyplus was the cause of the incompatibility.

Thank you very much, and I hope this is helpful to you :)