Skip to content
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

Agent functions conditions in native python #910

Merged
merged 2 commits into from
Sep 1, 2022
Merged

Agent functions conditions in native python #910

merged 2 commits into from
Sep 1, 2022

Conversation

mondus
Copy link
Member

@mondus mondus commented Aug 26, 2022

Fixes #909

Requires the following

@mondus mondus self-assigned this Aug 26, 2022
@Robadob
Copy link
Member

Robadob commented Aug 26, 2022

As mentioned in meeting, AgentFunctionCondition's don't have access to any setters (any methods that can change state). Their API object is instead ReadOnlyDeviceAPI

It doesn't look like there's anything to handle this gracefully, or is the plan to leave users at the whim of C++ errors (I'm not sure how bad they would be, probably just method x does not exist).

@mondus mondus marked this pull request as ready for review September 1, 2022 08:05
@mondus
Copy link
Member Author

mondus commented Sep 1, 2022

As mentioned in meeting, AgentFunctionCondition's don't have access to any setters (any methods that can change state). Their API object is instead ReadOnlyDeviceAPI

It doesn't look like there's anything to handle this gracefully, or is the plan to leave users at the whim of C++ errors (I'm not sure how bad they would be, probably just method x does not exist).

The code generator will not distinguish between the Device API or Read only API. It will just check against a list of API functions so will raise compilation errors if a user tries to set a variable. It is not a "proper" static analyser as it is a tree walker that doesn't retain state so there are other examples where people may call functions out of context that would raise compilation errors. E.g. You can call wrapped message functions on not wrapped implementations.

The overall ambition of the code generator is to translate correct code (and filter out anything obviously wrong) but it is not expected to catch all errors that a compiler would. This would be done via Jitify 2 when we could link compile errors back to python code lines.

@mondus mondus merged commit a684b9b into master Sep 1, 2022
@mondus mondus deleted the pycondfunc branch September 1, 2022 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Agent Function conditions in pure/agent Python
3 participants