Updates the patches with the eppy.ext_field_functions.increaseIDDfields#252
Open
samuelduchesne wants to merge 1 commit intojamiebull1:developfrom
Open
Updates the patches with the eppy.ext_field_functions.increaseIDDfields#252samuelduchesne wants to merge 1 commit intojamiebull1:developfrom
samuelduchesne wants to merge 1 commit intojamiebull1:developfrom
Conversation
Closed
jamiebull1
requested changes
Nov 19, 2022
Owner
jamiebull1
left a comment
There was a problem hiding this comment.
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 |
Owner
There was a problem hiding this comment.
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.
| 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 |
Owner
There was a problem hiding this comment.
imports in alphabetical order please
|
|
||
| def obj2bunch( | ||
| data, commdct, obj | ||
| data, commdct, obj, block=None |
Owner
There was a problem hiding this comment.
block argument is missed from the typing
| obj, # type: Union[List[Union[float, str]], List[str]] | ||
| obj_i, # type: int | ||
| block=None, # type: | ||
| debugidd=True, |
| commdct, # type: List[List[Dict[str, Any]]] | ||
| obj, # type: Union[List[Union[float, str]], List[str]] | ||
| obj_i, # type: int | ||
| block=None, # type: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.