Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The old way for modification of ZVAL in the POTCAR is unavailable #1295

Closed
yuyuanjingxuan opened this issue Jan 18, 2021 · 4 comments
Closed
Labels
bug Category: Something does not work priority: medium Extra attention is needed to figure out what is causing this error. question Category: Further information is requested VASP Interface: Issue with the VASP interface

Comments

@yuyuanjingxuan
Copy link

Hi all,

I am carrying out a vasp calculation with potentiostat method. Thus, I use potential_file_creator to modify the ZVAL of one element of a structure provided. Take an example which add 0.01e to the 1st Ne atom of struc. What I used to do is

from pyiron_mpie.electrochemistry.potential_ramp import potential_file_creator
Ne_new= potential_file_creator(element="Ne", charge=0.01)
struct[0] = Ne_new

The type of struc here is pyiron_atomistics.atomistics.structure.atoms.Atoms, while the type of Ne_new is pyiron.atomistics.structure.periodic_table.ChemicalElement.

I am confused that the code above works one month ago. However, when I run the same code today, it is unavailable.

pyiron Version and Platform
python 3.7.9
pyiron 0.4.0

What I expect
0.01e was successfully added to the 1st Ne atom of struc.

Actual Behavior

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/u/system/SLES12/soft/pyiron/dev/anaconda3/lib/python3.7/site-packages/pyiron_atomistics/atomistics/structure/atoms.py in __setitem__(self, key, value)
   2205                 el = value
   2206             else:
-> 2207                 raise TypeError("value should either be a string or a ChemicalElement.")
   2208             if el != old_el:
   2209                 new_species = np.array(self.species).copy()

TypeError: value should either be a string or a ChemicalElement.

Could you please tell me how to avoid the issue here? Many thanks.

@yuyuanjingxuan yuyuanjingxuan added bug Category: Something does not work priority: medium Extra attention is needed to figure out what is causing this error. VASP Interface: Issue with the VASP interface question Category: Further information is requested labels Jan 18, 2021
@sudarsan-surendralal
Copy link
Member

This is very strange. Can you check if

from pyiron_atomistics.atomistics.structure.periodic_table import ChemicalElement

print(isinstance(Ne_new, ChemicalElement)

returns True?

@yuyuanjingxuan
Copy link
Author

Unfortunately, it returns False here.
Does that means pyiron_atomistics.atomistics.structure.periodic_table.ChemicalElement and pyiron.atomistics.structure.periodic_table.ChemicalElement are not the same object?

@sudarsan-surendralal
Copy link
Member

Unfortunately, it returns False here.
Does that means pyiron_atomistics.atomistics.structure.periodic_table.ChemicalElement and pyiron.atomistics.structure.periodic_table.ChemicalElement are not the same object?

Yes you are right! We have updated pyiron.atomistics to pyiron_atomistics.atomistics but unfortunately, these changes are not made in the pyiron_mpie repository which you use. I've opened a pull request for this (https://github.com/pyiron/pyiron_mpie/pull/39). Can you try using this branch?

@yuyuanjingxuan
Copy link
Author

Thanks Sudarsan. It works when I load the refactor branch from pyiron_mpie.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Category: Something does not work priority: medium Extra attention is needed to figure out what is causing this error. question Category: Further information is requested VASP Interface: Issue with the VASP interface
Projects
None yet
Development

No branches or pull requests

2 participants