santoshphilip / eppy Goto Github PK
View Code? Open in Web Editor NEWscripting language for E+, Energyplus
License: MIT License
scripting language for E+, Energyplus
License: MIT License
When running the example from the documentation for forming a condenser loop, the inlet and outlet branches are not included in the branchlist.
loopname = "c_loop"
sloop = ['sb0', ['sb1', 'sb2', 'sb3'], 'sb4'] # supply side
dloop = ['db0', ['db1', 'db2', 'db3'], 'db4'] # demand side
theloop = hvacbuilder.makecondenserloop(theIdf, loopname, sloop, dloop)
The branchlists formed are:
BRANCHLIST,
c_loop Cond_Supply Branchs, !- Name
sb1, !- Branch 1 Name
sb2, !- Branch 2 Name
sb3; !- Branch 3 Name
BRANCHLIST,
c_loop Condenser Demand Branchs, !- Name
db1, !- Branch 1 Name
db2, !- Branch 2 Name
db3; !- Branch 3 Name
which is missing sb0, sb4, db0, db4.
there are a lot of scripts written during the development process.
Why when I execute the code at link
http://pythonhosted.org//eppy/Main_Tutorial.html,
Traceback (most recent call last):
File "C:\eppy\prova.py", line 3, in
from eppy import modeleditor
File "C:\eppy\eppy\modeleditor.py", line 20, in
from idfreader import makebunches
File "C:\eppy\eppy\idfreader.py", line 22, in
from bunch_subclass import EpBunch
File "C:\eppy\eppy\bunch_subclass.py", line 25, in
from bunch import *
Many thanks.
Hi,
I successfully created EnergyPlus project file for Visual Studio 2013 Desktop via CMake gui.
However I am experiencing problems building(compiling) the project. First of all, for each cc file I get a warning:
-warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
Most compiler errors are related to the IndexRange.hh, IndexSlice.hh file. Below is the example:
-IndexRange.hh(538): error C2589: '(' : illegal token on right side of '::'
-IndexRange.hh(538): error C2059: syntax error : '::'
-IndexSlice.hh(662): error C2804: binary 'operator ==' has too many parameters
-error C2614: 'ObjexxFCL::IndexSlice' : illegal member initialization: 'l_init_' is not a base or member
-error C2614: 'ObjexxFCL::IndexSlice' : illegal member initialization: 'l_' is not a base or member
and so on. I get over a hundred errors.
Can anyone help me and/or guide me how to successfully compile the project?
Your help is very much appreciated.
Vladimir
Do this in the install.rst
see if code can be updated so that eppy can handle both /field and /Field
About 5 files in the example files fail.
Review and try to fix as many as possible.
All may not be fixable
see http://pythonhosted.org/eppy/dev_docs/data_eppy.html for the underlying need for this.
idf1.idfobjects['BUILDING'] is a list and is not connected to idf1.model.dt['BUILDING']
list has to be subclassed to solve this problem
With the object Schedule:File in the idf, the path is erased after the colon after savinf in python
Schedule:File,
Test, !- Name
Any Number, !- Schedule Type Limits Name
Z:\exdir\output.csv, !- File Name
1, !- Column Number
0, !- Rows to Skip at Top
8760, !- Number of Hours of Data
, !- Column Separator
No, !- Interpolate to Timestep
15; !- Minutes per Item
becomes
Schedule:File,
Test, !- Name
Any Number, !- Schedule Type Limits Name
Z:
1, !- File Name
0, !- Column Number
8760, !- Rows to Skip at Top
, !- Number of Hours of Data
No, !- Column Separator
15; !- Interpolate to Timestep
The Field A2 and A3 of the object EnergyManagementSystem:Sensor can't be modified because of the colon in the field description.
keep up the good work !
I find logging really useful when developing. Are there any reasons why there isn't any logging at the moment? The only issue I've come across in the past is difficulty using it in conjunction with multiprocessing (though it's not impossible). That doesn't seem to be an issue in eppy though.
If this sounds useful, would it be possible to start a new branch to start adding logging code? I'm happy to make a logging config module and contribute new logging to bits I touch as I try to find my way around the code a bit better. It may also be useful to have some kind of a standard (or an EEP!) on what level of logging is appropriate for various situations and I can help out with that too.
Hi all,
I'd really like to get the EPlus output takes into pandas arrays to make it easier to manipulate and graph the data. Any help would be much appreciated!
Best wishes,
Amalia
Try to build a radiant system using eppy
There are geometry functions in ./eppy/geometry that use numpy.
It can be difficult to install numpy at times (for instance if you want to run epp in rhino http://www.rhino3d.com)
Dear all,
I have one question about eppy. If I want to integrate eppy library in a Java Web Application, how can I do it? Into which folder I enter eppy?
Many thanks for your time.
Best Regards
Hi there,
Eppy is fabulous, thank you for creating it. I am having a slight problem with it breaking my idf file, however. I have a 3 story building with about 17 zones per floor. Each zone is included in a water outlet group, so in total I have 51 pieces of water use equipment.
When I run eppy on my input idf, it only transfers 10 pieces of water use equipment to the resulting idf file (under the WaterUse:Connections object). Subsequently, when I try to run the new idf file in E+ it crashes.
Any suggestions you could send along would be much appreciated. I can cut and paste the rest of the water use equipment into the new idf file, but that kind of cuts into eppy's usefulness...
Thanks so much for your help,
Amalia
WaterUse:Connections,
Water Outlet Group, !- Name
Water Outlet Group Water Inlet Node, !- Inlet Node Name
Water Outlet Group Water Outlet Node, !- Outlet Node Name
, !- Supply Water Storage Tank Name
, !- Reclamation Water Storage Tank Name
, !- Hot Water Supply Temperature Schedule Name
, !- Cold Water Supply Temperature Schedule Name
None, !- Drain Water Heat Exchanger Type
Plant, !- Drain Water Heat Exchanger Destination
1500.0, !- Drain Water Heat Exchanger UFactor Times Area
01FirstFloor:Office7 Water Outlet, !- Water Use Equipment 1 Name
01FirstFloor:Corridor Water Outlet, !- Water Use Equipment 2 Name
01FirstFloor:Office8 Water Outlet, !- Water Use Equipment 3 Name
01FirstFloor:Office1 Water Outlet, !- Water Use Equipment 4 Name
01FirstFloor:Office3 Water Outlet, !- Water Use Equipment 5 Name
01FirstFloor:Office2 Water Outlet, !- Water Use Equipment 6 Name
01FirstFloor:Office4 Water Outlet, !- Water Use Equipment 7 Name
01FirstFloor:Office6 Water Outlet, !- Water Use Equipment 8 Name
01FirstFloor:Office5 Water Outlet, !- Water Use Equipment 9 Name
01FirstFloor:Bathroom1 Water Outlet, !- Water Use Equipment 10 Name
[there should be 41 more items in this list]
Following the examples for creating an airloop with hvacbuilder.makeairloop and with the hvacbuilder.replacebranch function does not seem to work.
Traceback (most recent call last):
File "D:\projects\ASHRAE MaxTech 1651\Task2e\HS18-RadiantDOAS\eppybug\airloopbug.py", line 30, in
newDOASsupplyBranch = hvacbuilder.replacebranch(airloop_idf, doasLoop, mainSupplyBranch, doasListOfComp, fluid='Air')
File "c:/eppy046/hvacbuilder.py", line 393, in replacebranch
connectcomponents(idf, components, fluid=fluid)
File "c:/eppy046/hvacbuilder.py", line 326, in connectcomponents
outletnodename = getnodefieldname(thiscomp, "Outlet_Node_Name", fluid)
File "c:/eppy046/hvacbuilder.py", line 309, in getnodefieldname
nodename = nodenames[0]
IndexError: list index out of range
The test file is:
import sys
import os
from StringIO import StringIO
pathto = "c:/eppy046/"
sys.path.append(pathto)
import modeleditor
from modeleditor import IDF
import hvacbuilder
iddfile = "c:/eppy046/resources/iddfiles/Energy+V8_1_0.idd"
IDF.setiddname(iddfile)
airloop_idf = IDF(StringIO(''))
loopname = "a_loop"
sloop = ['sb0', ['sb1', 'sb2', 'sb3'], 'sb4'] # supply side of the loop
dloop = ['zone1', 'zone2', 'zone3'] # zones on the demand side
doasLoop = hvacbuilder.makeairloop(airloop_idf, loopname, sloop, dloop)
airloop_idf.saveas("a_loop.idf")
dAirLpHvOAsys = airloop_idf.newidfobject("AirLoopHVAC:OutdoorAirSystem".upper(), 'DOAS_OA')
dCoilSysDX = airloop_idf.newidfobject("CoilSystem:Cooling:DX".upper(), 'DOAS_CoolCoil')
dCoilHtWtr = airloop_idf.newidfobject("Coil:Heating:Water".upper(), 'DOAS_HeatCoil')
dFanCV = airloop_idf.newidfobject("Fan:ConstantVolume".upper(), 'DOAS_Fan')
doasListOfComp = [dAirLpHvOAsys,dCoilSysDX,dCoilHtWtr,dFanCV]
mainSupplyBranch = airloop_idf.getobject('BRANCH', 'sb1') # args are (key, name)
newDOASsupplyBranch = hvacbuilder.replacebranch(airloop_idf, doasLoop, mainSupplyBranch, doasListOfComp, fluid='Air')
Please let me know how quickly you can fix or if you know a work around.
document
This may take some doing.
write a function that will conert
Currently, the IDD can only be set once - otherwise an IDDAlreadySetError
shows up.
I think it would be more practical to have the IDD as a separate (possibly optional, see below) parameter to the IDF constructor. That way, you could have two IDF instances floating around that are bound to different IDD files - cache them by path name if that needs to be done for performance reasons.
This kind of functionality could be used, say, to create a pure python implementation of the version updater tool. Just one example.
If no IDD file is given, a simple function like this one could find the "default" IDD file in the system, given that EnergyPlus is installed and accessible via the systems PATH:
def find_idd():
import os
import distutils.spawn
try:
energyplus = distutils.spawn.find_executable('EnergyPlus')
if not energyplus:
raise DefaultIDDNotFoundError()
energyplus = os.path.realpath(energyplus) # follow links in /usr/bin
folder = os.path.dirname(energyplus)
idd = os.path.join(folder, 'Energy+.idd')
if not os.path.isfile(idd):
raise DefaultIDDNotFoundError()
return idd
except:
raise DefaultIDDNotFoundError()
print idf.idfobject[key][0].__functions
DesignBuilder generates zone names by joining the building name and zone name with a colon (e.g. MyHouse:SAPZone1). Colons break the digraph formatting which shows as an error when eppy calls pydot.create()
. I'm not sure whether the solution is to replace colons with dashes after importing the IDF inside ex_loopdiagram.py
or to advise the user to do so manually in the Eppy documentation (and potentially raise an error with this advice if the problem arises) but it's likely to be a common problem.
When reading an HTML file the monthly reports that are created by users (any maybe the built in ones, I didn't look at those) do not have any string for the report title which follows the "Report:" and also do not include the "For:" string. Both are needed to find the correct report. I tried this with EnergyPlus 6.0. I will email you the files since I cannot attach them to an issue.
Right now there are three scripts here that need to be documented (9n useful_scripts folder):
It would be good to have a standalone script here for diagrams of the HVAC
document it it the tutorial with try: except statement
graphviz cannot make the diagrams if the object name has a colon ":" in it. This is because colons have meaning in the syntax of the dot file format that graphviz uses.
So loopdiaggram replaces the ":" with "__" but does not give any indication that it has done so. At the least it should warn that it has changed the names in the diagram. At the best it should give a list of the names it has changed, giving old and new names.
the present copy of idfdiff does not work in all circumstances
Hi Santosh
I am a big fan of what you guys have created here.
I have a file with many wind pressure coefficicent value objects. I want to operate on these using eppy.
trying something like this:
myidffile.idfobjects['AirflowNetwork:MultiZone:WindPressureCoefficientValues']
KeyError: 'AirflowNetworkMultiZoneWindPressureCoefficientValues'
i get a key error. I have looked through the keys, like so
idffile.idfobjects.keys()
long list of keys, with many objects, but not including the one I am looking for...
and I do not see the idf object of that type. Does that mean the AirflowNetwork:MultiZone:WindPressureCoefficientValues are not supported?
Thanks in advance
Document the following:
In [83]: branchlists = idf.idfobjects["branchlist".upper()]
In [84]: branchlist = branchlists[2]
In [85]: print branchlist
BRANCHLIST,
Chilled Water Loop Supply Branchs, !- Name
CW Pump Branch, !- Branch 1 Name
Purchased Cooling Branch, !- Branch 2 Name
Supply Bypass Branch, !- Branch 3 Name
Cooling Supply Outlet; !- Branch 4 Name
In [86]: print branchlist.obj
[u'BRANCHLIST', u'Chilled Water Loop Supply Branchs', u'CW Pump Branch', u'Purchased Cooling Branch', u'Supply Bypass Branch', u'Cooling Supply Outlet']
In [87]: lst = branchlist.obj
In [88]: print lst
[u'BRANCHLIST', u'Chilled Water Loop Supply Branchs', u'CW Pump Branch', u'Purchased Cooling Branch', u'Supply Bypass Branch', u'Cooling Supply Outlet']
In [89]: print lst.pop(-1)
Cooling Supply Outlet
In [90]: print branchlist.obj
[u'BRANCHLIST', u'Chilled Water Loop Supply Branchs', u'CW Pump Branch', u'Purchased Cooling Branch', u'Supply Bypass Branch']
In [91]: print branchlist
BRANCHLIST,
Chilled Water Loop Supply Branchs, !- Name
CW Pump Branch, !- Branch 1 Name
Purchased Cooling Branch, !- Branch 2 Name
Supply Bypass Branch; !- Branch 3 Name
In [92]: print lst.pop(2)
CW Pump Branch
In [93]: print branchlist
BRANCHLIST,
Chilled Water Loop Supply Branchs, !- Name
Purchased Cooling Branch, !- Branch 1 Name
Supply Bypass Branch; !- Branch 2 Name
In [94]: lst.insert(2, "gumby")
In [95]: print branchlist
BRANCHLIST,
Chilled Water Loop Supply Branchs, !- Name
gumby, !- Branch 1 Name
Purchased Cooling Branch, !- Branch 2 Name
Supply Bypass Branch; !- Branch 3 Name
In [96]: # also take a look at - branchlist.objls
Document how the following is used in eppy documentation.
Right now this takes about 5 lines to do.
idftxt = "" # empty string
from StringIO import StringIO
fhandle = StringIO(idftxt) # we can make a file handle of a string
new_idf = IDF(fhandle) # initialize the IDF object with the file handle
new_idf is only in memory now.
will be written to disk only with a new_df.saveas(name)
This just a question as to whether Eppy is absolutely wedded to the GPL3 licence?
It's frustrating as this a project I'm really keen to use for more than just speeding up changes to IDF files. I'd like to be able to import it and use it in other Python software I develop. However the IP-sensitive nature of the clients (universities, government, management consultancies) means that any import which is released under GPL3 licence is off-limits due to the "copyleft" aspect - the part which means that any work which imports Eppy must also be released under GPL3.
Is this intentional? Or could the licence be changed to something (such as the MIT licence) which would be more palatable to end-users with IP concerns?
Hi there,
I'm trying to process output data and have been having trouble using named_grid_h on the ABUPS End Uses Summary. The error I'm getting is
ValueError: Field names cannot start with an underscore '_'
I'm wondering if it has something to with the blank 2nd to last row of the table that has values u'\xa0'?
In general I would really like to read the output tables into numpy or pandas DataFrame arrays, but I don't seem to be experienced enough in python coding to pull that off smoothly :)
Thanks much!
Amalia
just update the install instructions
read html is a bare skeleton now. Do the following:
For my workflow, I'd like to be able to pass in a string containing the contents of the input file as opposed to the path to that file.
A file-like parameter with StringIO
would work too...
Use the values in the idd to do the range checking
For most objects, the first field which serves to identify them uniquely within their object type is called Name
.
For ZoneHVAC:EquipmentConnections
the identifier is Zone_Name
which is not picked up by the getobjects()
function.
There are potentially two ways around this:
Name
but can be overridden with Zone_Name
or whatever the identifier isI have a rough implementation of option 2, though there may be a nicer way of doing it:
def getobject(bunchdt, key, name):
"""get the object if you have the key and the name
retunrs a list of objects, in case you have more than one
You should not have more than one"""
# TODO : throw exception if more than one object, or return more objects
idfobjects = bunchdt[key]
try:
id_field = idfobjects[0].objidd[1]['field'][0]
except IndexError, e:
return None
id_field = id_field.replace(' ', '_')
theobjs = [idfobj for idfobj in idfobjects if idfobj[id_field].upper() == name.upper()]
try:
return theobjs[0]
except IndexError, e:
return None
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.