tlambert03 / nd2

Full-featured nd2 (Nikon NIS Elements) file reader for python. Outputs to numpy, dask, and xarray. Exhaustive metadata extraction
https://tlambert03.github.io/nd2
BSD 3-Clause "New" or "Revised" License
53 stars 15 forks source link

feat: add `python -m nd2.index` cli #147

Closed tlambert03 closed 1 year ago

tlambert03 commented 1 year ago

outputs something like this:

$ python -m nd2.index tests/data
Screen Shot 2023-06-24 at 1 29 17 PM
usage: index.py [-h] [--recurse] [--glob-pattern GLOB_PATTERN]
                [--sort-by COLUMN_NAME] [--format {table,csv,json}]
                [--include INCLUDE] [--exclude EXCLUDE] [--no-header]
                paths [paths ...]

Create an index of important metadata in ND2 files.

Valid column names are:
['path', 'name', 'version', 'kb', 'acquired', 'experiment', 'dtype', 'shape', 'axes',
'software_name', 'software_version', 'grabber']

positional arguments:
  paths                 Path to ND2 file or directory containing ND2 files.

options:
  -h, --help            show this help message and exit
  --recurse, -r         Recursively search directories
  --glob-pattern GLOB_PATTERN, -g GLOB_PATTERN
                        Glob pattern to search for
  --sort-by COLUMN_NAME, -s COLUMN_NAME
                        Column to sort by. If not specified, the order is not guaranteed.
                        To sort in reverse, append a hyphen.
  --format {table,csv,json}, -f {table,csv,json}
  --include INCLUDE, -i INCLUDE
                        Comma-separated columns to include in the output
  --exclude EXCLUDE, -e EXCLUDE
                        Comma-separated columns to exclude in the output
  --no-header           Don't write the CSV header
codecov[bot] commented 1 year ago

Codecov Report

Merging #147 (aa40fd2) into main (74faef9) will increase coverage by 0.28%. The diff coverage is 95.03%.

:exclamation: Current head aa40fd2 differs from pull request most recent head 6292005. Consider uploading reports for the commit 6292005 to get more accurate results

@@            Coverage Diff             @@
##             main     #147      +/-   ##
==========================================
+ Coverage   92.64%   92.93%   +0.28%     
==========================================
  Files          14       15       +1     
  Lines        1890     2023     +133     
==========================================
+ Hits         1751     1880     +129     
- Misses        139      143       +4     
Impacted Files Coverage Δ
src/nd2/_pysdk/_pysdk.py 89.27% <86.36%> (-0.44%) :arrow_down:
src/nd2/_util.py 88.88% <87.50%> (+1.93%) :arrow_up:
src/nd2/index.py 97.16% <97.16%> (ø)
src/nd2/_pysdk/_chunk_decode.py 85.92% <100.00%> (+1.48%) :arrow_up:
src/nd2/nd2file.py 95.15% <100.00%> (+0.01%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more