fix(plotting): remove dilation if images are large #914
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The section which automatically dilated masks had been commented out as part of the refactoring for
better-tracing
. This meant that the related test (tests/test_plottingfuncs.py::test_mask_dilation()
) failed.After discussion it was decided to remove this functionality completely. We have left the
topostats.plottingfuncs.dilate_binary_image()
which may be used elsewhere. It isn't currently but there is an argument/option indefault_config.yaml
undermask_smoothing_params
which indicates the dilation is undertaken during smoothing so perhaps we can simplify the code by calling thedilate_binary_image()
function we have in place with tests and reduce the amount of code within the smoothing module.Further the step which turns a mask with numbered layers to binary (
0
/1
) has been removed because plots now require there to be different layers of masking to differentiate individual molecules.Another issue is that the tests were developed with a value of
zrange: [null, null]
but in this branch thedefault_config.yaml
has been modified tozrange: [-2, 6]
which results in six tests failing. Thedefault_config.yaml
has been reverted tozrange: [null, null]
.This does raise a couple of issues.
main
branch and in releases?When developing features and testing new code it may be desirable to use custom configurations but what should we be using as defaults for releases? What set of values works best for most use cases?
--config <custom_config>.yaml
Directly related to this is that we should not be changing values in
default_config.yaml
when undertaking development. Rather we should use the--config
flag with a custom configuration file. When new options need adding that isn't a problem to add them todefault_config.yaml
but when modifying values it is important to ensure all tests pass.It can take some time to track down and work out the root cause of these test failures!
This partially address the issues highlighted in #850.