pynwb icon indicating copy to clipboard operation
pynwb copied to clipboard

Enh/getcachednamespaces

Open oruebel opened this issue 3 years ago • 8 comments

Motivation

#1431

Relate to https://github.com/dandi/dandi-cli/issues/917

This PR extracts the code to determine the cached extension namespace to use for validation from the main function of the command line validator to a separate function so that the code can be used outside to validate files against cached namespaces.

Checklist

  • [x] Did you update CHANGELOG.md with your changes?
  • [X] Have you checked our Contributing document?
  • [X] Have you ensured the PR clearly describes the problem and the solution?
  • [X] Is your contribution compliant with our coding style? This can be checked running flake8 from the source directory.
  • [X] Have you checked to ensure that there aren't other open Pull Requests for the same change?
  • [X] Have you included the relevant issue number using "Fix #XXX" notation where XXX is the issue number? By including "Fix #XXX" you allow GitHub to close issue #XXX when the PR is merged.

oruebel avatar Feb 18 '22 20:02 oruebel

@rly this issue would be good to address in the next minor release

oruebel avatar Feb 23 '22 21:02 oruebel

Codecov Report

Merging #1432 (f5ab53d) into dev (4460a1b) will decrease coverage by 0.08%. The diff coverage is 0.00%.

@@            Coverage Diff             @@
##              dev    #1432      +/-   ##
==========================================
- Coverage   78.42%   78.34%   -0.09%     
==========================================
  Files          37       37              
  Lines        2777     2780       +3     
  Branches      493      493              
==========================================
  Hits         2178     2178              
- Misses        518      521       +3     
  Partials       81       81              
Impacted Files Coverage Δ
src/pynwb/validate.py 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4460a1b...f5ab53d. Read the comment docs.

codecov[bot] avatar Mar 17 '22 03:03 codecov[bot]

@oruebel what do you think about also extracting most of the code in __main__ in src/pynwb/validate.py to a function that takes as inputs the arguments passed into the CLI function. Then a user can basically call the CLI script using Python without using the shell.

rly avatar Mar 17 '22 19:03 rly

what do you think about also extracting most of the code in __main__ in src/pynwb/validate.py to a function

that makes sense

oruebel avatar Mar 17 '22 19:03 oruebel

We agreed to incorporate this feature into validate

bendichter avatar Mar 22 '22 17:03 bendichter

would this PR be merged/released some time soon?

yarikoptic avatar Jun 29 '22 21:06 yarikoptic

@yarikoptic I'm close to finishing something very similar that also integrates with the dandi.pynwb_utils.validate, look for that in next day or so

CodyCBakerPhD avatar Jun 30 '22 00:06 CodyCBakerPhD

Pointed out some minor coding improvements.

Thanks, @jwodder !

rly avatar Jun 30 '22 19:06 rly

this one is open since July -- any plans to finalize/release it ?

yarikoptic avatar Oct 31 '22 14:10 yarikoptic

this one is open since July -- any plans to finalize/release it ?

@yarikoptic thanks for following up. I think this one got put on hold while #1494 was being worked out and I think that PR may potentially already address that issue. I'll bring it up during our developer meeting tomorrow to see whether this PR should be merged or whether it should be closed in favor of #1494

oruebel avatar Nov 01 '22 00:11 oruebel

@yarikoptic This has indeed already been merged in https://github.com/NeurodataWithoutBorders/pynwb/pull/1511, this can be closed here and I'll get a PR up on the dandi-cli to adjust the API calls to have this functionality

CodyCBakerPhD avatar Nov 01 '22 16:11 CodyCBakerPhD

Closing this PR since this has been addressed in https://github.com/NeurodataWithoutBorders/pynwb/pull/1511

oruebel avatar Nov 01 '22 17:11 oruebel