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

Allow to manually specify the backend for an analysis #5

Merged
merged 10 commits into from
Feb 28, 2025

Conversation

crnh
Copy link
Collaborator

@crnh crnh commented Feb 27, 2025

Currently, the backend is determined in every analysis using get_backend, so analyses will always be executed in the default backend. Although this will not occur very often, this makes it difficult to run multiple backends side-by-side. This PR adds a backend parameter to each analysis. By default, the visisipy.analysis.base.analysis decorator will automatically supply the configured backend, but if a different backend is used instead, this backend will be used by the analysis.

Furthermore, instead of forcing return_raw_result to be the last parameter, return_raw_result and backend are now forced to be keyword-only parameters.

chaasjes and others added 10 commits February 27, 2025 15:51
Overloads help the type checker to figure out the return type, which is different when return_raw_result == False
This allows to use multiple backends side-by-side. If the backend is not specified, the analysis decorator will pass the default backend to the analysis.
The order of the 'return_raw_result' and 'backend' parameters are now not checked anymore, it is sufficient to make them keyword-only parameters (which is enforced).
@crnh crnh requested a review from jwmbeenakker February 27, 2025 15:39
@crnh crnh added the backend label Feb 27, 2025
@crnh crnh merged commit 8d65f94 into main Feb 28, 2025
10 checks passed
@crnh crnh deleted the crnh/enhancement/set_analysis_backend branch February 28, 2025 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants