From 65905b093a58ea52d3e0081666a1ed9f9f54e65a Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Sat, 30 May 2026 23:44:14 -0500 Subject: [PATCH 1/2] Sort property name attributes Signed-off-by: Benjamin Gilbert --- doc/index.rst | 50 +++++++++++++++++++++---------------------- openslide/__init__.py | 16 +++++++------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/doc/index.rst b/doc/index.rst index 4b67ac6..ba486f4 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -288,26 +288,34 @@ Standard properties The :mod:`openslide` module provides attributes containing the names of some commonly-used OpenSlide properties. -.. data:: PROPERTY_NAME_COMMENT +.. data:: PROPERTY_NAME_BACKGROUND_COLOR - The name of the property containing a slide's comment, if any. + The name of the property containing a slide's background color, if any. + It is represented as an RGB hex triplet. -.. data:: PROPERTY_NAME_VENDOR +.. data:: PROPERTY_NAME_BOUNDS_HEIGHT - The name of the property containing an identification of the vendor. + The name of the property containing the height of the rectangle bounding + the non-empty region of the slide, if available. -.. data:: PROPERTY_NAME_QUICKHASH1 +.. data:: PROPERTY_NAME_BOUNDS_WIDTH - The name of the property containing the "quickhash-1" sum. + The name of the property containing the width of the rectangle bounding + the non-empty region of the slide, if available. -.. data:: PROPERTY_NAME_BACKGROUND_COLOR +.. data:: PROPERTY_NAME_BOUNDS_X - The name of the property containing a slide's background color, if any. - It is represented as an RGB hex triplet. + The name of the property containing the X coordinate of the rectangle + bounding the non-empty region of the slide, if available. -.. data:: PROPERTY_NAME_OBJECTIVE_POWER +.. data:: PROPERTY_NAME_BOUNDS_Y - The name of the property containing a slide's objective power, if known. + The name of the property containing the Y coordinate of the rectangle + bounding the non-empty region of the slide, if available. + +.. data:: PROPERTY_NAME_COMMENT + + The name of the property containing a slide's comment, if any. .. data:: PROPERTY_NAME_MPP_X @@ -319,25 +327,17 @@ some commonly-used OpenSlide properties. The name of the property containing the number of microns per pixel in the Y dimension of level 0, if known. -.. data:: PROPERTY_NAME_BOUNDS_X - - The name of the property containing the X coordinate of the rectangle - bounding the non-empty region of the slide, if available. - -.. data:: PROPERTY_NAME_BOUNDS_Y +.. data:: PROPERTY_NAME_OBJECTIVE_POWER - The name of the property containing the Y coordinate of the rectangle - bounding the non-empty region of the slide, if available. + The name of the property containing a slide's objective power, if known. -.. data:: PROPERTY_NAME_BOUNDS_WIDTH +.. data:: PROPERTY_NAME_QUICKHASH1 - The name of the property containing the width of the rectangle bounding - the non-empty region of the slide, if available. + The name of the property containing the "quickhash-1" sum. -.. data:: PROPERTY_NAME_BOUNDS_HEIGHT +.. data:: PROPERTY_NAME_VENDOR - The name of the property containing the height of the rectangle bounding - the non-empty region of the slide, if available. + The name of the property containing an identification of the vendor. Exceptions diff --git a/openslide/__init__.py b/openslide/__init__.py index 2683b9f..d025486 100644 --- a/openslide/__init__.py +++ b/openslide/__init__.py @@ -44,17 +44,17 @@ __library_version__ = lowlevel.get_version() -PROPERTY_NAME_COMMENT = 'openslide.comment' -PROPERTY_NAME_VENDOR = 'openslide.vendor' -PROPERTY_NAME_QUICKHASH1 = 'openslide.quickhash-1' PROPERTY_NAME_BACKGROUND_COLOR = 'openslide.background-color' -PROPERTY_NAME_OBJECTIVE_POWER = 'openslide.objective-power' -PROPERTY_NAME_MPP_X = 'openslide.mpp-x' -PROPERTY_NAME_MPP_Y = 'openslide.mpp-y' +PROPERTY_NAME_BOUNDS_HEIGHT = 'openslide.bounds-height' +PROPERTY_NAME_BOUNDS_WIDTH = 'openslide.bounds-width' PROPERTY_NAME_BOUNDS_X = 'openslide.bounds-x' PROPERTY_NAME_BOUNDS_Y = 'openslide.bounds-y' -PROPERTY_NAME_BOUNDS_WIDTH = 'openslide.bounds-width' -PROPERTY_NAME_BOUNDS_HEIGHT = 'openslide.bounds-height' +PROPERTY_NAME_COMMENT = 'openslide.comment' +PROPERTY_NAME_MPP_X = 'openslide.mpp-x' +PROPERTY_NAME_MPP_Y = 'openslide.mpp-y' +PROPERTY_NAME_OBJECTIVE_POWER = 'openslide.objective-power' +PROPERTY_NAME_QUICKHASH1 = 'openslide.quickhash-1' +PROPERTY_NAME_VENDOR = 'openslide.vendor' _T = TypeVar('_T') From 336a200b03ac6f19f7abeca716db790d184860f0 Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Sat, 30 May 2026 23:46:34 -0500 Subject: [PATCH 2/2] Add openslide.barcode property Signed-off-by: Benjamin Gilbert --- doc/index.rst | 4 ++++ openslide/__init__.py | 1 + 2 files changed, 5 insertions(+) diff --git a/doc/index.rst b/doc/index.rst index ba486f4..be55a69 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -293,6 +293,10 @@ some commonly-used OpenSlide properties. The name of the property containing a slide's background color, if any. It is represented as an RGB hex triplet. +.. data:: PROPERTY_NAME_BARCODE + + The name of the property containing a slide's barcode, if any. + .. data:: PROPERTY_NAME_BOUNDS_HEIGHT The name of the property containing the height of the rectangle bounding diff --git a/openslide/__init__.py b/openslide/__init__.py index d025486..0be9a78 100644 --- a/openslide/__init__.py +++ b/openslide/__init__.py @@ -45,6 +45,7 @@ __library_version__ = lowlevel.get_version() PROPERTY_NAME_BACKGROUND_COLOR = 'openslide.background-color' +PROPERTY_NAME_BARCODE = 'openslide.barcode' PROPERTY_NAME_BOUNDS_HEIGHT = 'openslide.bounds-height' PROPERTY_NAME_BOUNDS_WIDTH = 'openslide.bounds-width' PROPERTY_NAME_BOUNDS_X = 'openslide.bounds-x'