-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
369f4e6
commit faeff1a
Showing
30 changed files
with
509 additions
and
316 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,49 @@ | ||
import typing as t | ||
|
||
import ipywidgets as ipw | ||
|
||
from aiidalab_qe.common.mixins import HasProcess | ||
from aiidalab_qe.common.mvc import Model | ||
|
||
|
||
class ResultsComponentModel(Model, HasProcess): | ||
pass | ||
|
||
|
||
RCM = t.TypeVar("RCM", bound=ResultsComponentModel) | ||
|
||
|
||
class ResultsComponent(ipw.VBox, t.Generic[RCM]): | ||
def __init__(self, model: RCM, **kwargs): | ||
super().__init__(**kwargs) | ||
|
||
self._model = model | ||
self._model.observe( | ||
self._on_process_change, | ||
"process_uuid", | ||
) | ||
self._model.observe( | ||
self._on_monitor_counter_change, | ||
"monitor_counter", | ||
) | ||
|
||
self.rendered = False | ||
|
||
def render(self): | ||
if self.rendered: | ||
return | ||
self._render() | ||
self.rendered = True | ||
self._post_render() | ||
|
||
def _on_process_change(self, _): | ||
pass | ||
|
||
def _on_monitor_counter_change(self, _): | ||
pass | ||
|
||
def _render(self): | ||
raise NotImplementedError | ||
|
||
def _post_render(self): | ||
pass |
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 @@ | ||
from .model import WorkChainStatusModel | ||
from .status import WorkChainStatusPanel | ||
|
||
__all__ = [ | ||
"WorkChainStatusModel", | ||
"WorkChainStatusPanel", | ||
] |
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,5 @@ | ||
from aiidalab_qe.app.result.components import ResultsComponentModel | ||
|
||
|
||
class WorkChainStatusModel(ResultsComponentModel): | ||
pass |
Oops, something went wrong.