-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
CalculationTools
base and entry point aiida.tools.calculations
(
#2331) With the migration to the new provenance design, the type string of calculation nodes, no longer refer to the actual sub class of the `JobCalculation` that was run, but just the base `CalcJobNode`. The actual class of the calculation process was stored in the `process_type` if it could be mapped onto a known entry point. However, this change means that when a user now loads a node of a completed calculation node, let's say `PwCalculation`, the loaded node will be an instance of `CalcJobNode` and not `PwCalculation`, which means that any utility methods defined on the `PwCalculation` class are inaccessible. We can return this functionality through the concept of calculation tools, which will get exposed through the `CalcJobNode` class and will load a specifically registered entry point.
- Loading branch information
Showing
5 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# -*- coding: utf-8 -*- | ||
# pylint: disable=wildcard-import,undefined-variable | ||
"""Calculation tool plugins for Calculation classes.""" | ||
|
||
from .base import * | ||
|
||
__all__ = (base.__all__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Base class for CalculationTools | ||
Sub-classes can be registered in the `aiida.tools.calculations` category to enable the `CalcJobNode` class from being | ||
able to find the tools plugin, load it and expose it through the `tools` property of the `CalcJobNode`. | ||
""" | ||
|
||
__all__ = ('CalculationTools',) | ||
|
||
|
||
class CalculationTools(object): | ||
"""Base class for CalculationTools.""" | ||
|
||
# pylint: disable=too-few-public-methods | ||
|
||
def __init__(self, node): | ||
self._node = node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters