aiida.orm.nodes.data.remote package#

Module with data plugins that represent remote resources and so effectively are symbolic links.

Subpackages#

Submodules#

Data plugin that models a folder on a remote computer.

class aiida.orm.nodes.data.remote.base.RemoteData(remote_path=None, **kwargs)[源代码]#

基类:Data

Store a link to a file or folder on a remote machine.

Remember to pass a computer!

KEY_EXTRA_CLEANED = 'cleaned'#
__abstractmethods__ = frozenset({})#
__init__(remote_path=None, **kwargs)[源代码]#

Construct a new instance, setting the source attribute if provided as a keyword argument.

__module__ = 'aiida.orm.nodes.data.remote.base'#
__parameters__ = ()#
__plugin_type_string: ClassVar[str]#
__qb_fields__: Sequence[QbField] = [QbStrField('remote_path', dtype=str, is_attribute=True)]#
__query_type_string: ClassVar[str]#
_abc_impl = <_abc._abc_data object>#
_clean(transport=None)[源代码]#

Remove all content of the remote folder on the remote computer.

When the cleaning operation is successful, the extra with the key RemoteData.KEY_EXTRA_CLEANED is set.

参数:

transport – Provide an optional transport that is already open. If not provided, a transport will be automatically opened, based on the current default user and the computer of this data node. Passing in the transport can be used for efficiency if a great number of nodes need to be cleaned for the same computer. Note that the user should take care that the correct transport is passed.

抛出:

ValueError – If the hostname of the provided transport does not match that of the node’s computer.

_logger: Logger | None = <Logger aiida.orm.nodes.data.remote.base.RemoteData (WARNING)>#
_validate()[源代码]#

Validate information stored in Node object.

For the Node base class, this check is always valid. Subclasses can override this method to perform additional checks and should usually call super()._validate() first!

This method is called automatically before storing the node in the DB. Therefore, use get() and similar methods that automatically read either from the DB or from the internal attribute cache.

fields: QbFields = {'attributes': 'QbDictField(attributes.*) -> Dict[str, Any]',  'ctime': 'QbNumericField(ctime) -> datetime',  'description': 'QbStrField(description) -> str',  'extras': 'QbDictField(extras.*) -> Dict[str, Any]',  'label': 'QbStrField(label) -> str',  'mtime': 'QbNumericField(mtime) -> datetime',  'node_type': 'QbStrField(node_type) -> str',  'pk': 'QbNumericField(pk) -> int',  'remote_path': 'QbStrField(attributes.remote_path) -> str',  'repository_metadata': 'QbDictField(repository_metadata) -> Dict[str, Any]',  'source': 'QbDictField(attributes.source.*) -> Optional[dict]',  'user_pk': 'QbNumericField(user_pk) -> int',  'uuid': 'QbStrField(uuid) -> str'}#
get_authinfo()[源代码]#
get_remote_path() str[源代码]#
getfile(relpath, destpath)[源代码]#

Connects to the remote folder and retrieves the content of a file.

参数:
  • relpath – The relative path of the file on the remote to retrieve.

  • destpath – The absolute path of where to store the file on the local machine.

property is_cleaned#

Return whether the remote folder has been cleaned.

property is_empty#

Check if remote folder is empty

listdir(relpath='.')[源代码]#

Connects to the remote folder and lists the directory content.

参数:

relpath – If ‘relpath’ is specified, lists the content of the given subfolder.

返回:

a flat list of file/directory names (as strings).

listdir_withattributes(path='.')[源代码]#

Connects to the remote folder and lists the directory content.

参数:

relpath – If ‘relpath’ is specified, lists the content of the given subfolder.

返回:

a list of dictionaries, where the documentation is in :py:class:Transport.listdir_withattributes.

set_remote_path(val)[源代码]#