Package generic_fns :: Module interatomic
[hide private]
[frames] | no frames]

Module interatomic

source code

Module for the manipulation of the interatomic data structures in the relax data store.

Functions [hide private]
 
copy(pipe_from=None, pipe_to=None, spin_id1=None, spin_id2=None, verbose=True)
Copy the interatomic data from one data pipe to another.
source code
 
consistent_interatomic_data(pipe1=None, pipe2=None)
Check that the interatomic data is consistent between two data pipes.
source code
data.interatomic.InteratomContainer instance
create_interatom(spin_id1=None, spin_id2=None, pipe=None)
Create and return the interatomic data container for the two spins.
source code
bool
exists_data(pipe=None)
Determine if any interatomic data exists.
source code
bool
id_match(spin_id=None, interatom=None, pipe=None)
Test if the spin ID matches one of the two spins of the given container.
source code
 
interatomic_loop(selection1=None, selection2=None, pipe=None, selected=True)
Generator function for looping over all the interatomic data containers.
source code
data.interatomic.InteratomContainer instance or None
return_interatom(spin_id1=None, spin_id2=None, pipe=None)
Return the list of interatomic data containers for the two spins.
source code
list of data.interatomic.InteratomContainer instances
return_interatom_list(spin_id=None, pipe=None)
Return the list of interatomic data containers for the given spin.
source code
Variables [hide private]
  __package__ = 'generic_fns'

Imports: deepcopy, search, sys, pipes, Selection, count_spins, return_spin, spin_loop, RelaxError, RelaxInteratomError, RelaxInteratomInconsistentError, RelaxNoInteratomError, RelaxNoSpinError, write_data


Function Details [hide private]

copy(pipe_from=None, pipe_to=None, spin_id1=None, spin_id2=None, verbose=True)

source code 

Copy the interatomic data from one data pipe to another.

Parameters:
  • pipe_from (str) - The data pipe to copy the interatomic data from. This defaults to the current data pipe.
  • pipe_to (str) - The data pipe to copy the interatomic data to. This defaults to the current data pipe.
  • spin_id1 (str) - The spin ID string of the first atom.
  • spin_id2 (str) - The spin ID string of the second atom.
  • verbose (bool) - A flag which if True will cause info about each spin pair to be printed out.

consistent_interatomic_data(pipe1=None, pipe2=None)

source code 

Check that the interatomic data is consistent between two data pipes.

Parameters:
  • pipe1 (str) - The name of the first data pipe to compare.
  • pipe2 (str) - The name of the second data pipe to compare.
Raises:

create_interatom(spin_id1=None, spin_id2=None, pipe=None)

source code 

Create and return the interatomic data container for the two spins.

Parameters:
  • spin_id1 (str) - The spin ID string of the first atom.
  • spin_id2 (str) - The spin ID string of the second atom.
  • pipe (str or None) - The data pipe to create the interatomic data container for. This defaults to the current data pipe if not supplied.
Returns: data.interatomic.InteratomContainer instance
The newly created interatomic data container.

exists_data(pipe=None)

source code 

Determine if any interatomic data exists.

Parameters:
  • pipe (str) - The data pipe in which the interatomic data will be checked for.
Returns: bool
The answer to the question about the existence of data.

id_match(spin_id=None, interatom=None, pipe=None)

source code 

Test if the spin ID matches one of the two spins of the given container.

Parameters:
  • spin_id (str) - The spin ID string of the first atom.
  • interatom (InteratomContainer instance) - The interatomic data container.
  • pipe (str or None) - The data pipe containing the interatomic data container. Defaults to the current data pipe.
Returns: bool
True if the spin ID matches one of the two spins, False otherwise.

interatomic_loop(selection1=None, selection2=None, pipe=None, selected=True)

source code 

Generator function for looping over all the interatomic data containers.

Parameters:
  • selection1 (str) - The optional spin ID selection of the first atom.
  • selection2 (str) - The optional spin ID selection of the second atom.
  • pipe (str) - The data pipe containing the spin. Defaults to the current data pipe.
  • selected (bool) - A flag which if True will only return selected interatomic data containers.

return_interatom(spin_id1=None, spin_id2=None, pipe=None)

source code 

Return the list of interatomic data containers for the two spins.

Parameters:
  • spin_id1 (str) - The spin ID string of the first atom.
  • spin_id2 (str) - The spin ID string of the second atom.
  • pipe (str or None) - The data pipe holding the container. Defaults to the current data pipe.
Returns: data.interatomic.InteratomContainer instance or None
The matching interatomic data container, if it exists.

return_interatom_list(spin_id=None, pipe=None)

source code 

Return the list of interatomic data containers for the given spin.

Parameters:
  • spin_id (str) - The spin ID string.
  • pipe (str or None) - The data pipe holding the container. This defaults to the current data pipe.
Returns: list of data.interatomic.InteratomContainer instances
The list of matching interatomic data containers, if any exist.