Skip to content

Commit

Permalink
Update image types docval to add more clarity to dimension order (#1418)
Browse files Browse the repository at this point in the history
Co-authored-by: Ryan Ly <[email protected]>
  • Loading branch information
weiglszonja and rly authored Feb 3, 2022
1 parent e484bfd commit 2fc5070
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@
### Bug fixes:
- Add `environment-ros3.yml` to `MANIFEST.in` for inclusion in source distributions. @rly (#1398)
- Fix bad error check in ``IntracellularRecordingsTable.add_recording`` when adding ``IZeroClampSeries``. @oruebel (#1410)
- Skip ros3 tests if internet access or the ros3 driver are not available. @oruebel (#1414)
- Skip ros3 tests if internet access or the ros3 driver are not available. @oruebel (#1414)

### Tutorial enhancements:
- Updated the general tutorial to add documentation about the ``Images`` type. @bendichter (#1353)

### Minor improvements:
- Improve constructor docstrings for Image types. @weiglszonja (#1418)


## PyNWB 2.0.0 (August 13, 2021)

### Breaking changes:
Expand Down
9 changes: 6 additions & 3 deletions src/pynwb/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ def __init__(self, **kwargs):
class GrayscaleImage(Image):

@docval(*get_docval(Image.__init__, 'name'),
{'name': 'data', 'type': ('array_data', 'data'), 'doc': 'Data of image. Must be 2D',
{'name': 'data', 'type': ('array_data', 'data'),
'doc': 'Data of grayscale image. Must be 2D where the dimensions represent x and y.',
'shape': (None, None)},
*get_docval(Image.__init__, 'resolution', 'description'))
def __init__(self, **kwargs):
Expand All @@ -205,7 +206,8 @@ class RGBImage(Image):

@docval(*get_docval(Image.__init__, 'name'),
{'name': 'data', 'type': ('array_data', 'data'),
'doc': 'Data of image. Must be 3D where the third dimension has length 3 and represents the RGB value',
'doc': 'Data of color image. Must be 3D where the first and second dimensions represent x and y. '
'The third dimension has length 3 and represents the RGB value.',
'shape': (None, None, 3)},
*get_docval(Image.__init__, 'resolution', 'description'))
def __init__(self, **kwargs):
Expand All @@ -217,7 +219,8 @@ class RGBAImage(Image):

@docval(*get_docval(Image.__init__, 'name'),
{'name': 'data', 'type': ('array_data', 'data'),
'doc': 'Data of image. Must be 3D where the third dimension has length 4 and represents the RGBA value',
'doc': 'Data of color image with transparency. Must be 3D where the first and second dimensions '
'represent x and y. The third dimension has length 4 and represents the RGBA value.',
'shape': (None, None, 4)},
*get_docval(Image.__init__, 'resolution', 'description'))
def __init__(self, **kwargs):
Expand Down

0 comments on commit 2fc5070

Please sign in to comment.