pyWannier90 icon indicating copy to clipboard operation
pyWannier90 copied to clipboard

Unit test files seems to be not working

Open valay1 opened this issue 3 years ago • 1 comments

When running test files in lib-test, there seems to be a typecasting error, where the libwannier.cpp is not receiving the data type from test-cu.py file.

While running files in examples, each of the files show some errors. Running ch4.py file gives the following error:

Traceback (most recent call last):
  File "ch4.py", line 47, in <module>
    w90.kernel()

  File "/home/valayagarawal/Apps/pyscf/pyscf/pbc/tools/pywannier90.py", line 562, in kernel 
    self.A_matrix_loc = self.get_A_mat()

  File "/home/valayagarawal/Apps/pyscf/pyscf/pbc/tools/pywannier90.py", line 683, in get_A_mat
    gr = g_r(coords, abs_site, l, mr, r, zona, x_axis, z_axis, unit = 'B')

  File "/home/valayagarawal/Apps/pyscf/pyscf/pbc/tools/pywannier90.py", line 309, in g_r
    neither_idx = not larger_idx and not smaller_idx

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Running ch3.py and h2.py gives


Traceback (most recent call last):
  File "ch3.py", line 46, in <module>
    w90 = pywannier90.W90(kmf, cell, nk, num_wann, other_keywords = keywords)
  File "/home/valayagarawal/Apps/pyscf/pyscf/pbc/tools/pywannier90.py", line 477, in __init__
    nao_kpts.append(mo_energy.shape[0])
AttributeError: 'list' object has no attribute 'shape'

Running h2.py generates UNK files, but still has the same error as ch3.py file.

valay1 avatar May 31 '22 21:05 valay1

maybe try neither_idx = np.logical_not(np.logical_or(larger_idx, smaller_idx))

AndresOrtegaGuerrero avatar Aug 08 '24 12:08 AndresOrtegaGuerrero