dipc-cc / hubbard

Python tools for mean-field Hubbard models
https://dipc-cc.github.io/hubbard/
GNU Lesser General Public License v3.0
21 stars 8 forks source link

sisl.widebandSE error #76

Closed leonardedens closed 3 years ago

leonardedens commented 3 years ago

With test-hubbard-open.py, and many examples, I get AttributeError: module 'sisl' has no attribute 'WideBandSE'. Looking at the documentation of sisl, the correct class to use is sisl.physics.WideBandSE instead of sisl.WideBandSE. My packages: sisl 0.10.0 py38h1b0416a_0 conda-forge python 3.8.8 hdb3f193_4 scipy 1.6.2 py38h91f5cce_0 numpy 1.19.2 py38h54aff64_0

Full error message:

Traceback (most recent call last):

File "/home/leo/Documents/hubbard/tests/test-hubbard-open.py", line 39, in negf = NEGF(MFH_HC, [(MFH_elec, '-A'), (MFH_elec, '+A')], elec_indx)

File "/opt/anaconda3/lib/python3.8/site-packages/hubbard/negf.py", line 158, in init if all(map(lambda obj: isinstance(obj, sisl.WideBandSE), self.elec_SE)):

File "/opt/anaconda3/lib/python3.8/site-packages/hubbard/negf.py", line 158, in if all(map(lambda obj: isinstance(obj, sisl.WideBandSE), self.elec_SE)):

AttributeError: module 'sisl' has no attribute 'WideBandSE'

zerothi commented 3 years ago

You need to update sisl. 0.11.0 is out. Agreed, this should update this in the setup.py (I'll make a PR).

sofiasanz commented 3 years ago

Shall we close this issue then?

zerothi commented 3 years ago

I think so, it is a dependency issue that is cleared now.

zerothi commented 3 years ago

Well, actually, it would be nice if @leonardedens confirms that resolves first ;)

zerothi commented 3 years ago

@leonardedens is this resolved? :)

mlorenznano commented 3 years ago

Good morning, so for me even with the updated version of sisl I get an error when I try to run the open-example. The error message is:


> Traceback (most recent call last):
> 
> File "/home/lorenz/Desktop/hubbard-master/examples/open/benchmarks/AGNR-constriction/setup.py", line 70, in <module>
> negf = NEGF(MFH_HC, [(MFH_elec, '-A'), (MFH_elec, '+A')], elec_indx)
> 
> File "/home/lorenz/.local/lib/python3.8/site-packages/hubbard/negf.py", line 158, in __init__
> if all(map(lambda obj: isinstance(obj, sisl.physics.WideBandSE), self.elec_SE)):
> 
> File "/home/lorenz/.local/lib/python3.8/site-packages/hubbard/negf.py", line 158, in <lambda>
> if all(map(lambda obj: isinstance(obj, sisl.physics.WideBandSE), self.elec_SE)):
> 
> AttributeError: module 'sisl.physics' has no attribute 'WideBandSE'
zerothi commented 3 years ago

Could you do:

print(sisl.__version__)
mlorenznano commented 3 years ago

It printed 0.10.0 .

If I do conda list I see that the version is 0.11.0.dev0

zerothi commented 3 years ago

There is definitely a mismatch there... :)

So that is the reason.

Generally mixing conda with pip installed packages is not good. From the looks of it you installed hubbard using pip --user, and that can fix the sisl version to the installed one. So probably do pip remove sisl or something similar (not in conda env).

mlorenznano commented 3 years ago

I can't remember doing anything with pip :) . However I removed sisl again and again installed it with python setup.py install and now I have version 0.11.0. Thanks for the help 👍

zerothi commented 3 years ago

Ok, great. I'll close then. :)