-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add common data structures #134
Conversation
Will this satisfy #60? |
Codecov Report
@@ Coverage Diff @@
## dev #134 +/- ##
=========================================
+ Coverage 69.2% 69.73% +0.53%
=========================================
Files 24 29 +5
Lines 4981 5726 +745
Branches 1143 1351 +208
=========================================
+ Hits 3447 3993 +546
- Misses 1168 1306 +138
- Partials 366 427 +61
Continue to review full report at Codecov.
|
src/hdmf/build/map.py
Outdated
for subspec, value in subspecs.items(): | ||
# FOR SOME REASON, no specs are getting mapped to the 'data' constructor argument |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this comment be removed now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more remnants of debugging
ret = ret['namespaces'] | ||
if self.__cache is None: | ||
self.__cache = self.__read(ns_path) | ||
ret = self.__cache['namespaces'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: caching of the spec by the H5SpecReader should be mentioned in the release notes
src/hdmf/validate/validator.py
Outdated
@@ -152,6 +152,7 @@ class ValidatorMap(object): | |||
def __init__(self, **kwargs): | |||
ns = getargs('namespace', kwargs) | |||
self.__ns = ns | |||
self._ns = ns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was this addition for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remnants of debugging... I'll remove that
{'name': 'colnames', 'type': 'array_data', 'doc': 'the names of the columns in this table', | ||
'default': None}) | ||
def __init__(self, **kwargs): | ||
id, columns, desc, colnames = popargs('id', 'columns', 'description', 'colnames', kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The init for DynamicTable is quite complex. It would be nice to add some documentation to indicate what happens where.
|
||
@staticmethod | ||
def __build_columns(columns, df=None): | ||
tmp = list() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add docstring to describe what __build_columns
does
|
||
@classmethod | ||
def _getter(cls, field): | ||
doc = field.get('doc') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add docstring for _getter
|
||
@staticmethod | ||
def _transform_arg(field): | ||
tmp = field |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add docstring for _transform_arg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. Great job in porting all this functionality over. I added few comments to fix some documentation issues. In addition, it would be useful to also updated the developer docs to mention the submodules in this repo and also describe how to checkout and updated the submodules
Motivation
HDMF is used to build PyNWB. There are some useful data structures in PyNWB that have been moved into HDMF-common for use in other HDMF applications. The class/types that have been moved are DynamicTable and its dependencies. Additionally, a data type for storing compressed row sparse matrices.
These types will be introduced into the HDMF-common schema by hdmf-dev/hdmf-common-schema#1
Fix #60. This also moves some useful functionality from NWBContainer over to the general Container class.
Notable changes:
isinstance(..., Container)
were changed toisinstance(..., AbstractContainer)
.