fix: warning for rank deficient covariance matrix is no longer called

when covobs are involved. Test added.
This commit is contained in:
Fabian Joswig 2022-03-04 17:15:29 +00:00
parent abbb234257
commit c446898932
2 changed files with 10 additions and 1 deletions

View file

@ -1356,7 +1356,7 @@ def covariance(obs, visualize=False, correlation=False, **kwargs):
length = len(obs)
max_samples = np.max([o.N for o in obs])
if max_samples <= length:
if max_samples <= length and not [item for sublist in [o.cov_names for o in obs] for item in sublist]:
warnings.warn(f"The dimension of the covariance matrix ({length}) is larger or equal to the number of samples ({max_samples}). This will result in a rank deficient matrix.", RuntimeWarning)
cov = np.zeros((length, length))