@@ -29,13 +29,12 @@ def _validate_helper(**kwargs):
2929def main (): # noqa: C901
3030
3131 ep = """
32- use --nspath to validate against an extension. If --ns is not specified,
33- validate against all namespaces in namespace file.
32+ If --ns is not specified, validate against all namespaces in the NWB file.
3433 """
3534
3635 parser = ArgumentParser (description = "Validate an NWB file" , epilog = ep )
3736 parser .add_argument ("paths" , type = str , nargs = '+' , help = "NWB file paths" )
38- parser .add_argument ('-p' , '--nspath' , type = str , help = "the path to the namespace YAML file" )
37+ # parser.add_argument('-p', '--nspath', type=str, help="the path to the namespace YAML file")
3938 parser .add_argument ("-n" , "--ns" , type = str , help = "the namespace to validate against" )
4039 parser .add_argument ("-lns" , "--list-namespaces" , dest = "list_namespaces" ,
4140 action = 'store_true' , help = "List the available namespaces and exit." )
@@ -50,15 +49,16 @@ def main(): # noqa: C901
5049 args = parser .parse_args ()
5150 ret = 0
5251
53- if args .nspath :
54- if not os .path .isfile (args .nspath ):
55- print ("The namespace file {} is not a valid file." .format (args .nspath ), file = sys .stderr )
56- sys .exit (1 )
57-
58- if args .cached_namespace :
59- print ("Turning off validation against cached namespace information "
60- "as --nspath was passed." , file = sys .stderr )
61- args .cached_namespace = False
52+ # TODO Validation against a specific namespace file is currently broken. See pynwb#1396
53+ # if args.nspath:
54+ # if not os.path.isfile(args.nspath):
55+ # print("The namespace file {} is not a valid file.".format(args.nspath), file=sys.stderr)
56+ # sys.exit(1)
57+ #
58+ # if args.cached_namespace:
59+ # print("Turning off validation against cached namespace information "
60+ # "as --nspath was passed.", file=sys.stderr)
61+ # args.cached_namespace = False
6262
6363 for path in args .paths :
6464
@@ -87,17 +87,17 @@ def main(): # noqa: C901
8787 specloc = "pynwb namespace information"
8888 print ("The file {} has no cached namespace information. "
8989 "Falling back to {}." .format (path , specloc ), file = sys .stderr )
90- elif args .nspath :
91- catalog = NamespaceCatalog (NWBGroupSpec , NWBDatasetSpec , NWBNamespace )
92- namespaces = catalog .load_namespaces (args .nspath )
93-
94- if len (namespaces ) == 0 :
95- print ("Could not load namespaces from file {}." .format (args .nspath ), file = sys .stderr )
96- sys .exit (1 )
97-
98- tm = TypeMap (catalog )
99- manager = BuildManager (tm )
100- specloc = "--nspath namespace information"
90+ # elif args.nspath:
91+ # catalog = NamespaceCatalog(NWBGroupSpec, NWBDatasetSpec, NWBNamespace)
92+ # namespaces = catalog.load_namespaces(args.nspath)
93+ #
94+ # if len(namespaces) == 0:
95+ # print("Could not load namespaces from file {}.".format(args.nspath), file=sys.stderr)
96+ # sys.exit(1)
97+ #
98+ # tm = TypeMap(catalog)
99+ # manager = BuildManager(tm)
100+ # specloc = "--nspath namespace information"
101101 else :
102102 manager = None
103103 namespaces = [CORE_NAMESPACE ]
0 commit comments