Skip to content

Formalize the definition and import location of plugin factories#2498

Merged
sphuber merged 4 commits into
aiidateam:provenance_redesignfrom
sphuber:fix_2176_relocate_plugin_factories
Feb 18, 2019
Merged

Formalize the definition and import location of plugin factories#2498
sphuber merged 4 commits into
aiidateam:provenance_redesignfrom
sphuber:fix_2176_relocate_plugin_factories

Conversation

@sphuber
Copy link
Copy Markdown
Contributor

@sphuber sphuber commented Feb 18, 2019

Fixes #2176

Even though each factory is designed to load a specific sub class of the base classes for the various entry point groups and therefore it could be argued that they should be defined in the corresponding module, these "functions" are not actual factories as such and are really syntactic sugar to load a plugin class through an entry point . As such, it was decided to define all plugin factories in aiida.plugins.factories and expose them to be imported from aiida.plugins.

In this PR I also took the liberty to rename some modules for consistency and to simplify development.
Short overview of the changes:

  • All test modules now have the test_ prefix
  • Moved aiida.orm.implementation.authinfo to aiida.orm.implementation.authinfos
  • Moved aiida.orm.implementation.computer to aiida.orm.implementation.computers
  • Moved aiida.scheduler to aiida.schedulers
  • Moved aiida.transport to aiida.transports

This will make it easier to switch to generic testing frameworks as well
as make it easier to distinguish them from implementation files in an
editor that without the prefix often share the same name.
Also refactored the `computer` and `authinfo` modules for both backend
implementations to get rid of the pre-commit exceptions.
To keep in line with the naming scheme of the other modules the respective
modules have been renamed to their plurals:

 * `aiida.scheduler` -> `aiida.schedulers`
 * `aiida.transport` -> `aiida.transports`
The are exposed and importable from `aiida.plugins`.
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.4%) to 69.555% when pulling 7867877 on sphuber:fix_2176_relocate_plugin_factories into 6791557 on aiidateam:provenance_redesign.

@sphuber sphuber merged commit 5395aaa into aiidateam:provenance_redesign Feb 18, 2019
@sphuber sphuber deleted the fix_2176_relocate_plugin_factories branch February 18, 2019 10:55
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