aim2dat.aiida_data.surface_data

AiiDA data classes for surfaces.

Module Contents

Classes

SurfaceData

AiiDA data object to store surface data.

class aim2dat.aiida_data.surface_data.SurfaceData(aperiodic_dir=2, miller_indices=(1, 0, 0), termination=1, **kwargs)[source]

Bases: aiida.orm.Data

AiiDA data object to store surface data.

Overview

Properties

aperiodic_dir

Non-periodic direction of the slab.

backend

Get the backend for this entity

backend_entity

Get the implementing class for this object

bottom_terminating_structure

Bottom terminating structure of the surface.

computer

Return the computer of this node.

creator

Return the creator of this node or None if it does not exist.

ctime

Return the node ctime.

description

Return the node description.

id

Return the id for this entity.

is_stored

Return whether the entity is stored.

is_valid_cache

Hook to exclude certain Node classes from being considered a valid cache.

label

Return the node label.

logger

Return the logger configured for this Node.

miller_indices

Miller indices of the surface facet.

mtime

Return the node mtime.

node_type

Return the node type.

pk

Return the primary key for this entity.

process_type

Return the node process type.

repeating_structure

Repeating structure of the surface.

source

Gets the dictionary describing the source of Data object. Possible fields:

surface_area

Surface area.

termination

Termination of the surface facet.

top_terminating_structure

Top terminating structure of the surface.

top_terminating_structure_nsym

Top terminating non-symmetric structure of the surface.

user

Return the user of this node.

uuid

Return the node UUID.

Methods

Collection()

Return the collection type for this class.

base()

Return the node base namespace.

class_node_type()

Returns the node type of this node (sub) class.

clone()

Create a clone of the Data node.

collection()

Get a collection for objects of this type, with the default backend.

convert(object_format, *args)

Convert the AiiDA StructureData into another python object

entry_point()

Return the entry point associated this node class.

export(path, fileformat, overwrite, **kwargs)

Save a Data object to a file.

get(**kwargs)

class Get an entity of the collection matching the given filters.

get_collection(backend)

class Get a collection for objects of this type for a given backend.

get_description()

Return a string with a description of the node.

get_export_formats()

class Get the list of valid export format strings

importfile(fname, fileformat)

Populate a Data object from a file.

importstring(inputstring, fileformat, **kwargs)

Converts a Data object to other text format.

initialize()

Initialize instance attributes.

objects()

Get a collection for objects of this type, with the default backend.

set_bottom_terminating_structure(elements, positions, cell, is_cartesian, kinds)

Set bottom-terminating non-symmetric structure.

set_repeating_structure(elements, positions, cell, is_cartesian, translational_vector, kinds)

Set repeating structure.

set_source(source)

Sets the dictionary describing the source of Data object.

set_top_terminating_structure(elements, positions, cell, is_cartesian, kinds)

Set top-terminating structure.

set_top_terminating_structure_nsym(elements, positions, cell, is_cartesian)

Set top-terminating non-symmetric structure.

store()

Store the node in the database while saving its attributes and repository directory.

store_all()

Store the node, together with all input links.

property aperiodic_dir

Non-periodic direction of the slab.

property backend : aiida.orm.implementation.StorageBackend

Get the backend for this entity

property backend_entity : BackendEntityType

Get the implementing class for this object

property bottom_terminating_structure

Bottom terminating structure of the surface.

property computer : aiida.orm.computers.Computer | None

Return the computer of this node.

property creator

Return the creator of this node or None if it does not exist.

Returns:

the creating node or None

property ctime : datetime.datetime

Return the node ctime.

Returns:

the ctime

property description : str

Return the node description.

Returns:

the description

property id : int | None

Return the id for this entity.

This identifier is guaranteed to be unique amongst entities of the same type for a single backend instance.

Returns:

the entity’s id

property is_stored : bool

Return whether the entity is stored.

property is_valid_cache : bool

Hook to exclude certain Node classes from being considered a valid cache.

The base class assumes that all node instances are valid to cache from, unless the _VALID_CACHE_KEY extra has been set to False explicitly. Subclasses can override this property with more specific logic, but should probably also consider the value returned by this base class.

property label : str

Return the node label.

Returns:

the label

property logger : logging.Logger | None

Return the logger configured for this Node.

Returns:

Logger object

property miller_indices

Miller indices of the surface facet.

property mtime : datetime.datetime

Return the node mtime.

Returns:

the mtime

property node_type : str

Return the node type.

Returns:

the node type

property pk : int | None

Return the primary key for this entity.

This identifier is guaranteed to be unique amongst entities of the same type for a single backend instance.

Returns:

the entity’s principal key

property process_type : str | None

Return the node process type.

Returns:

the process type

property repeating_structure

Repeating structure of the surface.

property source

Gets the dictionary describing the source of Data object. Possible fields:

  • db_name: name of the source database.

  • db_uri: URI of the source database.

  • uri: URI of the object’s source. Should be a permanent link.

  • id: object’s source identifier in the source database.

  • version: version of the object’s source.

  • extras: a dictionary with other fields for source description.

  • source_md5: MD5 checksum of object’s source.

  • description: human-readable free form description of the object’s source.

  • license: a string with a type of license.

Note

some limitations for setting the data source exist, see _validate method.

Returns:

dictionary describing the source of Data object.

property surface_area

Surface area.

property termination

Termination of the surface facet.

property top_terminating_structure

Top terminating structure of the surface.

property top_terminating_structure_nsym

Top terminating non-symmetric structure of the surface.

property user : aiida.orm.users.User

Return the user of this node.

property uuid : str

Return the node UUID.

Returns:

the string representation of the UUID

Collection()

Return the collection type for this class.

This used to be a class argument with the value NodeCollection. The argument is deprecated and this property is here for backwards compatibility to print the deprecation warning.

base() NodeBase

Return the node base namespace.

class_node_type() str

Returns the node type of this node (sub) class.

clone()

Create a clone of the Data node.

Returns:

an unstored clone of this Data node

collection() CollectionType

Get a collection for objects of this type, with the default backend.

Returns:

an object that can be used to access entities of this type

convert(object_format=None, *args)

Convert the AiiDA StructureData into another python object

Parameters:
object_format=None

Specify the output format

entry_point() importlib_metadata.EntryPoint | None

Return the entry point associated this node class.

Returns:

the associated entry point or None if it isn’t known.

export(path, fileformat=None, overwrite=False, **kwargs)

Save a Data object to a file.

Parameters:
fname

string with file name. Can be an absolute or relative path.

fileformat=None

kind of format to use for the export. If not present, it will try to use the extension of the file name.

overwrite=False

if set to True, overwrites file found at path. Default=False

**kwargs

additional parameters to be passed to the _exportcontent method

Returns:

the list of files created

classmethod get(**kwargs)

Get an entity of the collection matching the given filters.

classmethod get_collection(backend: aiida.orm.implementation.StorageBackend)

Get a collection for objects of this type for a given backend.

Note

Use the collection class property instead if the currently loaded backend or backend of the default profile should be used.

Parameters:
backend: aiida.orm.implementation.StorageBackend

The backend of the collection to use.

Returns:

A collection object that can be used to access entities of this type.

get_description() str

Return a string with a description of the node.

Returns:

a description string

classmethod get_export_formats()

Get the list of valid export format strings

Returns:

a list of valid formats

importfile(fname, fileformat=None)

Populate a Data object from a file.

Parameters:
fname

string with file name. Can be an absolute or relative path.

fileformat=None

kind of format to use for the export. If not present, it will try to use the extension of the file name.

importstring(inputstring, fileformat, **kwargs)

Converts a Data object to other text format.

Parameters:
fileformat

a string (the extension) to describe the file format.

Returns:

a string with the structure description.

initialize() None

Initialize instance attributes.

This will be called after the constructor is called or an entity is created from an existing backend entity.

objects() CollectionType

Get a collection for objects of this type, with the default backend.

Deprecated since version This: will be removed in v3, use collection instead.

Returns:

an object that can be used to access entities of this type

set_bottom_terminating_structure(elements, positions, cell, is_cartesian, kinds=None)[source]

Set bottom-terminating non-symmetric structure.

Parameters:
  • elements (list) – List of elements or atomic numbers.

  • positions (list) – Nested list of the coordinates, either in cartesian or scaled coordinates.

  • cell (list or np.array) – Nested 3x3 list of the cell vectors in angstrom.

  • is_cartesian (bool) – Whether the coordinates are cartesian or scaled.

set_repeating_structure(elements, positions, cell, is_cartesian, translational_vector, kinds=None)[source]

Set repeating structure.

Parameters:
  • elements (list) – List of elements or atomic numbers.

  • positions (list) – Nested list of the coordinates, either in cartesian or scaled coordinates.

  • cell (list or np.array) – Nested 3x3 list of the cell vectors in angstrom.

  • is_cartesian (bool) – Whether the coordinates are cartesian or scaled.

  • translational_vector (list or np.array) – Translational shift between two layers of repeating units.

set_source(source)

Sets the dictionary describing the source of Data object.

set_top_terminating_structure(elements, positions, cell, is_cartesian, kinds=None)[source]

Set top-terminating structure.

Parameters:
  • elements (list) – List of elements or atomic numbers.

  • positions (list) – Nested list of the coordinates, either in cartesian or scaled coordinates.

  • cell (list or np.array) – Nested 3x3 list of the cell vectors in angstrom.

  • is_cartesian (bool) – Whether the coordinates are cartesian or scaled.

set_top_terminating_structure_nsym(elements, positions, cell, is_cartesian)[source]

Set top-terminating non-symmetric structure.

Parameters:
  • elements (list) – List of elements or atomic numbers.

  • positions (list) – Nested list of the coordinates, either in cartesian or scaled coordinates.

  • cell (list or np.array) – Nested 3x3 list of the cell vectors in angstrom.

  • is_cartesian (bool) – Whether the coordinates are cartesian or scaled.

store() Node

Store the node in the database while saving its attributes and repository directory.

After being called attributes cannot be changed anymore! Instead, extras can be changed only AFTER calling this store() function.

Note:

After successful storage, those links that are in the cache, and for which also the parent node is already stored, will be automatically stored. The others will remain unstored.

store_all() Node

Store the node, together with all input links.

Unstored nodes from cached incoming linkswill also be stored.