Commit 070444f1 authored by Christoph Groth's avatar Christoph Groth

get rid of deprecation warnings

parent 71cad3a0
Pipeline #16384 passed with stages
in 7 minutes and 42 seconds
......@@ -1945,7 +1945,7 @@ def _transfer_symmetry(syst, builder):
syst._cons_law = operator(vals), operator(vecs)
elif isinstance(cons_law, collections.Mapping):
elif isinstance(cons_law, collections.abc.Mapping):
vals = {family: (value if family.norbs == 1 else
ta.array(np.diag(np.linalg.eigvalsh(value))))
for family, value in cons_law.items()}
......
......@@ -239,9 +239,9 @@ class MUMPSContext:
self.mumps_instance.set_assembled_matrix(a.shape[0], row, col, data)
self.mumps_instance.icntl[7] = orderings[ordering]
self.mumps_instance.job = 1
t1 = time.clock()
t1 = time.process_time()
self.mumps_instance.call()
t2 = time.clock()
t2 = time.process_time()
self.factored = False
if self.mumps_instance.infog[1] < 0:
......@@ -325,9 +325,9 @@ class MUMPSContext:
done = False
while not done:
t1 = time.clock()
t1 = time.process_time()
self.mumps_instance.call()
t2 = time.clock()
t2 = time.process_time()
# error -8, -9 (not enough allocated memory) is treated
# specially, by increasing the memory relaxation parameter
......@@ -492,9 +492,9 @@ def schur_complement(a, indices, ordering='auto', ooc=False, pivot_tol=0.01,
mumps_instance.set_schur(schur_compl, indices)
mumps_instance.job = 4 # job=4 -> 1 and 2 after each other
t1 = time.clock()
t1 = time.process_time()
mumps_instance.call()
t2 = time.clock()
t2 = time.process_time()
if not calc_stats:
return schur_compl
......
......@@ -268,7 +268,7 @@ def _normalize_onsite(syst, onsite, check_hermiticity):
_onsite = _FunctionalOnsite(onsite, syst.sites)
except AttributeError:
_onsite = onsite
elif isinstance(onsite, collections.Mapping):
elif isinstance(onsite, collections.abc.Mapping):
if not hasattr(syst, 'sites'):
raise TypeError('Provide `onsite` as a value or a function for '
'systems that are not finalized Builders.')
......
......@@ -26,7 +26,7 @@ __all__ = ['wraparound', 'plot_2d_bands']
def _hashable(obj):
return isinstance(obj, collections.Hashable)
return isinstance(obj, collections.abc.Hashable)
def _memoize(f):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment