Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(plotting): remove dilation if images are large
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 in `default_config.yaml` under `mask_smoothing_params` which indicates the dilation is undertaken during smoothing so perhaps we can simplify the code by calling the `dilate_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 the `default_config.yaml` has been modified to `zrange: [-2, 6]` which results in six tests failing. The `default_config.yaml` has been reverted to `zrange: [null, null]`. This does raise a couple of issues. 1. What should the defaults be in the `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? 2. Use `--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 to `default_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!
- Loading branch information