Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for Ex-row.sum() = 0 when creating first-generation matrix #125

Open
fzeiser opened this issue May 12, 2020 · 0 comments
Open

Allow for Ex-row.sum() = 0 when creating first-generation matrix #125

fzeiser opened this issue May 12, 2020 · 0 comments
Labels
feature_request Requestion this feature
Milestone

Comments

@fzeiser
Copy link
Collaborator

fzeiser commented May 12, 2020

The code here should be slightly changed, such that we allow for rows with sum 0 (which can happen if all nld entries in this row are 0)

ompy/ompy/decomposition.pyx

Lines 215 to 221 in 7edf109

def normalize(np.ndarray[DTYPE_t, ndim=2] matrix):
""" Row-normalizes the matrix
Args:
matrix: The matrix to normalize
"""
matrix /= matrix.sum(axis=1)[:, np.newaxis]

@fzeiser fzeiser added the feature_request Requestion this feature label May 12, 2020
@fzeiser fzeiser added this to the Version 2.0 milestone May 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature_request Requestion this feature
Projects
None yet
Development

No branches or pull requests

1 participant