diff --git a/presamples/loader.py b/presamples/loader.py index 126d886..f3be509 100644 --- a/presamples/loader.py +++ b/presamples/loader.py @@ -275,10 +275,13 @@ def update_matrices(self, lca=None, matrices=None, advance_indices=True): elem['indices'][elem['col to label']], ] = sample else: + # filter elementary flows not in database + mask = np.isin(elem['indices'][elem['row to label']],matrix.indices) + existing = elem['indices'][elem['row to label']][mask] matrix[ - elem['indices'][elem['row to label']], - elem['indices'][elem['row to label']], - ] = sample + existing, + existing, + ] = sample[mask] def update_package_indices(self): """Move to next index"""