Skip to content

Conversation

tanaya-mankad
Copy link
Contributor

  1. Changed "Data Type" to "Type" inside schema and schema parsing, but not inside core.schema.yaml, so that we can still have the syntax
    String: Object Type: "Data Type"
  2. Allow 232-compatible descriptor-based type declarations alongside shorthand symbolic declarations. This change majorly benefitted from adding named groups in schema.py's group types and constraint types, and using those named groups in the json and cpp generators.
  3. In order to support repeated group names, we'll use the regex module instead of the built-in re.

@tanaya-mankad tanaya-mankad self-assigned this Oct 1, 2025


# Module functions
def unname_group(expression: RegularExpressionPattern) -> str:
Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

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

remove_named_regex_groups?

Copy link
Member

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?

Copy link
Contributor Author

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)))
Copy link
Contributor Author

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"
Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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".

Copy link
Contributor Author

@tanaya-mankad tanaya-mankad left a 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():
Copy link
Contributor Author

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.

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