Skip to content

Conversation

@ll-nick
Copy link
Collaborator

@ll-nick ll-nick commented Dec 19, 2024

This contributes python bindings to use all the awesome features of the library in a python environment.

Analogously to KIT-MRT/util_caching#6, this doesn't add the bindings directly which wouldn't be possible because the arbitration graphs library is fully templated.
Instead, this adds a wrapper function that you need to call using the desired types to build a python library for them.
To make sure that everything works as expected, all of the unit tests have been translated to python.

#minor

…lent to behavior.cpp

Only missing YAML features
This allows removing the sys.append hack since both the python module
and the tests end up in the same directory.
Stream conversion are not supported out of the box in pybind and we
would call to_str anyway.
Still missing the tests for verifiers and different sub commands
Define "wrong" type in definition. This removes some duplicated code and
allows binding the type using pybind.
We need to move it to a python test where we include ag_verifier as we
cannot include bindings with the different template parameters in the
same python file.
@ll-nick ll-nick marked this pull request as ready for review January 7, 2025 08:20
@ll-nick ll-nick removed the request for review from ChristophBurger89 January 7, 2025 08:20
@ll-nick
Copy link
Collaborator Author

ll-nick commented Jan 7, 2025

Alright @orzechow, this one is ready for review now 🎉

And just FYI, because we were wondering the other day: the util_caching bindings are required for e.g. this test as the cached verification result is a public member of an arbitrators options.

@orzechow
Copy link
Member

image

😱

@ll-nick
Copy link
Collaborator Author

ll-nick commented Feb 11, 2025

Sorry 🙈

@ll-nick ll-nick marked this pull request as draft March 13, 2025 17:16
@ll-nick
Copy link
Collaborator Author

ll-nick commented Mar 13, 2025

I'll convert this back to draft since I may have found a generic solution for the template problem by using wrapper classes for the template arguments. That would allow actually releasing a python api that does not have to be instantiated on a set of template parameters. I'll update this PR once I have figured all of the out.

@ll-nick
Copy link
Collaborator Author

ll-nick commented May 16, 2025

Closing this one in favor of #110.

@ll-nick ll-nick closed this May 16, 2025
@ll-nick ll-nick deleted the pybind branch July 4, 2025 19:16
@ll-nick ll-nick restored the pybind branch July 4, 2025 19:17
@ll-nick ll-nick deleted the pybind branch July 4, 2025 19:18
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