-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Got the error: eppy.bunch_subclass.BadEPFieldError: unknown field Program_Line_502 #391
Comments
I believe you can fix this yourself in the Energy+.idd file. If you open that file with a text editor and go to the EnergyManagementSystem:Program you will notice that it has fields listed to A502. If you want to extend that, just keep adding more fields by copying and renumbering. Make sure that intermediate fields are followed by a comma and the last field is followed by a semicolon. |
You are correct Jason. I have amended it manually and it worked. Thank you very much. Do you know if there's a way to amend it by means of eppy? Thinking of a script to automate the amendment. |
I don't think anything that automates that has been developed but it would be handy. |
@JasonGlazer , I agree that It would be good to automate this. @dsanchez-garcia , You may need to do this manually for a while. This will take a little time to do this update. Hopefully it can be done in such a way that IDD update automatically behind the scenes. |
@santoshphilip @JasonGlazer thank you both. I did a little piece of code to modify the idd as a text file that will work temporarily. Could you please let me know when you do it? Thanks! |
Keep an eye on this issue (turn on notification). I'll close this issue with a message once it is fixed. Can you share the code you used to modify the IDD? |
Of course. It only works for versions 9.0.0-1-2-3-4-5-6. I was struggling with the style at the comment, so I have attached a zip file with the python file. Hope it helps. |
thanx |
I think I am pretty close to solution for this. (*** it was really hard ****) I'll do an initial release and then start to open additional issues after a bit of discussion here |
:Problem: If the IDF files has more extensible fields than the IDD file for an idfobject, the read will fail :Solution: Increase the extensible fields of the IDD (in memory) to match the IDF file. It will not change the `Energy+.idd` on the disk.
I have a limited fix for this. :Problem: If the IDF files has more extensible fields than the IDD file for an idfobject, the read will fail
Other options:
I have merged the fix into the develop branch - not made a release yet. I'll open new issues for the problems mentioned above. Please post any comments. I'll close this issue after your comments @JasonGlazer and @dsanchez-garcia |
The first one of the other options is what I did as a temporary solution. I wrote a very simplistic script as a PostInstallCommand to automatically increase the fields of EnergyManagementSystem:Program in the IDD and save a backup file after the package is installed, so that the user don't need to deal with the IDD. I increased the fields up to 7500, so it is possible but unlikely that the user has a program longer than this. Maybe doing this for the objects that might need it is a solution. |
I agree that something automatic would be best. I guess if you try to assign to a name that does not exist in the IDD, you could see if the "root" name of the field without any trailing number matching the last field(s) in the IDD without a number and if it does, just increase the size of the input object in the IDD for that input object to that number. That would help with the second and third issue you pointed out. As far as on disk versus in memory, it seems likely that the user will be manipulating files that need this larger input objects on a repeated basis so maybe changing the IDD on the disk is the way to go. Another option is that you could have a "size.ini" file that is written and read by eppy that would list any input objects that need to be increased in size and what size to use. It could be read each time eppy is started and written when ever this resizing needs to take place. |
@JasonGlazer , All good ideas. |
I think this issue has been fixed.
@JasonGlazer , Can you think of any other possibilities where the IDD needs to be extended |
In fixing this issue, I had to make changes in parts of the code that are fragile (I wrote some of it long ago, when I was not good at it.) So I am a little concerned that I may have broken things. So @dsanchez-garcia , I would be happy if you are able to show that it is broken. Try and break it. Because, then it can be fixed. If you are not sure how to switch to the |
No problem, I'll try to break it. But I am not sure how to switch to the develop branch, so if you could provide some guidance, I would appreciate it. |
if you are using virtualenv and pip here is how you can do it.
pip install the develop branch
You can test run this code. (update pathname for Energy+.idd)
I have tested all the above steps on my computer |
here is how I tested the changes https://github.com/santoshphilip/eppy/blob/develop/tests/test_extend_extensible.py |
thanks @santoshphilip ; apologies for the delay, i've been busy lately. I'll do it as soon as I can. |
Not a problem. Take your time over it. If you can break it - great ! |
@santoshphilip just tested both and passed: C:\Python\pythonProject\venv\Scripts\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2020.2.3\plugins\python-ce\helpers\pycharm_jb_pytest_runner.py" --path C:/Python/pythonProject/tests/test_2.py ============================= test session starts ============================= test_2.py::test_read_overextended PASSED [ 33%] ============================== 3 passed in 1.17s ============================== Process finished with exit code 0 Thanks, and apologies for the delay. |
I am going to say that is is good for release. |
All these changes have been published in release r0.5.60 |
Hi,
I am working on an EMS script. I need to add a very long EMS Program object with eppy. The previous version of the EMS script had roughly 450 lines and it worked, but now I have increased it to roughly 1400. So, when I run the python script to add the EMS Program, I get the error on the subject:
Is this related to the number of lines? Can you please amend it somehow?
Thank you very much in advance. Kind regards.
The text was updated successfully, but these errors were encountered: