Skip to content
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

Error when running IDF(idfname) #426

Open
waynetsu opened this issue Aug 15, 2023 · 2 comments
Open

Error when running IDF(idfname) #426

waynetsu opened this issue Aug 15, 2023 · 2 comments

Comments

@waynetsu
Copy link

Hi, I tried to run idf files using eppy. However, it just does't work when it comes to "idf1 = IDF(idfname)". I don't know what is going on and just couldn't get over this issue.

I am using Pycharm 2022.2.1 (Community Edition) and the eppy package was installed by miniconda 3. The python version is 3.7. I tried two versions of eppy (v0.5.51 and v0.5.63), but the error still exits. The operating system is Windows 10 Professional 22H2.

The error says:

Traceback (most recent call last):
  File "D:\ProgramData\miniconda3\envs\Python_v3.7\lib\code.py", line 90, in runcode
    exec(code, self.locals)
  File "<input>", line 32, in <module>
  File "D:\ProgramData\miniconda3\envs\Python_v3.7\lib\site-packages\eppy\modeleditor.py", line 579, in __init__
    self.read()
  File "D:\ProgramData\miniconda3\envs\Python_v3.7\lib\site-packages\eppy\modeleditor.py", line 713, in read
    self.idfname, self.iddname, self, commdct=self.idd_info, block=self.block
  File "D:\ProgramData\miniconda3\envs\Python_v3.7\lib\site-packages\eppy\idfreader.py", line 274, in idfreader1
    convertallfields(data, commdct, block)
  File "D:\ProgramData\miniconda3\envs\Python_v3.7\lib\site-packages\eppy\idfreader.py", line 170, in convertallfields
    for key in list(data.dt.keys()):
AttributeError: 'Eplusdata' object has no attribute 'dt'

The original code:

The original code:
import sys
import os
import time
import glob
import pandas as pd
import math
from eppy import modeleditor  
from eppy.modeleditor import IDF
import numpy as np
sys.path.append(r'D:\PythonCode\Eppy')
from self_defined_function.qlwr_emi_atm import Qlwr_spectral
# ------------------------------------
start_clock = time.time()  
EP_version="V22-1-0" 
sys.path.insert(0, 'D:/EnergyPlus'+EP_version)
# ------------------------------------
iddfile = r'D:\EnergyPlus'+EP_version+'\Energy+.idd'
path_dir0 = r'D:\PythonCode\Eppy' 
idfname = glob.glob(r'D:\PythonCode\Eppy\resources\idffile\SimpleModel.idf')
epwfile = r'D:\EnergyPlus\epw\NB.epw'
outputdirectory = glob.glob(path_dir0 + r'\output')
# ------------------------------------
IDF.setiddname(iddfile)  
idf1 = IDF(idfname)  
@santoshphilip
Copy link
Owner

At first glance, that code should work.
Not sure what is going wroing.
I need to try and recreate that error

@waynetsu
Copy link
Author

At first glance, that code should work. Not sure what is going wroing. I need to try and recreate that error

Thanks for your reply.

Actually, the same code worked previously in my old computer. However, after I got a new computer (the old one is window 7) and recreate the python environment, it doesn't work properly. It has been quite a long time and I am not able to get access to my old computer, so I am not sure whether I created exactly the same environment as previous.

I would appreciate it if you could help me solve this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants