Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions polze/_polze.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,12 @@ class PZ():
options : dict
Overwrite defaut parameters. The keys should be taken in the defaut
parameters (see below).
status : dict
Returns the status of the computation. The dictionnay contains the
number of warning encountered sorted by category.
The keys are {`multiplicities`, `oo-eig`}.
The default values are 0 (no warning). It could be usefull to monitor
batch computation.
"""

_Npz_limit = 5
Expand Down Expand Up @@ -269,6 +275,8 @@ def __init__(self, fdf, Rmax, Npz, Ni=1024, R0=0., split=0, options=None):
except:
self.f = fdf
self.df = None
# Create a status dict for error and warning report
self.status = {'multiplicities': 0, 'oo-eig': 0}

# dict for caching some data
self._h_cached = {}
Expand Down Expand Up @@ -591,6 +599,7 @@ def solve(self):
NpzFinite = len(D)
logger.warning('Found inf in eig at ' +
f'Ri={Ri}. Keep {NpzFinite} finite eigenvalue on {Npz}.')
self.status['oo-eig'] += 1
else:
NpzFinite = Npz

Expand Down Expand Up @@ -804,6 +813,7 @@ def clean(self, tol=None, split=False):
if (dist_mult_to_int > tol).any():
logger.warning('Some multiplicities are far from integer ' +
f'at Ri={self._Ri[i]}. (Max dist = {dist_mult_to_int.max()}, tol = {tol}).')
self.status['multiplicities'] += 1
# TODO add a sort option
pz.append(self.pz[i][ind])
mu.append(m[ind])
Expand Down
Loading