Skip to content

Commit

Permalink
Update usage of pynwb.validate
Browse files Browse the repository at this point in the history
  • Loading branch information
rly committed Oct 4, 2023
1 parent 3863b62 commit aab701f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def validate_nwbs():

def get_namespaces(nwbfile):
comp = run(["python", "-m", "pynwb.validate",
"--list-namespaces", "--cached-namespace", nwb],
"--list-namespaces", nwbfile],
stdout=PIPE, stderr=STDOUT, universal_newlines=True, timeout=30)

if comp.returncode != 0:
Expand All @@ -179,14 +179,13 @@ def get_namespaces(nwbfile):

cmds = []
cmds += [["python", "-m", "pynwb.validate", nwb]]
cmds += [["python", "-m", "pynwb.validate", "--cached-namespace", nwb]]
cmds += [["python", "-m", "pynwb.validate", "--no-cached-namespace", nwb]]

for ns in namespaces:
# for some reason, this logging command is necessary to correctly printing the namespace in the
# next logging command
logging.info("Namespace found: %s" % ns)
cmds += [["python", "-m", "pynwb.validate", "--cached-namespace", "--ns", ns, nwb]]
cmds += [["python", "-m", "pynwb.validate", "--ns", ns, nwb]]

for cmd in cmds:
logging.info("Validating with \"%s\"." % (" ".join(cmd[:-1])))
Expand Down

0 comments on commit aab701f

Please sign in to comment.