GithubHelp home page GithubHelp logo

Comments (5)

toloudis avatar toloudis commented on August 11, 2024

I wonder if it would be enough to have:
get_all_readers_for_given_file(filepath)
then loop over readers, try each one, get some string message back about why it didn't work.

from bioio.

SeanLeRoy avatar SeanLeRoy commented on August 11, 2024

The difference between what it does now and what you are proposing being that currently we stop at the first reader that works but it would be ideal to see all working readers? That seems doable & easy to implement

from bioio.

tlambert03 avatar tlambert03 commented on August 11, 2024

If I recall correctly, the main issue was about surfacing why something didn't work (not just that it didn't work). The Bioformats reader is particularly tough because it requires a java runtime, so even if you have bioformats_jarinstalled, but don't have openjdk or the like, then you'll get an error, but the implementation as it was in aicsimageio didn't surface that issue, it just said:

>>> rdr = AICSImage.determine_reader('/Users/talley/Downloads/coupe shg stack_0001.oir')

AICSImage does not support the image:
 '/Users/talley/Downloads/coupe shg stack_0001.oir'. File extension suggests 
format: 'oir'. Install extra format dependency with: `pip install bioformats_jar`. 

when in fact the real issue was only surfaced if you manually went in and tried to instantiate a bioformats reader:

>>> im = BioformatsReader('/Users/talley/Downloads/coupe shg stack_0001.oir')

RuntimeError:
BioformatsReader requires a java executable to be available
in your environment. If you are using conda, you can install
with `conda install -c conda-forge scyjava`.

Note: you may need to reactivate your conda environment after
installing opendjk. If you still have this error, try:

# mac and linux:
export JAVA_HOME=$CONDA_PREFIX

# windows:
set JAVA_HOME=%CONDA_PREFIX%\Library

so, the crux of that issue was more about surfacing useful error messages. Without it, would probably bang their head against a wall saying "I DID install bioformats_jar darn it!"

from bioio.

tlambert03 avatar tlambert03 commented on August 11, 2024

but, I'd need to familiarize myself with whatever equivalent you have for determine_reader here to have a suggestion

from bioio.

evamaxfield avatar evamaxfield commented on August 11, 2024

I wonder if we need better logging / path tracing then?

We should have different errors for ReaderInitError vs UnsupportedFileFormatError?

from bioio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.