Skip to content

Commit

Permalink
WIP: Ensure all specs are validated (#526)
Browse files Browse the repository at this point in the history
* Include data_type property on dataset and group specs

* Ref #507
* This property facilitates validating builders against specs

* Include additional validator unit tests

* Ref #507

* WIP Refactor GroupValidator and update logic to pass unit tests

* Ref #507
* Resolves the first two points of #507
* Many comments were added during refactoring to help with understanding
  these comments will be removed before the branch is ready to merge

* Add new unit tests for the validator

* Ref #507
* These unit tests are not currently passing but should by by the end of this issue

* Refactor GroupValidator and update matching between builder and spec

* Ref #507
* Now passes all tests
* The code will be further refactored and clean up before it is ready

* Refactor GroupValidator and SpecMatcher and add documentation

* Ref #507

* Clean up extraneous comments

* Refactor out IllegalLinkError creation to be consistent with other error creation

* Update changelog
  • Loading branch information
dsleiter authored Feb 26, 2021
1 parent cd47e54 commit 45dee5c
Show file tree
Hide file tree
Showing 6 changed files with 492 additions and 103 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Bug fixes
- Fix CI testing on Python 3.9. @rly (#523)
- Fix certain edge cases where `GroupValidator` would not validate all of the child groups or datasets
attached to a `GroupBuilder`. @dsleiter (#526)

## HDMF 2.4.0 (February 23, 2021)

Expand Down
7 changes: 6 additions & 1 deletion src/hdmf/spec/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,14 +483,19 @@ def def_key(cls):

@property
def data_type_inc(self):
''' The data type of this specification '''
''' The data type this specification inherits '''
return self.get(self.inc_key())

@property
def data_type_def(self):
''' The data type this specification defines '''
return self.get(self.def_key(), None)

@property
def data_type(self):
''' The data type of this specification '''
return self.data_type_def or self.data_type_inc

@property
def quantity(self):
''' The number of times the object being specified should be present '''
Expand Down
Loading

0 comments on commit 45dee5c

Please sign in to comment.