-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Description
This PR addresses several issues identified during the recent test run using pytest for the cooler project.
Addressed warnings:
- Several warnings were issued during the test run, which indicated potential issues or areas where the code could be improved. These warnings include:
- RuntimeWarnings: These were related to operations like empty slices or invalid values encountered during calculations. Specifically, warnings about "mean of empty slice" and "invalid value encountered in scalar divide" were observed. These are typically caused by computations where the data array or slice is empty or contains NaN or infinite values. The code in
cooler/_balance.py(line 119) was adjusted to handle these cases more robustly, ensuring that such warnings are reduced or prevented. - ConvergenceWarnings: In some tests, algorithms didn't converge within the allowed iteration limit. For instance, warnings about "iteration limit reached without convergence" were noted in balancing operations. These warnings were seen in
cooler/_balance.py(line 113). The code has been reviewed, and some optimization options were added to allow for better convergence or more informative messages when convergence issues occur. - UserWarnings: Warnings about non-symmetric matrices when
triucheckwas set toTruewere identified incooler/_reduce.py(line 302). These warnings were caused by operations trying to create symmetric matrices from non-symmetric data. Adjustments were made to ensure that these warnings are avoided or that the behavior is more explicitly controlled (i.e., thetriucheckflag is set toFalsewhen appropriate).
- RuntimeWarnings: These were related to operations like empty slices or invalid values encountered during calculations. Specifically, warnings about "mean of empty slice" and "invalid value encountered in scalar divide" were observed. These are typically caused by computations where the data array or slice is empty or contains NaN or infinite values. The code in
While these warnings don't immediately cause test failures, addressing them improves the stability and clarity of the code, making it easier to maintain and debug in the future.
Metadata
Metadata
Assignees
Labels
No labels