CellProfiling / HPA-Cell-Segmentation

Apache License 2.0
95 stars 26 forks source link

Should edit exception messages #24

Closed ryanlstevens closed 3 years ago

ryanlstevens commented 3 years ago

I've been using segmentator for single image cell segmentation and received a ValueError:

ValueError : Please speicify the image path(s) for er channels!

This was raised by this line in the cellsegmentator.py file

if self.multi_channel_model:
            if not isinstance(er_imgs, list):
                raise ValueError("Please speicify the image path(s) for er channels!")

This condition does not check if er_imgs exists, which is what the error message implies. I suggest adding a new assert + changing the error message:

if self.multi_channel_model:
            if er_imgs is None:
                raise ValueError("Please speicify the image path(s) for er channels!")

            assert isinstance(er_imgs, list)
ryanlstevens commented 3 years ago

Submitted pull request to change section of code