-
Notifications
You must be signed in to change notification settings - Fork 1
Use new plugin priority from bioio to simplify code path #42
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d4982f8
use plugin priority with minimal API changes
TimMonko 0091f0a
just installed plugins priority check, no support check
TimMonko 2fa5098
simplify API and rely on bioio plugin priority
TimMonko efd6ea9
bioio#162 updates with better extensions
TimMonko bac3698
update lock files
TimMonko 7f1b55b
update pixi lock
TimMonko 7b10b98
replace PathLike with str | Path for isinstance
TimMonko dab6cc1
skip zenodo tests on CI
TimMonko a74d782
fix imports
TimMonko 410953a
better isinstance and get_preferred_reader_list
TimMonko a9e85fd
add test coverage for preferred reader pathways
TimMonko 142ecf2
update error message
TimMonko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| import sys | ||
| from pathlib import Path | ||
|
|
||
| from ndevio._bioio_plugin_utils import BIOIO_PLUGINS | ||
|
|
||
| # Ensure src is on path so we can import the package in editable installs | ||
| repo_root = Path(__file__).resolve().parents[1] | ||
| src_path = repo_root / 'src' | ||
| out_dir = Path(__file__).resolve().parent | ||
| if str(src_path) not in sys.path: | ||
| sys.path.insert(0, str(src_path)) | ||
|
|
||
|
|
||
| def normalize_ext(e: str) -> str: | ||
| e = e.strip().lower() | ||
| if e.startswith('.'): | ||
| e = e[1:] | ||
| return e | ||
|
|
||
|
|
||
| def main(): | ||
| exts = set() | ||
| for info in BIOIO_PLUGINS.values(): | ||
| for e in info.get('extensions', []): | ||
| ne = normalize_ext(e) | ||
| if ne: | ||
| exts.add(ne) | ||
|
|
||
| sorted_exts = sorted(exts) | ||
|
|
||
| # Produce napari YAML snippet (pretty, one-per-line quoted) | ||
| patterns = [f"'*.{ext}'" for ext in sorted_exts] | ||
| # Break into lines of ~10 entries for readability | ||
| lines = [] | ||
| chunk = 10 | ||
| for i in range(0, len(patterns), chunk): | ||
| lines.append(' ' + ', '.join(patterns[i : i + chunk]) + ',') | ||
|
|
||
| snippet_file = out_dir / 'napari_patterns_snippet.txt' | ||
| snippet_text = 'filename_patterns: [\n' + '\n'.join(lines) + '\n]\n' | ||
| snippet_file.write_text(snippet_text) | ||
| print(f'Wrote napari snippet to {snippet_file}') | ||
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| main() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| filename_patterns: [ | ||
| '*.1sc', '*.264', '*.265', '*.2fl', '*.3fr', '*.3g2', '*.a64', '*.acff', '*.adp', '*.afi', | ||
| '*.afm', '*.aim', '*.al3d', '*.am', '*.amiramesh', '*.amr', '*.amv', '*.apl', '*.apng', '*.arf', | ||
| '*.arw', '*.asf', '*.avc', '*.avi', '*.avs', '*.avs2', '*.bay', '*.bif', '*.bin', '*.bip', | ||
| '*.bmp', '*.btf', '*.c01', '*.cdg', '*.cfg', '*.cgi', '*.ch5', '*.cif', '*.cr2', '*.crw', | ||
| '*.csv', '*.ct', '*.cxd', '*.czi', '*.dat', '*.dcm', '*.dcr', '*.dib', '*.dip', '*.dir', | ||
| '*.dm2', '*.dm3', '*.dm4', '*.dng', '*.dnxhd', '*.dti', '*.dv', '*.dvd', '*.eps', '*.erf', | ||
| '*.exp', '*.exr', '*.fdf', '*.fff', '*.ffr', '*.fits', '*.flex', '*.fli', '*.frm', '*.gel', | ||
| '*.gif', '*.grey', '*.hdf', '*.hdr', '*.hed', '*.his', '*.htd', '*.html', '*.hx', '*.i2i', | ||
| '*.icb', '*.ics', '*.ids', '*.if', '*.iiq', '*.im3', '*.img', '*.ims', '*.imt', '*.inr', | ||
| '*.ipl', '*.ipm', '*.ipw', '*.ism', '*.jfif', '*.jif', '*.jng', '*.jp2', '*.jpg', '*.jpk', | ||
| '*.jpx', '*.l2d', '*.labels', '*.lei', '*.lif', '*.liff', '*.lim', '*.lms', '*.lsm', '*.mcidas', | ||
| '*.mdb', '*.mnc', '*.mng', '*.mod', '*.mov', '*.mp4', '*.mpo', '*.mrc', '*.mrw', '*.msp', | ||
| '*.msr', '*.mtb', '*.mvd2', '*.naf', '*.nd', '*.nd2', '*.ndpi', '*.ndpis', '*.nef', '*.nhdr', | ||
| '*.nii', '*.nii.gz', '*.nrrd', '*.obf', '*.obsep', '*.oib', '*.oif', '*.oir', '*.ome', '*.ome.btf', | ||
| '*.ome.tf2', '*.ome.tf8', '*.ome.tif', '*.ome.tiff', '*.ome.xml', '*.par', '*.pbm', '*.pcoraw', '*.pcx', '*.pdf', | ||
| '*.pds', '*.pgm', '*.pic', '*.pict', '*.png', '*.pnl', '*.ppm', '*.pr3', '*.ps', '*.psd', | ||
| '*.qptiff', '*.r3d', '*.raw', '*.rcpnl', '*.rec', '*.scn', '*.sdt', '*.seq', '*.sif', '*.sld', | ||
| '*.sldy', '*.sm2', '*.sm3', '*.spc', '*.spe', '*.spi', '*.spider', '*.stk', '*.stp', '*.svs', | ||
| '*.sxm', '*.tf2', '*.tf8', '*.tfr', '*.tga', '*.tif', '*.tiff', '*.tiles.ome.tif', '*.tnb', '*.top', | ||
| '*.txt', '*.v', '*.vms', '*.vsi', '*.vws', '*.wat', '*.wlz', '*.xdce', '*.xml', '*.xqd', | ||
| '*.xqf', '*.xv', '*.xvthumb', '*.xys', '*.zarr', '*.zfp', '*.zfr', '*.zif', '*.zvi', | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,224 @@ | ||
| BIOIO_IMAGEIO_EXTENSIONS = [ | ||
| '264', | ||
| '265', | ||
| '3fr', | ||
| '3g2', | ||
| 'A64', | ||
| 'IMT', | ||
| 'MCIDAS', | ||
| 'PCX', | ||
| 'SPIDER', | ||
| 'XVTHUMB', | ||
| 'a64', | ||
| 'adp', | ||
| 'amr', | ||
| 'amv', | ||
| 'apng', | ||
| 'arw', | ||
| 'asf', | ||
| 'avc', | ||
| 'avi', | ||
| 'avs', | ||
| 'avs2', | ||
| 'bay', | ||
| 'bif', | ||
| 'bmp', | ||
| 'cdg', | ||
| 'cgi', | ||
| 'cif', | ||
| 'ct', | ||
| 'dcr', | ||
| 'dib', | ||
| 'dip', | ||
| 'dng', | ||
| 'dnxhd', | ||
| 'dv', | ||
| 'dvd', | ||
| 'erf', | ||
| 'exr', | ||
| 'fff', | ||
| 'gif', | ||
| 'icb', | ||
| 'if', | ||
| 'iiq', | ||
| 'ism', | ||
| 'jif', | ||
| 'jfif', | ||
| 'jng', | ||
| 'jp2', | ||
| 'jpg', | ||
| 'mov', | ||
| 'mp4', | ||
| 'mpo', | ||
| 'msp', | ||
| 'pdf', | ||
| 'png', | ||
| 'ppm', | ||
| 'ps', | ||
| 'zif', | ||
| ] | ||
|
|
||
| BIOIO_BIOFORMATS_EXTENSIONS = [ | ||
| '.1sc', | ||
| '.2fl', | ||
| '.acff', | ||
| '.afi', | ||
| '.afm', | ||
| '.aim', | ||
| '.al3d', | ||
| '.am', | ||
| '.amiramesh', | ||
| '.apl', | ||
| '.arf', | ||
| '.avi', | ||
| '.bin', | ||
| '.bip', | ||
| '.bmp', | ||
| '.btf', | ||
| '.c01', | ||
| '.cfg', | ||
| '.ch5', | ||
| '.cif', | ||
| '.cr2', | ||
| '.crw', | ||
| '.csv', | ||
| '.cxd', | ||
| '.czi', | ||
| '.dat', | ||
| '.dcm', | ||
| '.dib', | ||
| '.dm2', | ||
| '.dm3', | ||
| '.dm4', | ||
| '.dti', | ||
| '.dv', | ||
| '.eps ', | ||
TimMonko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| '.exp', | ||
| '.fdf', | ||
| '.fff', | ||
| '.ffr', | ||
| '.fits', | ||
| '.flex', | ||
| '.fli', | ||
| '.frm', | ||
| '.gel', | ||
| '.gif', | ||
| '.grey', | ||
| '.hdf', | ||
| '.hdr', | ||
| '.hed', | ||
| '.his', | ||
| '.htd', | ||
| '.html', | ||
| '.hx', | ||
| '.i2i', | ||
| '.ics', | ||
| '.ids', | ||
| '.im3', | ||
| '.img', | ||
| '.ims', | ||
| '.inr', | ||
| '.ipl', | ||
| '.ipm', | ||
| '.ipw', | ||
| '.jp2', | ||
| '.jpg', | ||
| '.jpk', | ||
| '.jpx', | ||
| '.l2d', | ||
| '.labels', | ||
| '.lei', | ||
| '.lif', | ||
| '.liff', | ||
| '.lim', | ||
| '.lms', | ||
| '.lsm', | ||
| '.mdb', | ||
| '.mnc', | ||
| '.mng', | ||
| '.mod', | ||
| '.mov', | ||
| '.mrc', | ||
| '.mrw', | ||
| '.msr', | ||
| '.mtb', | ||
| '.mvd2', | ||
| '.naf', | ||
| '.nd', | ||
| '.nd2', | ||
| '.ndpi', | ||
| '.ndpis', | ||
| '.nef', | ||
| '.nhdr', | ||
| '.nii', | ||
| '.nii.gz', | ||
| '.nrrd', | ||
| '.obf', | ||
| '.obsep', | ||
| '.oib', | ||
| '.oif', | ||
| '.oir', | ||
| '.ome', | ||
| '.ome.btf', | ||
| '.ome.tf2', | ||
| '.ome.tf8', | ||
| '.ome.tif', | ||
| '.ome.tiff', | ||
| '.ome.xml', | ||
| '.par', | ||
| '.pbm', | ||
| '.pcoraw', | ||
| '.pcx', | ||
| '.pds', | ||
| '.pgm', | ||
| '.pic', | ||
| '.pict', | ||
| '.png', | ||
| '.pnl', | ||
| '.ppm', | ||
| '.pr3', | ||
| '.psd', | ||
| '.qptiff', | ||
| '.r3d', | ||
| '.raw', | ||
| '.rcpnl', | ||
| '.rec', | ||
| '.scn', | ||
| '.sdt', | ||
| '.seq', | ||
| '.sif', | ||
| '.sld', | ||
| '.sm2', | ||
| '.sm3', | ||
| '.spc', | ||
| '.spe', | ||
| '.spi', | ||
| '.stk', | ||
| '.stp', | ||
| '.svs', | ||
| '.sxm', | ||
| '.tf2', | ||
| '.tf8', | ||
| '.tfr', | ||
| '.tga', | ||
| '.tif', | ||
| '.tiff', | ||
| '.tnb', | ||
| '.top', | ||
| '.txt', | ||
| '.v', | ||
| '.vms', | ||
| '.vsi', | ||
| '.vws', | ||
| '.wat', | ||
| '.wlz', | ||
| '.xdce', | ||
| '.xml', | ||
| '.xqd', | ||
| '.xqf', | ||
| '.xv', | ||
| '.xys', | ||
| '.zfp', | ||
| '.zfr', | ||
| '.zvi', | ||
| ] | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.