Skip to content

Conversation

@NotMixu
Copy link
Contributor

@NotMixu NotMixu commented Oct 18, 2024

Add typings for most of the things. Needs to be tested thoroughly because there are couple of changes I had to make, to make the type checker happy.

Some types are still WIP 😄

Copy link
Contributor

@villelaitila villelaitila left a comment

Choose a reason for hiding this comment

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

Good work, improves the maintainability a lot

"""
ignored_attributes = ignored_attributes or []

extracted_paths = []
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, can be removed, and also the for loop that iterates it.

def compare(self, path1, path2):
def compare(self, path1: str, path2: str):
#? What should be the correct implementation here? This doesn't seem to be correct.
model1 = SGraph(path1)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this would be the correct way in this function

        model1 = SGraph.parse_xml_or_zipped_xml(path1)
        model2 = SGraph.parse_xml_or_zipped_xml(path2)

raise ValueError("Either filepath or model must be provided")

self.egm = model
#? Is this intentionally "model" and not "self.model"?
Copy link
Contributor

Choose a reason for hiding this comment

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

good find, should be self.model

def getUsedElements(self, elem: SElement):
associations = [x for x in elem.outgoing]
return set(map(lambda x: x.fromElement, associations))
#? Is this intentionally "fromElement" and not "toElement"?
Copy link
Contributor

Choose a reason for hiding this comment

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

Good find, should be otherwise

Copy link
Contributor

@villelaitila villelaitila left a comment

Choose a reason for hiding this comment

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

Good changes

return {'existingOrNewAssociation': new_association, 'isNew': True}

def __init__(self, fr, to, deptype, depattrs=None):
#? Is it ok to update return value? The new one is the one described in the docstring
Copy link
Contributor

Choose a reason for hiding this comment

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

That's ok

@softagram-bot
Copy link

Looking good 🎉

See the full Softagram report

@villelaitila villelaitila changed the title [WIP] Improve typings of most of the important stuff Improve typings of most of the important stuff Nov 1, 2024
@villelaitila villelaitila merged commit b6934be into softagram:main Nov 1, 2024
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