Skip to content
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

WIP: nwb_generate_format_docs: Support generating complete documentation #5

Merged
merged 1 commit into from
Apr 9, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions nwb_docutils/generate_format_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
# Python 2/3 compatibility
from __future__ import print_function

import pynwb

from pynwb.form.spec.spec import GroupSpec, DatasetSpec, LinkSpec, AttributeSpec, RefSpec
from pynwb.spec import NWBGroupSpec, NWBDatasetSpec, NWBNamespace
from pynwb.form.spec.namespace import NamespaceCatalog
Expand Down Expand Up @@ -81,11 +83,17 @@ def load_nwb_namespace(namespace_file, default_namespace='core', resolve=spec_re
Load an nwb namespace from file
:return:
"""
namespace = NamespaceCatalog(default_namespace,
group_spec_cls=NWBGroupSpec,
dataset_spec_cls=NWBDatasetSpec,
spec_namespace_cls=NWBNamespace)
namespace.load_namespaces(namespace_file, resolve=resolve)
# namespace = NamespaceCatalog(default_namespace,
# group_spec_cls=NWBGroupSpec,
# dataset_spec_cls=NWBDatasetSpec,
# spec_namespace_cls=NWBNamespace)
# namespace.load_namespaces(namespace_file, resolve=resolve)

# XXX
type_map = pynwb.get_type_map()
type_map.load_namespaces(namespace_file)
namespace = type_map.namespace_catalog

default_spec_catalog = namespace.get_namespace(default_namespace).catalog # TODO check if this should be 'core' or default_namespace?
return namespace, default_spec_catalog

Expand Down