-
Notifications
You must be signed in to change notification settings - Fork 24
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
Updates the patches with the eppy.ext_field_functions.increaseIDDfields #252
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few nitpicky comments... but I don't actually remember why we have this in patches
. It may be cleaner to just remove this function and use it directly from eppy
.
# there are not enough fields in the IDD to match the IDF | ||
# -- increase the number of fields in the IDD (in block and commdct) | ||
# -- start | ||
n = len(obj) - len(objfields) | ||
key_txt = obj[0] | ||
objfields = extff.increaseIDDfields(block, commdct, obj_i, key_txt, n) | ||
# -- increase the number of fields in the IDD (in block and commdct) | ||
# -- end | ||
# | ||
# -- convertfields for added fields - start | ||
key_i = obj_i | ||
key_comm = commdct[obj_i] | ||
try: | ||
inblock = block[obj_i] | ||
except TypeError as e: | ||
inblock = None | ||
obj = convertfields(key_comm, obj, inblock) | ||
# -- convertfields for added fields - end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appreciate this is probably taken directly from eppy, but I'd prefer it to be split out as a function with all those inline comments turned into a docstring.
@@ -20,7 +20,7 @@ | |||
from eppy.EPlusInterfaceFunctions.eplusdata import Eplusdata # noqa | |||
from eppy.bunch_subclass import EpBunch as BaseBunch | |||
from eppy.idf_msequence import Idf_MSequence | |||
from eppy.idfreader import convertallfields, iddversiontuple | |||
from eppy.idfreader import convertallfields, iddversiontuple, convertfields |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imports in alphabetical order please
@@ -191,39 +191,65 @@ def makebunches( | |||
|
|||
|
|||
def obj2bunch( | |||
data, commdct, obj | |||
data, commdct, obj, block=None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
block
argument is missed from the typing
return abunch | ||
|
||
|
||
def makeabunch( | ||
commdct, # type: List[List[Dict[str, Any]]] | ||
obj, # type: Union[List[Union[float, str]], List[str]] | ||
obj_i, # type: int | ||
block=None, # type: | ||
debugidd=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing type
return abunch | ||
|
||
|
||
def makeabunch( | ||
commdct, # type: List[List[Dict[str, Any]]] | ||
obj, # type: Union[List[Union[float, str]], List[str]] | ||
obj_i, # type: int | ||
block=None, # type: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing type
No description provided.