You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The LoadFileException class is already defined as a stub in brainglobe-utils.image_io (versions 0.4.0 or above), and in brainreg.core.exceptions here as a fuller class.
We should refactor this expanded class into brainglobe-utils, and import it in brainreg.
The text was updated successfully, but these errors were encountered:
willGraham01
changed the title
[BUG] Refactor LoadFileException into brainglobe-utils
[FEATURE] Refactor LoadFileException into brainglobe-utilsFeb 9, 2024
I can look into this issue. Just to double check - the aim would be to replace ImageIOLoadException from brainglobe-utils with LoadFileException from brainreg?
Yeah - if you look at brainreg.core.main you'll see that LoadFileException is thrown after obtaining an error from brainglobe-utils.image_io.load.load_any.
The error thrown by load_any is of type ImageIOLoadException, which doesn't really do anything in terms of offering extra information. It would be better to move what's currently in LoadFileException into ImageIOLoadException, so that the load_img_stack function could then raise this error directly, saving us the try/catch block that we currently have in brainreg.core.main.
LoadFileExcaption also currently takes a error_type argument to __init__, so we can potentially add cases to this in brainglobe-utils to cover other occasions where we throw an error on loading. EG Here we could raise a LoadFileException(error_type="memory") for example.
The
LoadFileException
class is already defined as a stub inbrainglobe-utils.image_io
(versions 0.4.0 or above), and inbrainreg.core.exceptions
here as a fuller class.We should refactor this expanded class into
brainglobe-utils
, and import it inbrainreg
.The text was updated successfully, but these errors were encountered: