Skip to content

Refine structure SpglibDataset error #88

@Vahid999

Description

@Vahid999

I have installed the latest tdeptools with python3.11 and tried the Fe-hcp example in the documentation in order to refine it. The input given in the documentation is

hcp Fe
2.4
0.50000 -0.866025 0.00000
0.50000 0.866025 0.00000
0.00000 0.000000 1.63299
Fe
2
Direct
0.333333 0.66666 0.25000
0.666666 0.33333 0.75000

The refinement crashed with the following error:

Read 'infile.ucposcar'
... autodetect format vasp for infile.ucposcar

REFINE SYMMETRY w/ SPGLIB
... symprec: 1e-10
... find standardized unitcell https://spglib.readthedocs.io/en/latest/definition.html#spglib-conventions-of-standardized-unit-cell

GEOMETRY INFORMATION FOR RESULTING STRUCTURE
Geometry info
input geometry: Atoms(symbols='Fe2', pbc=True, cell=[[2.399999160749853, 0.0, 0.0], [0.0, 3.9191759999999998, 0.0],
[-1.1999987411246333, 0.0, 2.0784607268118624]])
Symmetry prec.: 1e-10
Number of atoms: 2
Species: Fe (2)
Periodicity: [ True True True]
Positions: x (Å) y (Å) z (Å)
0, 'Fe': 1.800002 2.939382 0.346407
1, 'Fe': -0.600001 0.979794 1.732054
Lattice (Å):
[[ 2.39999916 0. 0. ]
[ 0. 3.919176 0. ]
[-1.19999874 0. 2.07846073]]
Cubicness: 0.459
Largest Cutoff: 1.039 Å
Bounding box rad.: 2.592 Å
Nearest neighbor: 3.394 Å

Cell lengths and angles:
a, b, c (Å): 2.4000 3.9192 2.4000
α, β, γ (°): 90.0000 120.0000 90.0000
Volume: 19.550 Å3
Volume per atom: 9.775 Å
3

Report symmetry information from spglib:
/home/vaskarpo/.local/lib/python3.11/site-packages/tdeptools/scripts/ase_geometry_info.py:33: DeprecationWarning: dict interface is deprecated. Use attribute interface instead
uwcks, count = np.unique(dataset["wyckoffs"], return_counts=True)
╭─────────────────────────────────────────────── Traceback (most recent call last) ───────────────────────────────────────────────╮
│ /home/vaskarpo/.local/lib/python3.11/site-packages/tdeptools/scripts/ase_geometry_refine.py:91 in main │
│ │
│ 88 │ │
│ 89 │ echo() │
│ 90 │ echo("GEOMETRY INFORMATION FOR RESULTING STRUCTURE") │
│ ❱ 91 │ inform(atoms, symprec=symprec) │
│ 92 │ │
│ 93 │ echo() │
│ 94 │ echo(f"... save new structure to '{outfile}'") │
│ │
│ /home/vaskarpo/.local/lib/python3.11/site-packages/tdeptools/scripts/ase_geometry_info.py:94 in inform │
│ │
│ 91 │ if symprec is not None: │
│ 92 │ │ echo() │
│ 93 │ │ echo("Report symmetry information from spglib:") │
│ ❱ 94 │ │ sds = get_symmetry_dataset(atoms, symprec=symprec) │
│ 95 │ │ │
│ 96 │ │ echo(f" Spacegroup: {sds.international} ({sds.number})") │
│ 97 │ │ if sds.number > 1: │
│ │
│ /home/vaskarpo/.local/lib/python3.11/site-packages/tdeptools/scripts/ase_geometry_info.py:34 in get_symmetry_dataset │
│ │
│ 31 │ dataset = spg.get_symmetry_dataset(to_spglib_cell(atoms), symprec=symprec) │
│ 32 │ │
│ 33 │ uwcks, count = np.unique(dataset["wyckoffs"], return_counts=True) │
│ ❱ 34 │ dataset["wyckoffs_unique"] = [(w, c) for (w, c) in zip(uwcks, count)] │
│ 35 │ │
│ 36 │ ats, count = np.unique(dataset["equivalent_atoms"], return_counts=True) │
│ 37 │ dataset["equivalent_atoms_unique"] = [(a, c) for (a, c) in zip(ats, count)] │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: 'SpglibDataset' object does not support item assignment

Maybe there is conflict between tdeptools version and python version. Does anyone know if tdeptools works with a specific python version?

Thanks,
Vahid

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions