diff --git a/_data/releases.yaml b/_data/releases.yaml index 67f94c0..26f5731 100644 --- a/_data/releases.yaml +++ b/_data/releases.yaml @@ -27,6 +27,7 @@ c: - {version: 2.1.0, date: 2009-08-18, gz: 1} - {version: 2.0.0, date: 2009-07-16, gz: 1} python: + - {version: 1.4.7, date: 2026-10-23, gz: 1, xz: 1, whl: 1, src_: 1} - {version: 1.4.6, date: 2026-06-07, gz: 1, xz: 1, whl: 1, src_: 1} - {version: 1.4.3, date: 2025-12-03, gz: 1, xz: 1, whl: 1, src_: 1} - {version: 1.4.2, date: 2025-04-28, gz: 1, xz: 1, whl: 1, src_: 1} diff --git a/_includes/news.md b/_includes/news.md index 7ba7c41..27f49f4 100644 --- a/_includes/news.md +++ b/_includes/news.md @@ -1,5 +1,11 @@ {% include links.md %} +## OpenSlide Python version 1.4.7, 2026-10-23 + +[OpenSlide Python 1.4.7][python-1.4.7] adds version-independent wheels for +[free-threaded Python][]. + + ## Binary build 4.0.1.2, 2026-06-19 [Binary build 4.0.1.2][bin-4.0.1.2] reduces binary file sizes and fixes the diff --git a/_scripts/sync-releases.py b/_scripts/sync-releases.py index 6a3c3d8..e945621 100755 --- a/_scripts/sync-releases.py +++ b/_scripts/sync-releases.py @@ -92,9 +92,12 @@ def main() -> None: with TABLES.open() as fh: releases = yaml.safe_load(fh) - # clear docs dir - if DOCROOT.exists(): - shutil.rmtree(DOCROOT) + # compute DOCROOT children owned by projects + project_docs_dirs = { + DOCROOT / proj.docs.subdir + for proj in PROJECTS + if proj.docs and proj.docs.subdir != PurePath() + } for proj in PROJECTS: # get current version from GitHub @@ -118,11 +121,25 @@ def main() -> None: url = f'repos/{proj.repo}/actions/workflows/{proj.docs.workflow}/runs?branch={tag}&event=push&status=completed' run = one(api_request(url)['workflow_runs']) url = f'repos/{proj.repo}/actions/runs/{run["id"]}/artifacts' - artifact = one( + artifacts = [ a for a in api_request(url)['artifacts'] if a['name'].startswith(proj.docs.artifact_prefix) - ) + ] + if not artifacts: + # expired + continue + artifact = one(artifacts) + + # clear docs dir + if proj.docs.subdir == PurePath(): + for child in DOCROOT.iterdir(): + if child.is_file(): + child.unlink() + elif child not in project_docs_dirs: + shutil.rmtree(child) + else: + shutil.rmtree(DOCROOT / proj.docs.subdir) # fetch artifact through third-party service; GitHub wants a # token to fetch artifacts. check hash so we don't have to diff --git a/api/python/sources/index.rst.txt b/api/python/_sources/index.rst.txt similarity index 99% rename from api/python/sources/index.rst.txt rename to api/python/_sources/index.rst.txt index ccbd4f6..d7c1193 100644 --- a/api/python/sources/index.rst.txt +++ b/api/python/_sources/index.rst.txt @@ -15,7 +15,7 @@ closest to a desired zoom level. OpenSlide can read virtual slides in several formats: -* Aperio_ (``.svs``, ``.tif``) +* Aperio_ (``.svs``) * ARGOS_ (``.avs``) * DICOM_ (``.dcm``) * Hamamatsu_ (``.ndpi``, ``.vms``, ``.vmu``) diff --git a/api/python/static/base-stemmer.js b/api/python/_static/base-stemmer.js similarity index 100% rename from api/python/static/base-stemmer.js rename to api/python/_static/base-stemmer.js diff --git a/api/python/static/basic.css b/api/python/_static/basic.css similarity index 100% rename from api/python/static/basic.css rename to api/python/_static/basic.css diff --git a/api/python/static/classic.css b/api/python/_static/classic.css similarity index 100% rename from api/python/static/classic.css rename to api/python/_static/classic.css diff --git a/api/python/static/default.css b/api/python/_static/default.css similarity index 100% rename from api/python/static/default.css rename to api/python/_static/default.css diff --git a/api/python/static/doctools.js b/api/python/_static/doctools.js similarity index 100% rename from api/python/static/doctools.js rename to api/python/_static/doctools.js diff --git a/api/python/static/documentation_options.js b/api/python/_static/documentation_options.js similarity index 93% rename from api/python/static/documentation_options.js rename to api/python/_static/documentation_options.js index 98748de..f469b2b 100644 --- a/api/python/static/documentation_options.js +++ b/api/python/_static/documentation_options.js @@ -1,5 +1,5 @@ const DOCUMENTATION_OPTIONS = { - VERSION: '1.4.6', + VERSION: '1.4.7', LANGUAGE: 'en', COLLAPSE_INDEX: false, BUILDER: 'html', diff --git a/api/python/static/english-stemmer.js b/api/python/_static/english-stemmer.js similarity index 100% rename from api/python/static/english-stemmer.js rename to api/python/_static/english-stemmer.js diff --git a/api/python/static/file.png b/api/python/_static/file.png similarity index 100% rename from api/python/static/file.png rename to api/python/_static/file.png diff --git a/api/python/static/language_data.js b/api/python/_static/language_data.js similarity index 100% rename from api/python/static/language_data.js rename to api/python/_static/language_data.js diff --git a/api/python/static/minus.png b/api/python/_static/minus.png similarity index 100% rename from api/python/static/minus.png rename to api/python/_static/minus.png diff --git a/api/python/static/plus.png b/api/python/_static/plus.png similarity index 100% rename from api/python/static/plus.png rename to api/python/_static/plus.png diff --git a/api/python/static/pygments.css b/api/python/_static/pygments.css similarity index 100% rename from api/python/static/pygments.css rename to api/python/_static/pygments.css diff --git a/api/python/static/searchtools.js b/api/python/_static/searchtools.js similarity index 100% rename from api/python/static/searchtools.js rename to api/python/_static/searchtools.js diff --git a/api/python/static/sidebar.js b/api/python/_static/sidebar.js similarity index 100% rename from api/python/static/sidebar.js rename to api/python/_static/sidebar.js diff --git a/api/python/static/sphinx_highlight.js b/api/python/_static/sphinx_highlight.js similarity index 100% rename from api/python/static/sphinx_highlight.js rename to api/python/_static/sphinx_highlight.js diff --git a/api/python/index.html b/api/python/index.html index 3a75333..87cbe30 100644 --- a/api/python/index.html +++ b/api/python/index.html @@ -5,20 +5,20 @@ -
Aperio (.svs, .tif)
Aperio (.svs)
ARGOS (.avs)
DICOM (.dcm)
Hamamatsu (.ndpi, .vms, .vmu)
with os.add_dll_directory() statement:
# The path can also be read from a config file, etc.
-OPENSLIDE_PATH = r'c:\path\to\openslide-win64\bin'
+OPENSLIDE_PATH = r'c:\path\to\openslide-win64\bin'
import os
-if hasattr(os, 'add_dll_directory'):
+if hasattr(os, 'add_dll_directory'):
# Windows
with os.add_dll_directory(OPENSLIDE_PATH):
import openslide
@@ -92,7 +92,7 @@ Basic usageOpenSlide objects¶
-
-class openslide.OpenSlide(filename: str | bytes | PathLike[Any])¶
+class openslide.OpenSlide(filename: str | bytes | PathLike[Any])¶
An open whole-slide image.
If any operation on the object fails, OpenSlideError is raised.
OpenSlide has latching error semantics: once OpenSlideError is
@@ -115,11 +115,11 @@
Basic usage
-
-classmethod detect_format(filename: str | bytes | PathLike[Any]) str | None¶
+classmethod detect_format(filename: str | bytes | PathLike[Any]) str | None¶
Return a string describing the format vendor of the specified file.
This string is also accessible via the PROPERTY_NAME_VENDOR
property.
-If the file is not recognized, return None.
+If the file is not recognized, return None.
- Parameters:
filename – the file to examine
@@ -134,7 +134,7 @@ Basic usagelevel_count - 1 (lowest resolution).
@@ -145,7 +145,7 @@ Basic usage(width, height) tuple for level 0 of the slide.
@@ -157,7 +157,7 @@ Basic usagelevel_dimensions[k] are the dimensions of level k.
@@ -169,7 +169,7 @@ Basic usagelevel_downsamples[k] is the downsample factor of level k.
@@ -178,12 +178,12 @@ Basic usage
properties¶
Metadata about the slide, in the form of a
-Mapping from OpenSlide property name to
+Mapping from OpenSlide property name to
property value. OpenSlide provides some Standard properties,
plus additional properties that vary by slide format.
@@ -192,12 +192,12 @@ Basic usage
associated_images¶
Images, such as label or macro images, which are associated with this
-slide. This is a Mapping from image
-name to RGBA Image.
+slide. This is a Mapping from image
+name to RGBA Image.
Unlike in the C interface, these images are not premultiplied.
@@ -206,18 +206,18 @@ Basic usage
color_profile¶
The embedded color profile for this slide,
-or None if not available.
+or None if not available.
- Type:
-ImageCmsProfile | None
+ImageCmsProfile | None
-
-read_region(location: tuple[int, int], level: int, size: tuple[int, int]) Image¶
-Return an RGBA Image containing the contents of
+read_region(location: tuple[int, int], level: int, size: tuple[int, int]) Image¶
+
Return an RGBA Image containing the contents of
the specified region.
Unlike in the C interface, the image data is not premultiplied.
@@ -234,7 +234,7 @@ Basic usage
-
-get_best_level_for_downsample(downsample: float) int¶
+get_best_level_for_downsample(downsample: float) int¶
Return the best level for displaying the given downsample.
- Parameters:
@@ -245,8 +245,8 @@ Basic usage
-
-get_thumbnail(size: tuple[int, int]) Image¶
-Return an Image containing an RGB thumbnail of the
+get_thumbnail(size: tuple[int, int]) Image¶
+
Return an Image containing an RGB thumbnail of the
slide.
- Parameters:
@@ -258,7 +258,7 @@ Basic usage
-
-set_cache(cache: OpenSlideCache) None¶
+set_cache(cache: OpenSlideCache) None¶
Use the specified OpenSlideCache to store recently decoded
slide tiles. By default, the OpenSlide has a private cache
with a default size.
@@ -274,7 +274,7 @@ Basic usage
-
-close() None¶
+close() None¶
Close the OpenSlide object.
@@ -286,25 +286,25 @@ Basic usagebytes object in
-Image.info['icc_profile']. If no
+a bytes object in
+Image.info['icc_profile']. If no
profile is available, the icc_profile dictionary key is absent.
To include the profile in an image file when saving the image to disk:
-image.save(filename, icc_profile=image.info.get('icc_profile'))
+image.save(filename, icc_profile=image.info.get('icc_profile'))
To perform color conversions using the profile, import it into
-ImageCms. For example, to synthesize an sRGB profile
+ImageCms. For example, to synthesize an sRGB profile
and use it to transform an image for display, with the default rendering
intent of the image’s profile:
from io import BytesIO
from PIL import ImageCms
-fromProfile = ImageCms.getOpenProfile(BytesIO(image.info['icc_profile']))
-toProfile = ImageCms.createProfile('sRGB')
+fromProfile = ImageCms.getOpenProfile(BytesIO(image.info['icc_profile']))
+toProfile = ImageCms.createProfile('sRGB')
intent = ImageCms.getDefaultIntent(fromProfile)
ImageCms.profileToProfile(
- image, fromProfile, toProfile, intent, 'RGBA', True, 0
+ image, fromProfile, toProfile, intent, 'RGBA', True, 0
)
@@ -312,13 +312,13 @@ Basic usageOpenSlide.color_profile, already parsed into an
-ImageCmsProfile object. You can save processing time
-by building an ImageCmsTransform for the slide and
+ImageCmsProfile object. You can save processing time
+by building an ImageCmsTransform for the slide and
reusing it for multiple slide regions:
-toProfile = ImageCms.createProfile('sRGB')
+toProfile = ImageCms.createProfile('sRGB')
intent = ImageCms.getDefaultIntent(slide.color_profile)
transform = ImageCms.buildTransform(
- slide.color_profile, toProfile, 'RGBA', 'RGBA', intent, 0
+ slide.color_profile, toProfile, 'RGBA', 'RGBA', intent, 0
)
# for each region image:
ImageCms.applyTransform(image, transform, True)
@@ -329,7 +329,7 @@ Basic usage¶
-
-class openslide.OpenSlideCache(capacity: int)¶
+class openslide.OpenSlideCache(capacity: int)¶
An in-memory tile cache.
Tile caches can be attached to one or more OpenSlide objects
with OpenSlide.set_cache() to cache recently-decoded tiles. By
@@ -467,22 +467,22 @@
Exceptions
-
-class openslide.ImageSlide(file: str | bytes | PathLike[Any] | Image)¶
-A wrapper around an Image object that provides an
+class openslide.ImageSlide(file: str | bytes | PathLike[Any] | Image)¶
+
A wrapper around an Image object that provides an
OpenSlide-compatible API.
-
-openslide.open_slide(filename: str | bytes | PathLike[Any]) OpenSlide | ImageSlide¶
+openslide.open_slide(filename: str | bytes | PathLike[Any]) OpenSlide | ImageSlide¶
Return an OpenSlide for whole-slide images and an
ImageSlide for other types of images.
@@ -508,7 +508,7 @@ Exceptions
-
-class openslide.deepzoom.DeepZoomGenerator(osr: AbstractSlide, tile_size: int = 254, overlap: int = 1, limit_bounds: bool = False)¶
+class openslide.deepzoom.DeepZoomGenerator(osr: AbstractSlide, tile_size: int = 254, overlap: int = 1, limit_bounds: bool = False)¶
A Deep Zoom generator that wraps an OpenSlide object,
ImageSlide object, or user-provided instance of
AbstractSlide.
@@ -520,7 +520,7 @@ Exceptionstile_size + 2 * overlap should be a power of two.
overlap – the number of extra pixels to add to each interior edge of a
tile
-limit_bounds – True to render only the non-empty slide region
+limit_bounds – True to render only the non-empty slide region
@@ -530,7 +530,7 @@ Exceptions
- Type:
--
+
-
@@ -541,7 +541,7 @@ Exceptions
- Type:
--
+
-
@@ -553,7 +553,7 @@ Exceptionslevel_tiles[k] are the tile counts of level k.
@@ -565,14 +565,14 @@ Exceptionslevel_dimensions[k] are the dimensions of level k.
-
-get_dzi(format: str) str¶
+get_dzi(format: str) str¶
Return a string containing the XML metadata for the Deep Zoom .dzi
file.
@@ -585,8 +585,8 @@ Exceptions
-
-get_tile(level: int, address: tuple[int, int]) Image¶
-Return an RGB Image for a tile.
+get_tile(level: int, address: tuple[int, int]) Image¶
+Return an RGB Image for a tile.
- Parameters:
@@ -600,7 +600,7 @@ Exceptions
-
-get_tile_coordinates(level: int, address: tuple[int, int]) tuple[tuple[int, int], int, tuple[int, int]]¶
+get_tile_coordinates(level: int, address: tuple[int, int]) tuple[tuple[int, int], int, tuple[int, int]]¶
Return the OpenSlide.read_region() arguments corresponding to the
specified tile.
Most applications should use get_tile() instead.
@@ -617,7 +617,7 @@ Exceptions
-
-get_tile_dimensions(level: int, address: tuple[int, int]) tuple[int, int]¶
+get_tile_dimensions(level: int, address: tuple[int, int]) tuple[int, int]¶
Return a (pixels_x, pixels_y) tuple for the specified tile.
- Parameters:
@@ -743,7 +743,7 @@ Table of Contents
This Page
@@ -754,13 +754,13 @@ This Page