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

Updates the patches with the eppy.ext_field_functions.increaseIDDfields #252

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

samuelduchesne
Copy link

No description provided.

Copy link
Owner

@jamiebull1 jamiebull1 left a 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.

Comment on lines +235 to +252
# 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
Copy link
Owner

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
Copy link
Owner

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
Copy link
Owner

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,
Copy link
Owner

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:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing type

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

Successfully merging this pull request may close these issues.

2 participants