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

Fixed the loopdiagram stuff #151

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,878 changes: 978 additions & 900 deletions docs/HVAC_Tutorial.ipynb

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion docs/a_loop.idf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
!- Darwin Line endings

AIRTERMINAL:SINGLEDUCT:UNCONTROLLED,
zone1DirectAir, !- Name
Expand Down Expand Up @@ -202,4 +203,4 @@ DUCT,
DUCT,
sb4_duct, !- Name
sb4_duct_inlet, !- Inlet Node Name
a_loop Supply Outlet; !- Outlet Node Name
a_loop Supply Outlet; !- Outlet Node Name
3 changes: 2 additions & 1 deletion docs/c_loop.idf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
!- Darwin Line endings

BRANCH,
sb0, !- Name
Expand Down Expand Up @@ -227,4 +228,4 @@ CONDENSERLOOP,
c_loop Condenser Demand Branchs, !- Condenser Demand Side Branch List Name
c_loop Condenser Demand Connectors, !- Condenser Demand Side Connector List Name
Sequential, !- Load Distribution Scheme
None; !- Pressure Simulation Type
None; !- Pressure Simulation Type
3 changes: 2 additions & 1 deletion docs/hhh1.idf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
!- Darwin Line endings

BRANCH,
sb0, !- Name
Expand Down Expand Up @@ -230,4 +231,4 @@ PLANTLOOP,
, !- Availability Manager List Name
SingleSetpoint, !- Plant Loop Demand Calculation Scheme
None, !- Common Pipe Simulation
None; !- Pressure Simulation Type
None; !- Pressure Simulation Type
3 changes: 2 additions & 1 deletion docs/hhh_new.idf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
!- Darwin Line endings

BRANCH,
sb0, !- Name
Expand Down Expand Up @@ -285,4 +286,4 @@ PLANTLOOP,
, !- Availability Manager List Name
SingleSetpoint, !- Plant Loop Demand Calculation Scheme
None, !- Common Pipe Simulation
None; !- Pressure Simulation Type
None; !- Pressure Simulation Type
50 changes: 37 additions & 13 deletions eppy/useful_scripts/loopdiagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,14 @@ def makebranchcomponents(data, commdct, anode="epnode"):
return alledges


def makeairplantloop(data, commdct):
"""make the edges for the airloop and the plantloop"""
def makeplantloop(data, commdct):

edges = []

anode = "epnode"
endnode = "EndNode"


# in plantloop get:
# demand inlet, outlet, branchlist
# supply inlet, outlet, branchlist
Expand Down Expand Up @@ -286,6 +289,18 @@ def makeairplantloop(data, commdct):
# ((demandoutlet, endnode), (supplyinlet, endnode))]
# edges = edges + moreedges
#

return edges


def makeairloop(data, commdct):


edges = []

anode = "epnode"
endnode = "EndNode"

# -----------air loop stuff----------------------
# from s_airloop2.py
# Get the demand and supply nodes from 'airloophvac'
Expand Down Expand Up @@ -400,8 +415,6 @@ def makeairplantloop(data, commdct):
fieldlists = [fieldlist] * loops.objectcount(data, objkey)
uncontrolleds = loops.extractfields(data, commdct, objkey, fieldlists)

anode = "epnode"
endnode = "EndNode"

# edges = []

Expand Down Expand Up @@ -483,16 +496,29 @@ def makeairplantloop(data, commdct):
name = uncontrolled[0]
airnode = uncontrolled[1]
edges.append(((airnode, anode), name))


# edges = edges + moreedges
return edges

def makeairplantloop(data, commdct, do_plant_loops=True, do_air_loops=True):
"""make the edges for the airloop and the plantloop"""

plant_loop_edges = []
if do_plant_loops:
plant_loop_edges = makeplantloop(data, commdct)

air_loop_edges = []
if do_air_loops:
air_loop_edges = makeairloop(data, commdct)

edges = plant_loop_edges + air_loop_edges

return edges


def getedges(fname, iddfile):
def getedges(fname, iddfile, do_plant_loops=True, do_air_loops=True):
"""return the edges of the idf file fname"""
data, commdct = readidf.readdatacommdct(fname, iddfile=iddfile)
edges = makeairplantloop(data, commdct)
data, commdct, _iddindex = readidf.readdatacommdct(fname, iddfile=iddfile)
edges = makeairplantloop(data, commdct, do_plant_loops, do_air_loops)
return edges


Expand Down Expand Up @@ -541,11 +567,9 @@ def main():
formatter_class=argparse.RawTextHelpFormatter)
# need the formatter to print newline from __doc__
parser.add_argument('idd', type=str, action='store',
help='location of idd file = ./somewhere/eplusv8-0-1.idd',
required=True)
help='location of idd file = ./somewhere/eplusv8-0-1.idd')
parser.add_argument('file', type=str, action='store',
help='location of idf file = ./somewhere/f1.idf',
required=True)
help='location of idf file = ./somewhere/f1.idf')
args = parser.parse_args()
make_and_save_diagram(args.file, args.idd)

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ def run_tests(self):
author_email='[email protected]',
description='Scripting language for E+ idf files, and E+ output files',
long_description=long_description,# TODO set this up
packages=['eppy', 'eppy.EPlusInterfaceFunctions', 'eppy.geometry', 'eppy.constructions', 'eppy.runner'],
packages=['eppy', 'eppy.EPlusInterfaceFunctions', 'eppy.geometry',
'eppy.constructions', 'eppy.useful_scripts', 'eppy.runner'],
include_package_data=True,
platforms='any',
test_suite='eppy.test.test_eppy',# TODO make test_eppy
Expand Down