-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The `ShellCode` data plugin is a subclass of the `InstalledCode` plugin from `aiida-core`. The new plugin is used by the `launch_shell_job` utility function whenever a code has to be created on the fly. This will serve to be able to query for these kinds of codes and to distinguish them from codes that are typically setup manually.
- Loading branch information
Showing
7 changed files
with
85 additions
and
30 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
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 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Module for :mod:`aiida_shell.data`.""" | ||
from .code import ShellCode | ||
|
||
__all__ = ('ShellCode',) |
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,23 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Code that represents a shell command.""" | ||
from __future__ import annotations | ||
|
||
from aiida.orm import InstalledCode | ||
|
||
__all__ = ('ShellCode',) | ||
|
||
|
||
class ShellCode(InstalledCode): | ||
"""Code that represents a shell command. | ||
This code type is automatically generated by the :func:`~aiida_shell.engine.launch.launch_shell_job` function and is | ||
a subclass of :class:`~aiida.orm.nodes.data.code.installed.InstalledCode`. It can therefore be used for any other | ||
calculation job as well. | ||
""" | ||
|
||
@classmethod | ||
def _get_cli_options(cls) -> dict: | ||
"""Return the CLI options that would allow to create an instance of this class.""" | ||
options = super()._get_cli_options() | ||
options['default_calc_job_plugin']['default'] = 'core.shell' | ||
return options |
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