nomad-coe / electronic-parsers

Apache License 2.0
18 stars 7 forks source link

w2dynamics test failing #136

Closed JosePizarro3 closed 12 months ago

JosePizarro3 commented 12 months ago

@ladinesa , @lauri-codes pointed out that the test_w2dynamics.py is failing after my last merge. The part failing is the last one about asserting the Fermi energy (it happens locally too):

 >       assert sec_scf[0].energy.fermi.to('eV').magnitude == approx(14.15922513307991)
E       AttributeError: 'NoneType' object has no attribute 'fermi'

Strangely, I was debugging with VSCode to this file, and I can retrieve the value as in the test. When uploading the file to the local nomad installation, I can see:

Screenshot from 2023-07-20 13-08-42

I can deactivate the test, but if you have any ideas why, I can try to implement the fix.

ladinesa commented 12 months ago

I can have a look later today. do you know if this was working when it was still skipped?

ladinesa commented 12 months ago

I think the reason is archive is missing m_context. For local tests to pass, you should put the assignment of the energy fermi out of the loop since it does not use the context for the hdf storage..

JosePizarro3 commented 12 months ago

Ok, I can leave the tests out. Thanks a lot for pointing this out.