-
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
Pass parent properties to extended dataset/attribute #321
base: dev
Are you sure you want to change the base?
Conversation
dtype, shape, dims are passed to extended dataset shape and dims are passed to extended attribute
Codecov Report
@@ Coverage Diff @@
## dev #321 +/- ##
==========================================
+ Coverage 75.42% 75.46% +0.03%
==========================================
Files 33 33
Lines 6646 6664 +18
Branches 1452 1462 +10
==========================================
+ Hits 5013 5029 +16
Misses 1229 1229
- Partials 404 406 +2
Continue to review full report at Codecov.
|
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.
Please fill in the TODOs
if self.dtype is None: | ||
self['dtype'] = inc_spec.dtype | ||
else: | ||
# TODO: test whether child dtype is compatible with parent dtype |
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 check to make sure child is a subset of parent
if self.shape is None: | ||
self['shape'] = inc_spec.shape | ||
elif inc_spec.shape is not None: | ||
# TODO: test whether child shape is compatible with parent shape |
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 check to make sure child is a subset of parent
if my_attribute.shape is None: | ||
my_attribute['shape'] = attribute.shape | ||
else: | ||
# TODO: test whether child shape is compatible with parent shape |
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 check to make sure child is a subset of parent
if my_attribute.dims is None: | ||
my_attribute['dims'] = attribute.dims | ||
else: | ||
# TODO: test whether child dims is compatible with parent dims |
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 check to make sure child is a subset of parent
Fix #320
'dtype'
,'shape'
,'dims'
are passed to extended dataset if not specified'shape'
and'dims'
are passed to extended attribute if not specifiedI also added TODOs in the code for testing compatibility between the extended dataset/attribute's dtype/shape/dims with the parent's values. Should we test for those? If so, I will make a separate issue ticket and PR.
e.g., if the parent dataset has dtype
'int'
, the extending dataset should not be allowed to be defined with dtype'text'
. However, if the parent dataset has dtype'numeric'
, the extending dataset should be allowed to refined the dtype to be'int'
.For shape, I think we should only allow pruning of options, not expansion of options. e.g., if the parent dataset has shape
[None]
, the extending dataset should be allowed to be defined with shape[3]
but not[[None], [None, None]]
.