aiida.orm.nodes.data.remote package

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

class aiida.orm.nodes.data.remote.RemoteData(remote_path=None, **kwargs)[source]

Bases: aiida.orm.nodes.data.data.Data

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

Remember to pass a computer!

__abstractmethods__ = frozenset({})
__init__(remote_path=None, **kwargs)[source]
Parameters

backend_entity (aiida.orm.implementation.entities.BackendEntity) – the backend model supporting this entity

__module__ = 'aiida.orm.nodes.data.remote.base'
_abc_impl = <_abc_data object>
_clean()[source]

Remove all content of the remote folder on the remote computer

_logger: Optional[logging.Logger] = <Logger aiida.orm.nodes.data.remote.base.RemoteData (REPORT)>
_plugin_type_string = 'data.remote.RemoteData.'
_query_type_string = 'data.remote.'
_validate()[source]

Perform validation of the Data object.

Note

validation of data source checks license and requires attribution to be provided in field ‘description’ of source in the case of any CC-BY* license. If such requirement is too strict, one can remove/comment it out.

get_authinfo()[source]
get_computer_name()[source]

Get label of this node’s computer.

Deprecated since version 1.4.0: Will be removed in v2.0.0, use the self.computer.label property instead.

get_remote_path()[source]
getfile(relpath, destpath)[source]

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

Parameters
  • 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_empty

Check if remote folder is empty

listdir(relpath='.')[source]

Connects to the remote folder and lists the directory content.

Parameters

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

Returns

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

listdir_withattributes(path='.')[source]

Connects to the remote folder and lists the directory content.

Parameters

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

Returns

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

set_remote_path(val)[source]
class aiida.orm.nodes.data.remote.RemoteStashData(stash_mode: aiida.common.datastructures.StashMode, **kwargs)[source]

Bases: aiida.orm.nodes.data.data.Data

Data plugin that models an archived folder on a remote computer.

A stashed folder is essentially an instance of RemoteData that has been archived. Archiving in this context can simply mean copying the content of the folder to another location on the same or another filesystem as long as it is on the same machine. In addition, the folder may have been compressed into a single file for efficiency or even written to tape. The stash_mode attribute will distinguish how the folder was stashed which will allow the implementation to also unstash it and transform it back into a RemoteData such that it can be used as an input for new CalcJobs.

This class is a non-storable base class that merely registers the stash_mode attribute. Only its subclasses, that actually implement a certain stash mode, can be instantiated and therefore stored. The reason for this design is that because the behavior of the class can change significantly based on the mode employed to stash the files and implementing all these variants in the same class will lead to an unintuitive interface where certain properties or methods of the class will only be available or function properly based on the stash_mode.

__abstractmethods__ = frozenset({})
__init__(stash_mode: aiida.common.datastructures.StashMode, **kwargs)[source]

Construct a new instance

Parameters

stash_mode – the stashing mode with which the data was stashed on the remote.

__module__ = 'aiida.orm.nodes.data.remote.stash.base'
_abc_impl = <_abc_data object>
_logger: Optional[logging.Logger] = <Logger aiida.orm.nodes.data.remote.stash.base.RemoteStashData (REPORT)>
_plugin_type_string = 'data.remote.stash.RemoteStashData.'
_query_type_string = 'data.remote.stash.'
_storable = False
property stash_mode

Return the mode with which the data was stashed on the remote.

Returns

the stash mode.

class aiida.orm.nodes.data.remote.RemoteStashFolderData(stash_mode: aiida.common.datastructures.StashMode, target_basepath: str, source_list: List, **kwargs)[source]

Bases: aiida.orm.nodes.data.remote.stash.base.RemoteStashData

Data plugin that models a folder with files of a completed calculation job that has been stashed through a copy.

This data plugin can and should be used to stash files if and only if the stash mode is StashMode.COPY.

__abstractmethods__ = frozenset({})
__init__(stash_mode: aiida.common.datastructures.StashMode, target_basepath: str, source_list: List, **kwargs)[source]

Construct a new instance

Parameters
  • stash_mode – the stashing mode with which the data was stashed on the remote.

  • target_basepath – the target basepath.

  • source_list – the list of source files.

__module__ = 'aiida.orm.nodes.data.remote.stash.folder'
_abc_impl = <_abc_data object>
_logger: Optional[logging.Logger] = <Logger aiida.orm.nodes.data.remote.stash.folder.RemoteStashFolderData (REPORT)>
_plugin_type_string = 'data.remote.stash.folder.RemoteStashFolderData.'
_query_type_string = 'data.remote.stash.folder.'
_storable = True
property source_list

Return the list of source files that were stashed.

Returns

the list of source files.

property target_basepath

Return the target basepath.

Returns

the target basepath.

Submodules

Data plugin that models a folder on a remote computer.

class aiida.orm.nodes.data.remote.base.RemoteData(remote_path=None, **kwargs)[source]

Bases: aiida.orm.nodes.data.data.Data

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

Remember to pass a computer!

__abstractmethods__ = frozenset({})
__init__(remote_path=None, **kwargs)[source]
Parameters

backend_entity (aiida.orm.implementation.entities.BackendEntity) – the backend model supporting this entity

__module__ = 'aiida.orm.nodes.data.remote.base'
_abc_impl = <_abc_data object>
_clean()[source]

Remove all content of the remote folder on the remote computer

_logger: Optional[logging.Logger] = <Logger aiida.orm.nodes.data.remote.base.RemoteData (REPORT)>
_plugin_type_string = 'data.remote.RemoteData.'
_query_type_string = 'data.remote.'
_validate()[source]

Perform validation of the Data object.

Note

validation of data source checks license and requires attribution to be provided in field ‘description’ of source in the case of any CC-BY* license. If such requirement is too strict, one can remove/comment it out.

get_authinfo()[source]
get_computer_name()[source]

Get label of this node’s computer.

Deprecated since version 1.4.0: Will be removed in v2.0.0, use the self.computer.label property instead.

get_remote_path()[source]
getfile(relpath, destpath)[source]

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

Parameters
  • 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_empty

Check if remote folder is empty

listdir(relpath='.')[source]

Connects to the remote folder and lists the directory content.

Parameters

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

Returns

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

listdir_withattributes(path='.')[source]

Connects to the remote folder and lists the directory content.

Parameters

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

Returns

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

set_remote_path(val)[source]