Edit: Solved. Apparently pip install was downloading a lower version. Creating a new conda environment and updating to the latest snb version solved the issue.
I'm following the Defects Generation tutorial for doped which uses shakenbreak. I want to generate espresso files.
snb passes this to ase. As per the documentation, pseudopotentials are optional. But this as it is led to:
File ~/anaconda3/envs/py38mats/lib/python3.8/site-packages/ase/io/espresso.py:1292, in write_espresso_in(fd, atoms, input_data, pseudopotentials, kspacing, kpts, koffset, crystal_coordinates, additional_cards, **kwargs)
1288 species_info = {}
1289 for species in set(atoms.get_chemical_symbols()):
1290 # Look in all possible locations for the pseudos and try to figure
1291 # out the number of valence electrons
-> 1292 pseudo = pseudopotentials[species]
1293 species_info[species] = {'pseudo': pseudo}
1295 # Convert atoms into species.
1296 # Each different magnetic moment needs to be a separate type even with
1297 # the same pseudopotential (e.g. an up and a down for AFM).
1298 # if any magmom are > 0 or nspin == 2 then use species labels.
1299 # Rememeber: magnetisation uses 1 based indexes
Attempts at Solution
I managed to bypass that by giving a dictionary of pseudopotentials but then ran into a profile error:
File ~/anaconda3/envs/py38mats/lib/python3.8/site-packages/ase/calculators/genericfileio.py:274, in GenericFileIOCalculator.__init__(self, template, profile, directory, parameters)
272 if profile is None:
273 if template.name not in self.cfg.parser:
--> 274 raise BadConfiguration(f'No configuration of {template.name}')
275 try:
276 profile = template.load_profile(self.cfg)
BadConfiguration: No configuration of espresso
Apparently this is a newer ase issue. However the source code for snb shows that write_espresso_files does try to check whether the ase version is old_ase or not.
Nevertheless I passed profile but this time got: TypeError: write_espresso_files() got an unexpected keyword argument 'profile'
The documentation has a profile argument for write_espresso_files but it is not there when I do ?Dist.write_espresso_files:
I checked if there was an issue with version. It turned out that the version conda lists is 3.2.3 but the version in shakenbreak/__init__.py which is given by __version__ is 1.0.2.
Other info
ase version: 3.23.0
doped version: 2.1.0
shakenbreak version: 3.2.3
Edit: Solved. Apparently pip install was downloading a lower version. Creating a new conda environment and updating to the latest snb version solved the issue.
I'm following the Defects Generation tutorial for doped which uses
shakenbreak
. I want to generate espresso files.Steps to Reproduce
snb
passes this toase
. As per the documentation,pseudopotentials
are optional. But this as it is led to:Attempts at Solution I managed to bypass that by giving a dictionary of
pseudopotentials
but then ran into aprofile
error:Apparently this is a newer
ase
issue. However the source code forsnb
shows thatwrite_espresso_files
does try to check whether the ase version isold_ase
or not.Nevertheless I passed
profile
but this time got:TypeError: write_espresso_files() got an unexpected keyword argument 'profile'
The documentation has a
profile
argument forwrite_espresso_files
but it is not there when I do?Dist.write_espresso_files
:I checked if there was an issue with version. It turned out that the version conda lists is
3.2.3
but the version inshakenbreak/__init__.py
which is given by__version__
is1.0.2
.Other info ase version: 3.23.0 doped version: 2.1.0 shakenbreak version: 3.2.3