Skip to content

Commit

Permalink
chore(loaders): fix type hinting for doc generation
Browse files Browse the repository at this point in the history
otherwise sphinx fails with:

```
  File
  "/home/asinha/Documents/02_Code/00_mine/NeuroML/software/libNeuroML/neuroml/loaders.py",
  line 191, in <module>
      ) -> neuroml.nml.nml.NeuroMLDocument:
      AttributeError: module 'neuroml' has no attribute 'nml'

```

Not sure what the root cause is, but this tweak fixes it.
  • Loading branch information
sanjayankur31 committed Aug 17, 2023
1 parent 112c56b commit 815bfae
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions neuroml/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from neuroml.nml.nml import parseString as nmlparsestring

import neuroml
from neuroml import (NeuroMLDocument)
import neuroml.utils as utils

import os
Expand All @@ -18,7 +19,7 @@ class NeuroMLLoader(object):
@classmethod
def load(cls, src):
doc = cls.__nml2_doc(src)
if isinstance(doc, neuroml.nml.nml.NeuroMLDocument):
if isinstance(doc, NeuroMLDocument):
return doc
else:
raise TypeError(
Expand Down Expand Up @@ -188,7 +189,7 @@ def read_neuroml2_file(
already_included: list = None,
print_method: Callable = neuroml.print_,
optimized: bool = False,
) -> neuroml.nml.nml.NeuroMLDocument:
) -> NeuroMLDocument:
"""
Read a NeuroML2 file into a NeuroMLDocument object
Expand Down Expand Up @@ -234,7 +235,7 @@ def read_neuroml2_string(
print_method: Callable = neuroml.print_,
optimized: bool = False,
base_path: Optional[str] = None,
) -> neuroml.nml.nml.NeuroMLDocument:
) -> NeuroMLDocument:
"""
Read a NeuroML2 string into a NeuroMLDocument object
Expand Down Expand Up @@ -277,7 +278,7 @@ def _read_neuroml2(
print_method: Callable = neuroml.print_,
optimized: bool = False,
base_path: Optional[str] = None,
) -> neuroml.nml.nml.NeuroMLDocument:
) -> NeuroMLDocument:
"""
Read a NeuroML2 file or string into a NeuroMLDocument object.
Expand Down

0 comments on commit 815bfae

Please sign in to comment.