Closed zrqustc closed 4 years ago
@kavanase can you look into this?
Dear @zrqustc,
Thank you for raising this issue and attaching your error log.
It seems that the spin
argument being passed to bs_plotter.py
is not being correctly parsed and converted to a pymatgen Spin.up
object. From your error log, it appears you are using the sumo
Python API functions rather than the command line, and this is what leads to the error.
From inspection of the code and your error log, I can see that the string_to_spin
conversion function (which converts the input --spin
flag to a pymatgen Spin
object) is only applied to the cli argument parser, and so does not convert your spin
argument when directly using the bandplot
function. This is a minor bug which I will fix now.
Thanks again for raising this issue!
Okay, Thanks for your reply.
Best, Ruiqi
On Tue, Mar 10, 2020 at 8:02 AM Seán Kavanagh notifications@github.com wrote:
Dear @zrqustc https://github.com/zrqustc, Thank you for raising this issue and attaching your error log. It seems that the spin argument being passed to bs_plotter.py is not being correctly parsed and converted to a pymatgen Spin.up object. From your error log, it appears you are using the sumo Python API functions rather than the command line, and this is what leads to the error. From inspection of the code and your error log, I can see that the string_to_spin conversion function (which converts the input --spin flag to a pymatgen Spin object) is only applied to the cli argument parser, and so does not convert your spin argument when directly using the bandplot function. This is a minor bug which I will fix now. Thanks again for raising this issue!
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SMTG-UCL/sumo/issues/94?email_source=notifications&email_token=AD4XHGEVW3IJYWYSX2DTHOLRGY26PA5CNFSM4LDMG2O2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOLJ2UA#issuecomment-597073232, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD4XHGDBFTNSX2CSUMQV6F3RGY26PANCNFSM4LDMG2OQ .
This issue should now be fixed in master. Can you try pulling the latest changes in from GitHub and testing again?
Sure, I am going to test now and give you feedback.
Best, Ruiqi
On Tue, Mar 10, 2020 at 12:00 PM Alex Ganose notifications@github.com wrote:
This issue should now be fixed in master. Can you try pulling the latest changes in from GitHub and testing again?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SMTG-UCL/sumo/issues/94?email_source=notifications&email_token=AD4XHGA2OSBLEXJFTOB2LZDRGZW2ZA5CNFSM4LDMG2O2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOMIQTI#issuecomment-597198925, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD4XHGAJEETXLERMBLPCSCLRGZW2ZANCNFSM4LDMG2OQ .
Got a new TypeError.
See the following:
TypeError Traceback (most recent call last)
Dear @zrqustc,
Thank you for the quick feedback. From the TypeError, it is suggesting that the issue is now coming from self._bs.get_vbm()['energy']
being NoneType
, rather than from self._bs.bands[spin]
, which is a float
type as expected. Is your system semiconducting (does it have a well-defined VBM)?
Thanks. My system is metal, not a semiconductor.
On Tue, Mar 10, 2020 at 2:18 PM Seán Kavanagh notifications@github.com wrote:
Dear @zrqustc https://github.com/zrqustc, Thank you for the quick feedback. From the TypeError, it is suggesting that the issue is now coming from self._bs.get_vbm()['energy'] being NoneType, rather than from self._bs.bands[spin], which is a float type as expected. Is your system semiconducting (does it have a well-defined VBM)?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SMTG-UCL/sumo/issues/94?email_source=notifications&email_token=AD4XHGBS3JNJAV6JV5GKTILRG2G7PA5CNFSM4LDMG2O2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOMY54Y#issuecomment-597266163, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD4XHGGOH54QOD5A43MFRGDRG2G7PANCNFSM4LDMG2OQ .
Thanks for the quick reply. The issue is as I expected, the spin-selection functionality of sumo
has been set up to work with semiconducting systems and is currently incompatible with metallic systems. I will update now to include spin-selection capability for metallic systems. Thanks for your patience!
I will submit a fix now.
Great! Thanks for the update.
On Tue, Mar 10, 2020 at 2:26 PM Seán Kavanagh notifications@github.com wrote:
Thanks for the quick reply. The issue is as I expected, the spin-selection functionality of sumo has been set up to work with semiconducting systems and is currently incompatible with metallic systems. I will update now to include spin-selection capability for metallic systems. Thanks for your patience!
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SMTG-UCL/sumo/issues/94?email_source=notifications&email_token=AD4XHGASBKQJB3VZK2FTFEDRG2H63A5CNFSM4LDMG2O2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOMZ4DY#issuecomment-597270031, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD4XHGAC2ZRYGHAZUTGAGQ3RG2H63ANCNFSM4LDMG2OQ .
Ok, I pushed fixes in 027496ccbb811c2da57c162ae2dbed8c76a8ee5e and 0488ce8d4c537aaf10330d0ae8d14619142c299a
Can you please try again and let me know.
Sure. I am testing now and give you feedback later.
On Tue, Mar 10, 2020 at 2:54 PM Alex Ganose notifications@github.com wrote:
Ok, I pushed fixes in 027496c https://github.com/SMTG-UCL/sumo/commit/027496ccbb811c2da57c162ae2dbed8c76a8ee5e and 0488ce8 https://github.com/SMTG-UCL/sumo/commit/0488ce8d4c537aaf10330d0ae8d14619142c299a
Can you please try again and let me know.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SMTG-UCL/sumo/issues/94?email_source=notifications&email_token=AD4XHGAJ74OHRRZN3CFWRLDRG2LIXA5CNFSM4LDMG2O2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOM5APQ#issuecomment-597282878, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD4XHGA2SMY5WNHQLNSVJPDRG2LIXANCNFSM4LDMG2OQ .
Thanks, Alex.
I have tested the code. If I don't use the projection mode, everything is fine. But, when I use the projection mode, it will give this error;
---------------------------------------------------------------------------KeyError
Traceback (most recent call
last)
~/repos/miniconda3/lib/python3.6/site-packages/sumo-1.4.0-py3.6.egg/sumo/electronic_structure/bandstructure.py in get_projections_by_branches(bs, selection, normalise) 70 """ 71 spins = bs.bands.keys()---> 72 projections = get_projections(bs, selection, normalise=normalise) 73 74 branches = [] ~/repos/miniconda3/lib/python3.6/site-packages/sumo-1.4.0-py3.6.egg/sumo/electronic_structure/bandstructure.py in get_projections(bs, selection, normalise) 179 proj = dict(zip(spins, [np.zeros((nbands, nkpts))] * len(spins))) 180 for spin, orbital in it.product(spins, orbitals):--> 181 proj[spin] += dict_proj[element][orbital][spin] 182 183 if normalise == 'select': KeyError: <Spin.up: 1>
On Tue, Mar 10, 2020 at 3:02 PM 张瑞奇 zhangrq2013@gmail.com wrote:
Sure. I am testing now and give you feedback later.
On Tue, Mar 10, 2020 at 2:54 PM Alex Ganose notifications@github.com wrote:
Ok, I pushed fixes in 027496c https://github.com/SMTG-UCL/sumo/commit/027496ccbb811c2da57c162ae2dbed8c76a8ee5e and 0488ce8 https://github.com/SMTG-UCL/sumo/commit/0488ce8d4c537aaf10330d0ae8d14619142c299a
Can you please try again and let me know.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SMTG-UCL/sumo/issues/94?email_source=notifications&email_token=AD4XHGAJ74OHRRZN3CFWRLDRG2LIXA5CNFSM4LDMG2O2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOM5APQ#issuecomment-597282878, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD4XHGA2SMY5WNHQLNSVJPDRG2LIXANCNFSM4LDMG2OQ .
Can you copy and paste the code you are running when you get this error?
Can you also check that your VASP calculation definitely has band structure projections?
Let me test one more example. Maybe it is my mistake.
On Tue, Mar 10, 2020 at 4:25 PM Alex Ganose notifications@github.com wrote:
Can you copy and paste the code you are running when you get this error?
Can you also check that your VASP calculation definitely has band structure projections?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SMTG-UCL/sumo/issues/94?email_source=notifications&email_token=AD4XHGGD7WHXV5NPUNUE6MTRG2V3JA5CNFSM4LDMG2O2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEONHLWA#issuecomment-597325272, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD4XHGCS46LV2727FWBCO6LRG2V3JANCNFSM4LDMG2OQ .
Thanks Alex. All the issues are fixed now. It is my mistake, the first example I test doesn't run normally. Thanks again for your help.
Best regards, Ruiqi
On Tue, Mar 10, 2020 at 4:31 PM 张瑞奇 zhangrq2013@gmail.com wrote:
Let me test one more example. Maybe it is my mistake.
On Tue, Mar 10, 2020 at 4:25 PM Alex Ganose notifications@github.com wrote:
Can you copy and paste the code you are running when you get this error?
Can you also check that your VASP calculation definitely has band structure projections?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SMTG-UCL/sumo/issues/94?email_source=notifications&email_token=AD4XHGGD7WHXV5NPUNUE6MTRG2V3JA5CNFSM4LDMG2O2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEONHLWA#issuecomment-597325272, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD4XHGCS46LV2727FWBCO6LRG2V3JANCNFSM4LDMG2OQ .
Great! Thanks for the bug report.
Dear developers,
When I want to plot one spin channel, I got KeyError: 'up'.
KeyError Traceback (most recent call last)