aim2dat.aiida_data.gaussian_cube_data

AiiDA data classes for gaussian cube files.

Module Contents

Classes

GaussianCubeData

AiiDA data object to store gaussian cube files.

class aim2dat.aiida_data.gaussian_cube_data.GaussianCubeData(**kwargs)[source]

Bases: aiida.orm.Data

AiiDA data object to store gaussian cube files.

Overview

Properties

atomic_charges

Return the atomic charges.

atomic_numbers

Return the atomic numbers.

atomic_positions

Return the atomic positions (in bohr).

backend

Get the backend for this entity

backend_entity

Get the implementing class for this object

cell

Return the cell.

comment

Return the second line of the cube file.

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.

dset_ids

Return the data set identifiers.

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.

mtime

Return the node mtime.

node_type

Return the node type.

origin

Return the origin of the data.

pk

Return the primary key for this entity.

process_type

Return the node process type.

shape

Return the number of points in each direction.

source

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

title

Return the title of the cube file.

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_content()

Get content of the cube file.

get_cube_data()

Get cube data points.

get_description()

Return a string with a description of the node.

get_export_formats()

class Get the list of valid export format strings

get_structure(unit)

Get underlying structure.

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.

open_cube(path)

Open cube file.

set_from_file(file_obj)

class Set information from existing cube file.

set_source(source)

Sets the dictionary describing the source of Data object.

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 atomic_charges

Return the atomic charges.

Type:

list

property atomic_numbers

Return the atomic numbers.

Type:

list

property atomic_positions

Return the atomic positions (in bohr).

Type:

list

property backend : aiida.orm.implementation.StorageBackend

Get the backend for this entity

property backend_entity : BackendEntityType

Get the implementing class for this object

property cell

Return the cell.

Type:

list

property comment

Return the second line of the cube file.

Type:

list

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 dset_ids

Return the data set identifiers.

Type:

list

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 mtime : datetime.datetime

Return the node mtime.

Returns:

the mtime

property node_type : str

Return the node type.

Returns:

the node type

property origin

Return the origin of the data.

Type:

list

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 shape

Return the number of points in each direction.

Type:

list

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 title

Return the title of the cube file.

Type:

list

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_content()[source]

Get content of the cube file.

Returns:

str – File conent as string.

get_cube_data()[source]

Get cube data points.

Returns:

np.array – Data of the cube file.

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

get_structure(unit='angstrom')[source]

Get underlying structure.

Parameters:

unit (str) – Length unit.

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

open_cube(path=None)[source]

Open cube file.

Parameters:

path (str or None) – Path to the cube file.

Returns:

A file handle.

classmethod set_from_file(file_obj)[source]

Set information from existing cube file.

Returns:

GaussianCubeData – Data object containing the information from the file.

set_source(source)

Sets the dictionary describing the source of Data object.

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.