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

RuntimeWarning: divide by zero encountered in divide #10

Open
luiztauffer opened this issue Aug 20, 2024 · 3 comments
Open

RuntimeWarning: divide by zero encountered in divide #10

luiztauffer opened this issue Aug 20, 2024 · 3 comments

Comments

@luiztauffer
Copy link
Collaborator

These warning pop up a lot during execution of the pipeline. Are these expected, or something that should be fixed?

/voluseg/voluseg/_steps/step4d.py:52: RuntimeWarning: divide by zero encountered in divide
  H *= (timeseries_mean / H.mean(1)[:, None])           # normalize component timeseries
/voluseg/voluseg/_steps/step4d.py:52: RuntimeWarning: invalid value encountered in multiply
  H *= (timeseries_mean / H.mean(1)[:, None])           # normalize component timeseries
retrying factorization of block 1: array must not contain infs or NaNs
(np.float64(0.7999999999999998), np.int64(403))
/voluseg/voluseg/_steps/step4d.py:52: RuntimeWarning: divide by zero encountered in divide
  H *= (timeseries_mean / H.mean(1)[:, None])           # normalize component timeseries
/voluseg/voluseg/_steps/step4d.py:52: RuntimeWarning: invalid value encountered in multiply
  H *= (timeseries_mean / H.mean(1)[:, None])           # normalize component timeseries
retrying factorization of block 3: array must not contain infs or NaNs
(np.float64(0.7999999999999998), np.int64(408))
/voluseg/voluseg/_steps/step4d.py:52: RuntimeWarning: divide by zero encountered in divide
  H *= (timeseries_mean / H.mean(1)[:, None])           # normalize component timeseries
/voluseg/voluseg/_steps/step4d.py:52: RuntimeWarning: invalid value encountered in multiply
  H *= (timeseries_mean / H.mean(1)[:, None])           # normalize component timeseries
retrying factorization of block 0: array must not contain infs or NaNs
(np.float64(0.7999999999999998), np.int64(411))
/voluseg/voluseg/_steps/step4d.py:52: RuntimeWarning: divide by zero encountered in divide
  H *= (timeseries_mean / H.mean(1)[:, None])           # normalize component timeseries
/voluseg/voluseg/_steps/step4d.py:52: RuntimeWarning: invalid value encountered in multiply
  H *= (timeseries_mean / H.mean(1)[:, None])           # normalize component timeseries
retrying factorization of block 2: array must not contain infs or NaNs
(np.float64(0.7999999999999998), np.int64(413))
cell initialization: 0.2 minutes.
@mikarubi
Copy link
Owner

These do not need to be fixed, but are a part of choosing a feasible number of cells segments.

@luiztauffer
Copy link
Collaborator Author

is there a way we can formalize this into an informative warning or suggestion to the users?

@mikarubi
Copy link
Owner

mikarubi commented Aug 22, 2024

yes, the relevant message is returned here:

except ValueError as msg:

the warning typically precedes the error so perhaps it can be caught upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants