NTNU-IndEcol / BuildME

6 stars 1 forks source link

Bug in validate_ep_version() #54

Closed kamilakrych closed 2 years ago

kamilakrych commented 2 years ago

The function validate_ep_version() in pre.py checks for the version of EP installed locally. The problem is, it looks for the name in the folder name, which is obviously customizable, and does not necessarily contain the version of EP. I think it also depends on the installation procedure, sometimes it might be included by default and other times not. It happens in this line: bin_ver = settings.ep_path.split('-')[-3:]

Instead, the function should go inside this folder, and check for the Energy+.idd file. The first line of the file is the EP version: !IDD_Version 9.2.0.

CBreton026 commented 2 years ago

Please have a look at the pull request, I tried to implement the fix you described! It seems to work for me, although I only ran validate_ep_version by itself, and not through main.py.

nheeren commented 2 years ago

So cool. This week I am completely swamped. Will check asap / early next week.

CBreton026 commented 2 years ago

I realized afterwards that I left a print statement in line ~27 that should become an "assert" - I'll update it in a later commit!

nheeren commented 2 years ago

Fixed by 8904337. Thanks Charles!

I realized afterwards that I left a print statement in line ~27 that should become an "assert" - I'll update it in a later commit!

I simply let the FileNotFoundError bubble up now in cf2f3d2. Let me know if you feel this should be handled differently.