mofbuilder.io.CifReader#

class mofbuilder.io.CifReader(comm=None, ostream=None, filepath=None)[source]#

Bases: object

Class for reading CIF files, extracting symmetry and atomic site information, and providing atom coordinates in the primitive cell.

Parameters:
  • comm (mpi4py.MPI.Comm)

  • ostream (veloxchem.outputstream.OutputStream)

  • filepath (str)

comm#

MPI communicator.

Type:

MPI.Comm

rank#

Rank of the process.

Type:

int

nodes#

Total number of nodes/processes.

Type:

int

ostream#

Output stream for logging.

Type:

OutputStream

filepath#

Path to the CIF file.

Type:

str or Path

data#

Array with atom data.

Type:

np.ndarray or None

_debug#

Toggle debug logging.

Type:

bool

cell_info#

Unpacked cell dimensions and angles.

Type:

list

symmetry_sector#

Lines containing symmetry operations.

Type:

list

atom_site_sector#

Lines defining atomic sites.

Type:

list

net_name#

CIF network name.

Type:

str

spacegroup#

Space group label from CIF.

Type:

str

hall_number#

Hall number label from CIF.

Type:

str

V_con#

Connected component value from CIF, if present.

Type:

str

EC_con#

Edge connectivity value from CIF, if present.

Type:

str

ciffile_lines#

Filtered lines from the CIF file.

Type:

list[str]

fcoords#

Fractional coordinates for atoms.

Type:

np.ndarray

target_fcoords#

Specific fractional coordinates for requested atom type.

Type:

np.ndarray

read_cif(cif_file=None)[source]#

Reads a CIF file, storing relevant crystal and atom site sections in the instance.

Parameters:

cif_file (str, optional) – Path to the CIF file. If None, uses self.filepath.

Raises:

AssertionError – If the CIF file path does not exist.

Return type:

None

get_type_atoms_fcoords_in_primitive_cell(target_type=None)[source]#

Get all atoms of a particular type in the primitive cell, applying symmetry.

Parameters:

target_type (str, optional) – Atom type to select (e.g., “V”, “E”). If None, uses all.

Returns:

(cell_info, atom data, requested atom fractional coordinates)

Return type:

tuple[list, np.ndarray, np.ndarray]