Skip to content

Commit

Permalink
Adds more types to parse_idd_type
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelduchesne committed Aug 6, 2019
1 parent 610a345 commit 7d3ccf4
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions eppy/bunch_subclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,12 +402,24 @@ def __dir__(self):

def _parse_idd_type(epbunch, name):
"""parse the fieldvalue type into a python type. eg.: 'real' returns
'float'"""
_type = next(iter(epbunch.getfieldidd(name)["type"]), None)
'float'.
Possible types are:
- integer -> int
- real -> float
- alpha -> str (arbitrary string),
- choice -> str (alpha with specific list of choices, see \key)
- object-list -> str (link to a list of objects defined elsewhere, see \object-list and \reference)
- external-list -> str (uses a special list from an external source, see \external-list)
- node -> str (name used in connecting HVAC components)
"""
_type = next(iter(epbunch.getfieldidd(name)["type"]), "").lower()
if _type == "real":
return float
elif _type == "alpha":
return str
elif _type == "integer":
return int
else:
return str

Expand Down

0 comments on commit 7d3ccf4

Please sign in to comment.