-
Notifications
You must be signed in to change notification settings - Fork 7
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
Introduce EmbeddedXlTable.defaults to store composite tag info #216
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.
Can't comment on the logic (which I don't really understand), but other than my one nitpick, looks good :)
@@ -57,7 +57,7 @@ def remove_comment_rows( | |||
result = [] | |||
|
|||
for table in tables: | |||
tag = datatypes.Tag(table.tag.split(":")[0]) | |||
tag = datatypes.Tag(table.tag) |
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.
Random nitpickey suggestion : this file would be more readable if we did from .datatypes import Tag
and changed all these to just Tag(table.tag)
.
Unless there's a good reason not to (like if there was another Tag class somewhere that needed distinguishing from)
Same with datatype.Config, EmbeddedXlTable and TimesModel
references.
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.
I think this would make a lot of sense. If @siddharth-krishna agrees we could change all them in a separate PR?
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.
Nice idea, thanks, I opened an issue to track it: #220
Thanks! Basically, this just extracts the extra info that may be included with a tag (e.g. |
xl2times/utils.py
Outdated
(newtag, varname) = table.tag.split(":") | ||
varname = varname.strip() | ||
if table.defaults: | ||
varname = table.defaults | ||
df = table.dataframe.copy() |
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.
I don't think we need the copy here btw
This PR introduces EmbeddedXlTable.defaults to store the additional info from a composite tag. Separating this info early on allows removing repeated decomposition of the composite tag.