Skip to content

Commit

Permalink
typing
Browse files Browse the repository at this point in the history
  • Loading branch information
mavaylon1 committed Apr 3, 2024
1 parent ef0e5ed commit a6d330c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/hdmf/build/classgenerator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from copy import deepcopy
from datetime import datetime, date
import types
import typing

import numpy as np

Expand Down Expand Up @@ -36,7 +37,7 @@ def register_generator(self, **kwargs):
{'name': 'spec', 'type': BaseStorageSpec, 'doc': ''},
{'name': 'parent_cls', 'type': type, 'doc': ''},
{'name': 'attr_names', 'type': dict, 'doc': ''},
{'name': 'post_init_method', 'type': types.Callable, 'default': None,
{'name': 'post_init_method', 'type': typing.Callable, 'default': None,
'doc': 'The function used as a post_init method to validate the class generation.'},
{'name': 'type_map', 'type': 'hdmf.build.manager.TypeMap', 'doc': ''},
returns='the class for the given namespace and data_type', rtype=type)
Expand Down
4 changes: 2 additions & 2 deletions src/hdmf/build/manager.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
from collections import OrderedDict, deque
from copy import copy
import types
import typing

from .builders import DatasetBuilder, GroupBuilder, LinkBuilder, Builder, BaseBuilder
from .classgenerator import ClassGenerator, CustomClassGenerator, MCIClassGenerator
Expand Down Expand Up @@ -505,7 +505,7 @@ def get_container_cls(self, **kwargs):

@docval({"name": "data_type", "type": str, "doc": "the data type to create a AbstractContainer class for"},
{"name": "namespace", "type": str, "doc": "the namespace containing the data_type", "default": None},
{'name': 'post_init_method', 'type': types.Callable, 'default': None,
{'name': 'post_init_method', 'type': typing.Callable, 'default': None,
'doc': 'The function used as a post_init method to validate the class generation.'},
{"name": "autogen", "type": bool, "doc": "autogenerate class if one does not exist", "default": True},
returns='the class for the given namespace and data_type', rtype=type)
Expand Down
4 changes: 2 additions & 2 deletions src/hdmf/common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'''
import os.path
from copy import deepcopy
import types
import typing

CORE_NAMESPACE = 'hdmf-common'
EXP_NAMESPACE = 'hdmf-experimental'
Expand Down Expand Up @@ -137,7 +137,7 @@ def available_namespaces():
@docval({'name': 'data_type', 'type': str,
'doc': 'the data_type to get the Container class for'},
{'name': 'namespace', 'type': str, 'doc': 'the namespace the data_type is defined in'},
{'name': 'post_init_method', 'type': types.Callable, 'default': None,
{'name': 'post_init_method', 'type': typing.Callable, 'default': None,
'doc': 'The function used as a post_init method to validate the class generation.'},
{"name": "autogen", "type": bool, "doc": "autogenerate class if one does not exist", "default": True},
is_method=False)
Expand Down

0 comments on commit a6d330c

Please sign in to comment.