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

[feature] : message in terminal that says which image causes an error when processing multiple files at the same time #887

Open
TFirth2 opened this issue Aug 15, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@TFirth2
Copy link
Collaborator

TFirth2 commented Aug 15, 2024

Is your feature request related to a problem?

Currently, to find an image or images that cause an error in TopoStats you have to run 1 core which stops on the image that causes the error and this is inefficient. If there are multiple error causing images that can be very time consuming.

Describe the solution you would like.

It would be good to run the entire folder and then get a message saying that X image or X image caused the error so these can be dealt with more effectively.

Describe the alternatives you have considered.

I currently batch process image with grain stats off to just view the images and manually remove images that are cut off, blanks or otherwise not good. I then re-run TopoStats for grain stats but then often get stuck on images that won't process to give grain stats.

Additional context

No response

@TFirth2 TFirth2 added the enhancement New feature or request label Aug 15, 2024
@ns-rse
Copy link
Collaborator

ns-rse commented Sep 16, 2024

Thanks for highlighting this @TFirth2

I can fully appreciate how much of a pain this is.

Its like this because of technical debt where we were rushing to get something working quickly and implemented a broad and crude solution and haven't gone back and fixed it yet.

When we write code sometimes errors arise, but we want to handle those errors. In Python that can be done with the try: ... except: ... construct where some code is tried and if an exception (also known as an error) arises it does what is defined under the except: clause.

We have a broad try: ... except: ... around grain finding (see lines 166-184 if interested) although I notice its currently commented out on the main branch which is possibly a hangover from someone debugging (currently checking with @SylviaWhittle ).

The challenge is knowing/anticipating what the possible errors that can occur might be and with only minicircle.spm to work with on developing tests there wasn't much scope for knowing what might crop up.

If you, or anyone else in the lab, have some sample images which cause errors it would be really useful for the developers to have them so we can see what they cause and write finer-grained code to capture these and, hopefully, allow processing of other images to continue.

ns-rse added a commit that referenced this issue Sep 16, 2024
Commit `de517ff6` inadvertently disabled the broad `try: ... except:` within `run_grains()`. This is being reinstated
and will be addressed when #887 is worked on.
ns-rse added a commit that referenced this issue Sep 16, 2024
Commit `de517ff6` inadvertently disabled the broad `try: ... except:` within `run_grains()`. This is being reinstated
and will be addressed when #887 is worked on.
@ns-rse ns-rse added bug Something isn't working and removed bug Something isn't working labels Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants