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

change atom type #29

Open
dragonyanglong opened this issue Sep 21, 2018 · 3 comments
Open

change atom type #29

dragonyanglong opened this issue Sep 21, 2018 · 3 comments

Comments

@dragonyanglong
Copy link
Owner

After the calculation, user change the atomtype. it will give error.

No error when change Uij, xyz, or occupancies.

Exception in thread Thread-3:
Traceback (most recent call last):
File "/home/ly0/anaconda3/envs/pdfgui2/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "diffpy/pdfgui/control/fitting.py", line 102, in run
self.fitting.run()
File "diffpy/pdfgui/control/fitting.py", line 677, in run
calc.start()
File "diffpy/pdfgui/control/calculation.py", line 129, in start
self.calculate()
File "diffpy/pdfgui/control/calculation.py", line 216, in calculate
r, g = pc_temp(nometa(struc))
File "/home/ly0/anaconda3/envs/pdfgui2/lib/python2.7/site-packages/diffpy.srreal-1.2-py2.7-linux-x86_64.egg/diffpy/srreal/structureadapter.py", line 52, in createStructureAdapter
return factory(stru)
File "/home/ly0/anaconda3/envs/pdfgui2/lib/python2.7/site-packages/diffpy.srreal-1.2-py2.7-linux-x86_64.egg/diffpy/srreal/structureconverters.py", line 47, in convertDiffPyStructure
_fetchDiffPyStructureData(adpt, stru)
File "/home/ly0/anaconda3/envs/pdfgui2/lib/python2.7/site-packages/diffpy.srreal-1.2-py2.7-linux-x86_64.egg/diffpy/srreal/structureconverters.py", line 155, in _fetchDiffPyStructureData
aa.atomtype = a0.element
ArgumentError: Python argument types in
None.None(Atom, unicode)
did not match C++ signature:
None(diffpy::srreal::Atom {lvalue}, std::string)

@dragonyanglong dragonyanglong changed the title change atom type in calculation after one run change atom type Sep 21, 2018
@dragonyanglong
Copy link
Owner Author

actually, this problem happens even before the calculation. user cannot change the atom type in the phase panel.

@dragonyanglong
Copy link
Owner Author

problem is. when change the atom type. it becomes unicode type, not str type anymore. we want string type.

a0 in sreal _fetchDiffPyStructureData
C 0.000000 0.500000 0.500000 1.0000
(u'C', <type 'unicode'>)
('Ni', <type 'str'>)
1.0

@dragonyanglong
Copy link
Owner Author

Temp solution:

In difpfy/srreal/structureconverters.py,
https://github.com/diffpy/diffpy.srreal/blob/master/src/diffpy/srreal/structureconverters.py#L144
aa.atomtype = str(a0.element)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant