From 2fc5070eaf4f1876dff3dabee83e5c4a262c8964 Mon Sep 17 00:00:00 2001 From: Szonja Weigl Date: Thu, 3 Feb 2022 07:53:11 +0100 Subject: [PATCH] Update image types docval to add more clarity to dimension order (#1418) Co-authored-by: Ryan Ly --- CHANGELOG.md | 6 +++++- src/pynwb/image.py | 9 ++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4a8a80d6..afb59ecc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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: diff --git a/src/pynwb/image.py b/src/pynwb/image.py index ba26113a3..878e45dfc 100644 --- a/src/pynwb/image.py +++ b/src/pynwb/image.py @@ -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): @@ -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): @@ -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):