-
Notifications
You must be signed in to change notification settings - Fork 0
Additional 232 enhancements #98
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
base: main
Are you sure you want to change the base?
Conversation
lattice/schema.py
Outdated
|
||
|
||
# Module functions | ||
def unname_group(expression: RegularExpressionPattern) -> str: |
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.
Not a great function name, but short.
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.
remove_named_regex_groups
?
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.
...or maybe this should be a member function of RegularExpressionPattern
called normalize
, cleaned
, remove_groups
?
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 can make it a static or class method, then we can make it a member if/when the "base class" is implemented.
if this < other: | ||
dependency_graph.add_edge(this, other) | ||
dependency_graph.remove_nodes_from(list(networkx.isolates(dependency_graph))) | ||
# dependency_graph.remove_nodes_from(list(networkx.isolates(dependency_graph))) |
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.
Not sure why I was removing unconnected nodes; this was causing the Courier declaration to go missing!
entry += f"{self._indent}\t{e},\n" | ||
entry += f"{self._indent}\tUNKNOWN\n{self._indent}{self._closure}" | ||
if "UNKNOWN" not in self._enumerants: | ||
entry += f"{self._indent}\tUNKNOWN\n" |
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.
ClimateInformation::DataSourceType already has an UNKNOWN enumerant in the schema. We've been adding one in all the other enums just for the cpp code. So, now we check first.
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.
hmmm...do we remember why? This might be worth looking into more later. We can make an issue for now.
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.
My answer is usually, "Chip".
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.
See comments on changes.
) | ||
# else: | ||
# raise Exception(f"Unrecognized Object Type, \"{object_type}\" in {self.file_path}") | ||
for group in self.data_groups.values(): |
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.
Separated the extraction of elements into its own loop, in order to have all DataGroup objects available when any element is populated. This allows for an element's type to find its defining DataGroup and see if custom attributes should be applied based on that DataGroup's parents and/or templates.
String: Object Type: "Data Type"