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

225 add a plugin registry #228

Merged
merged 6 commits into from
Aug 22, 2023
Merged

225 add a plugin registry #228

merged 6 commits into from
Aug 22, 2023

Conversation

robsdavis
Copy link
Contributor

Description

This PR allows plugins that have been added by the user at runtime to be stored in the Plugins() context. The most important benefit of which is that it makes these user added plugins available to Benchmarks.evaluate(). This is achieved by the addition of two dictionary objects: "PLUGIN_REGISTRY" and "PLUGIN_CATEGORY_REGISTRY" to plugin.py. These dictionaries store all the plugins that get added by the PluginLoader. A new PluginLoader._refresh() function sets the values of these new dictionaries to self._plugins and self._categories. _refresh is called by all the functions that access the _plugins of _categories attributes, meaning that added plugins are always available.

closes #225

Affected Dependencies

None

How has this been tested?

  • New tests added:
    • tests/plugins/test_plugin_add.py checks an added plugin is available from synthcity.plugins.Plugins().list()
    • tests/benchmarks/test_benchmarks.py::test_benchmark_added_plugin checks that added plugins are available to Benchmarks.evaluate()

Checklist

@robsdavis robsdavis added the enhancement New feature or request label Aug 22, 2023
@robsdavis robsdavis self-assigned this Aug 22, 2023
@robsdavis robsdavis linked an issue Aug 22, 2023 that may be closed by this pull request
@robsdavis robsdavis merged commit ff9c768 into main Aug 22, 2023
@robsdavis robsdavis deleted the 225-add-a-plugin-registry branch August 22, 2023 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a plugin registry
1 participant