Skip to content

Passes end to end test an example opex file #1

Open
ojas-uls-dev wants to merge 13 commits intomainfrom
simple-initial-features
Open

Passes end to end test an example opex file #1
ojas-uls-dev wants to merge 13 commits intomainfrom
simple-initial-features

Conversation

@ojas-uls-dev
Copy link
Copy Markdown
Collaborator

example file used for testing is available in SYSDEV-3051

Basic architecture is

  • model.py: Contains classes for internal/python representation of OPEX fields.
  • reader.py: Converts opex xml file to objects specified in model.py
  • writer.py: Converts objects specified in model.py to xml file

Copy link
Copy Markdown

@bdgregg bdgregg left a comment

Choose a reason for hiding this comment

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

@ojas-uls-dev in my look over, I did not see anything that stood out immediately as an issue. For a complete understanding of the logic of the code, I would need to see a demonstration of how this all works. I am excited to see the in roads into OPEX and look forward to see how to use this code.

Copy link
Copy Markdown
Member

@ctgraham ctgraham left a comment

Choose a reason for hiding this comment

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

Started a read-through and then got hijacked for end-of-day. Incomplete feedback, but I wanted to make it available as a start.

Comment thread model.py Outdated
identifier_types: list[Optional[str]] = None
descriptive_metadata: etree._ElementTree = None

def as_xml_fragments(self):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please add method/function documentation for purpose, input, output and side effects. For example, as I began reading this method I was surprised to see print calls, making me do a quick check for a return to figure out if the print was an output or a side effect.

Comment thread model.py Outdated

@staticmethod
def find(tree, name):
tag = tree.find(f".//opex:{name}", namespaces = OpexXmlHelper.ns_dict)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems like a risky assumption to assert that the first element in the tree is the match you are looking for. What constrains this so that someone doesn't instantiate a OpexXmlHelper at the root level and ask for .find('Type')? Is this a History > Events > Event > Type, or a Relationships > Relationship > Type? What about repeated instances of Event and Relationship elements?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The ".//" recursive search was an ad hoc fix for elements not showing up. Switched to using explicit paths

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.

3 participants