Skip to content

[ModelicaSystem] Cleanup & mypy #292

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

Merged
merged 6 commits into from
Jun 4, 2025

Conversation

syntron
Copy link
Contributor

@syntron syntron commented May 28, 2025

cleanup within ModelicaSystem and mypy updates

buildModelResult = self.requestApi("buildModel", self.modelName, properties=varFilter)
logger.debug("OM model build result: %s", buildModelResult)

self.xmlFile = pathlib.Path(buildModelResult[0]).parent / buildModelResult[1]
self.xmlparse()

def sendExpression(self, expr, parsed=True):
def sendExpression(self, expr: str, parsed: bool = True):
Copy link
Member

Choose a reason for hiding this comment

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

This should be parsed: Optional[bool] = True, right?

Copy link
Contributor Author

@syntron syntron Jun 2, 2025

Choose a reason for hiding this comment

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

Not in this case as True is a valid bool value; it would be needed in case of parsed: Optional[bool] = None

Optional[abc] resolves to abc | None - both values are used as type hints

@adeas31 adeas31 enabled auto-merge (squash) June 4, 2025 12:06
@adeas31 adeas31 merged commit c912116 into OpenModelica:master Jun 4, 2025
5 checks passed
@syntron syntron deleted the cleanup_ModelicaSystem branch June 4, 2025 18:31
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