Issue with versions ?
Last year, during the 2023-2 term, I worked with the Wulffpack package in the WSL (Windows Subsystem for Linux) environment on my Windows machine to carry out constructions for various systems. During that time, the package worked perfectly. Thanks to certain opportunities, I was able to upgrade my computer and had the intention of continuing my studies using the Wulffpack package.
Upon reinstalling and running these packages, I found that the code no longer functions. It is exactly the same code as last year, which ran perfectly on my previous machine with the version I installed in 2023-2. However, on my new machine, it does not work, and I believe there may be a version compatibility issue.
In addition to testing the code on my local machine using Jupyter-Lab, I performed the respective installation on Google Colab to see if it would work there, given that the libraries are in the cloud. The error persists, leading me to believe that it is not an issue with my local machine but rather with the current version of the Wulffpack package. Attached, you will find the code and the error. I would like to know how I could resolve this issue.
I am using it in a conda environment and the version of the spglib package is 2.3.1
CODE
from ase.build import bulk
import wulffpack
from wulffpack import SingleCrystal
Fe_surf = {(1,1,0): 1.371 , (2,0,0): 1.397 , (2,1,1): 1.608}
bulk_Fe = bulk("Fe", crystalstructure= "fcc", a=2.86, cubic=True)
surface_1 = SingleCrystal(surface_energies=Fe_surf, primitive_structure= bulk_Fe, natoms = 3000)
ERROR
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[11], line 3
1 import wulffpack
2 from wulffpack import SingleCrystal
----> 3 surface_1 = SingleCrystal(surface_energies=Fe_surf, primitive_structure= bulk_Fe)
4 surface_1.view()
File ~/.local/lib/python3.10/site-packages/wulffpack/single_crystal.py:51, in SingleCrystal.__init__(self, surface_energies, primitive_structure, natoms, tol)
47 def __init__(self, surface_energies: dict,
48 primitive_structure: Atoms = None,
49 natoms: int = 1000,
50 tol: float = 1e-5):
---> 51 standardized_structure = get_standardized_structure(primitive_structure)
52 symmetries = get_symmetries(standardized_structure)
53 forms = setup_forms(surface_energies,
54 standardized_structure.cell.T,
55 symmetries,
56 symmetries)
File ~/.local/lib/python3.10/site-packages/wulffpack/core/geometry.py:71, in get_standardized_structure(structure)
68 if structure is None:
69 structure = bulk('Au', crystalstructure='fcc', a=4.0)
---> 71 cell, scaled_positions, atomic_numbers = standardize_cell(structure)
72 return Atoms(atomic_numbers,
73 scaled_positions=scaled_positions,
74 cell=cell,
75 pbc=True)
File ~/.local/lib/python3.10/site-packages/spglib/spglib.py:1305, in standardize_cell(cell, to_primitive, no_idealize, symprec, angle_tolerance)
1276 """Return standardized cell. When the search failed, ``None`` is returned.
1277
1278 Parameters
(...)
1301 shown in the spglib (C-API) document.
1302 """
1303 _set_no_error()
-> 1305 lattice, _positions, _numbers, _ = _expand_cell(cell)
1306 if lattice is None:
1307 return None
File ~/.local/lib/python3.10/site-packages/spglib/spglib.py:1985, in _expand_cell(cell)
1984 def _expand_cell(cell):
-> 1985 lattice = np.array(np.transpose(cell[0]), dtype="double", order="C")
1986 positions = np.array(cell[1], dtype="double", order="C")
1987 numbers = np.array(cell[2], dtype="intc")
TypeError: float() argument must be a string or a real number, not 'Atom'