-
Notifications
You must be signed in to change notification settings - Fork 14
Associate file extensions supported by default in napari (no plugins needed) #284
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
Conversation
Demo this locally:
|
napari-menu-0.6.5dev16+ga5632f588-pyh803a8fc_0.conda.zip Also attached here so no auth is required, remove the |
On Linux, I can get our XPRA image to do this just by installing these shortcuts 🚀
Now let's see if this flies on Windows. Edit: yes, but I can't figure out how to get a better icon there (turns out to not be possible) ![]() |
for more information, see https://pre-commit.ci
"file_extensions": [ | ||
".bmp", | ||
".gif", | ||
".jpeg", | ||
".jpg", | ||
".npy", | ||
".npz", | ||
".png", | ||
".tif", | ||
".tiff", | ||
".zarr" | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Picked a few to get started, but I'd like to know which ones we should include @napari/core-devs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We generate the full list by running the gen_extension()
function from https://github.com/napari/napari/blob/5d6ab46f836a3a4ac97cb3c4324671209b99d6ae/tools/check_extensions.py.
The list is pasted in https://github.com/brisvag/napari/blob/5d6ab46f836a3a4ac97cb3c4324671209b99d6ae/src/napari_builtins/builtins.yaml#L146.
I'm a little sad that we can't include bioformats in the extension list. Since we can't modify this list based on plugins, here's a proposed path forward:
What do you think @jaimergp @psobolewskiPhD @Czaki? Does this plan sound feasible? Overall though — awesome work @jaimergp!!! 😍🤩 |
Technically we can, but we need to do that from
That might become a HUGE list, but maybe not? Let's see, I used the attached script to generate this list:
Some of them need to be cleaned up, but you get the point. The other suggestions may be doable with some effort. I guess most of that would be through the plugin manager. Maybe we can have a second plugin that acts as a meta-reader and auto-install+dispatches. Maybe that second plugin is the plugin manager itself. Maybe that's too meta. |
😂 |
To me this list seems manageable. We need to get rid of placeholders, possibly URL prefixes but maybe not? Since the plugin manager infrastructure needs to be updated, I suggest we start with builtins, merge that for 0.6.5, then aim to have the full list with the helpful error messages for 0.7.0. Thoughts? |
I think this makes sense even if we don't proceed with the plugin support, so let's make sure we have a list we like here and then I'll open the corresponding PR in |
I don't know. I defer to @psobolewskiPhD @TimMonko. For me, .tiff and .zarr would already be huge. I think it's probably safe to add all of them but that means like 90% of them are effectively untested by us so we just have to trust that things will work? 😬 |
This is awesome, but is it worth the lift? I know some users would think so in the end, but it's quite big it seems.
I think we should add all supported by builtins. AFAIK, it just means that operating systems recognizes that napari is an option to load the file, it's not like it forces anything. I think it's also a plus that certain file types might not load correctly, maybe users will open an issue to let us know. But in all the years I've survived on open source software I've found many times where extension support doesn't work (often version mismatches and stuff) -- it has seemed to be expected behavior, never fussed me, and I just moved forward knowing the nature of the beast. Maybe I'm an odd duck for having mostly relied on FOSS my whole life. |
I added all builtin-supported extensions now. |
I actually don't think it's that huge a lift, particularly because it sits "outside" the napari architecture. I think it's a very nice usability enhancement. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this! Code looks good but don't have time to pull it locally.
I have enabled PR artifacts so it's easy to test locally @willingc. I'll paste the link once available. |
Is this close to ready and 0.6.5 material? |
tested artifact on Windows. :) A csv of rat hematology data (so not like shapes), mp4, mov all were recognized as openable, opened napari, but the image/movie did not load. There was warning given to the user, etc. I did try to open a tiff with absolutely horrible metadata and napari opened and then quietly crashed -- that seems to be the part thats most problematic (these come from the most pain in the ass proprietary microscope ever) I don't think this should be a blocker by any means, as I mentioned previously. It's a huge QOL improvement that should help in most expected cases. We should just open issues if we merge before these are resolved. (Perhaps the most confusing "it's broken, I guess, but awesome anyways" approval I've ever done) |
In the case of macOS, the multiple instances of napari has to do with this issue: napari/napari#8312. Not sure what the equivalent would be on Windows. Maybe is a simple launcher that finds opened napari processes and then dispatches some sort of event to one of them. |
Does that tiff open if invoked from the CLI? |
Oops, we missed this for 0.6.5. 😅 My proposal is that we merge this and then see whether we can make some progress on #296 over the coming couple of months. This would be an amazing headline feature for napari 0.7.0. 🚀 |
And does it open with napari-tiff installed? |
I'm a bit confused and concerned. I re-downloaded the artifcat (the same one) and I'm struggling to open anything this time. I've only been able to open one tiff. Not even pngs or anything. Everything just quietly exits. Maybe a computer restart will help, but thats a tomorrow problem. |
Any updates @TimMonko? How did you uninstall the previous one? Did you use the uninstaller? Or did you just install things on top? |
I have like 2 minutes to reply @jaimergp, apologies |
I say we give it a try and merge so we can gather more feedback as people begin to use it, what do you think @TimMonko? |
Yes, agreed. |
I'll let @brisvag merge then! |
# References and relevant issues # Description Brings changes from napari/packaging#284 over
Closes #215
References used to find predefined mime types and UTIs:
glob_patterns
andUTExportedTypeDeclarations
, respectively.