diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index b48e3dc..023f8fa 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -10,6 +10,9 @@ on: types: - published +permissions: + contents: write + jobs: build: # only build and deploy docs if the actor is not dependabot diff --git a/.readthedocs.yaml b/.readthedocs.yaml index c6edbf3..43dd221 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,7 +1,4 @@ -# Read the Docs configuration file -# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details - -# Required +--- version: 2 build: @@ -14,8 +11,10 @@ build: post_create_environment: - pip install uv post_install: - - uv sync --group docs + - uv pip install -e . + - uv export --group docs --no-hashes --no-emit-project | + uv pip install -r - -# Build documentation in the "docs/" directory with Sphinx sphinx: + builder: html configuration: docs/src/conf.py diff --git a/docs/src/notebooks/walkthrough.ipynb b/docs/src/notebooks/walkthrough.ipynb index 208bcd5..b552f65 100644 --- a/docs/src/notebooks/walkthrough.ipynb +++ b/docs/src/notebooks/walkthrough.ipynb @@ -14,13 +14,13 @@ "\n", "By the end of this notebook you will have:\n", "\n", - "1. **Generated synthetic 3D image data** — two channels (a compact nuclear stain and a diffuse marker with per-object colocalization) and a ground-truth label mask\n", - "2. **Explored the data interactively** — browsed the z-stack volume with a slice-by-slice viewer\n", - "3. **Loaded image sets and objects** — configured `ImageSetLoader`, `ObjectLoader`, and `TwoObjectLoader` to feed data into the pipeline\n", - "4. **Extracted six feature classes** — colocalization, granularity, intensity, neighbors, texture, and volume/size/shape\n", + "1. **Generated synthetic 3D image data**: two channels (a compact nuclear stain and a diffuse marker with per-object colocalization) and a ground-truth label mask\n", + "2. **Explored the data interactively**: browsed the z-stack volume with a slice-by-slice viewer\n", + "3. **Loaded image sets and objects**: configured `ImageSetLoader`, `ObjectLoader`, and `TwoObjectLoader` to feed data into the pipeline\n", + "4. **Extracted six feature classes**: colocalization, granularity, intensity, neighbors, texture, and volume/size/shape\n", "5. **Merged all features** into a single profile DataFrame with one row per object, following the ZEDprofiler naming convention\n", - "6. **Normalized and feature selected** the profile using [`Pycytominer`](https://pycytominer.readthedocs.io) — z-scoring features and removing low-variance and redundant columns\n", - "7. **Visualized pairwise object similarity** — computed and plotted a Pearson correlation heatmap across all objects\n", + "6. **Normalized and feature selected** the profile using [`Pycytominer`](https://pycytominer.readthedocs.io): z-scoring features and removing low-variance and redundant columns\n", + "7. **Visualized pairwise object similarity**: computed and plotted a Pearson correlation heatmap across all objects\n", "\n", "Each section includes a brief description of what is being computed and what the key parameters control." ] @@ -47,20 +47,7 @@ ] } ], - "source": [ - "import logging\n", - "import pathlib\n", - "\n", - "import numpy as np\n", - "import pandas as pd\n", - "import tifffile\n", - "from itables import show\n", - "\n", - "import zedprofiler\n", - "from zedprofiler.IO import loading_classes\n", - "\n", - "logging.basicConfig(level=logging.INFO)" - ] + "source": "import warnings\nimport logging\nimport pathlib\n\nimport numpy as np\nimport pandas as pd\nimport tifffile\nfrom itables import show\n\nimport zedprofiler\nfrom zedprofiler.IO import loading_classes\n\nlogging.basicConfig(level=logging.WARNING)\nlogging.getLogger(\"matplotlib\").setLevel(logging.WARNING)\nwarnings.filterwarnings(\"ignore\", category=SyntaxWarning, module=\"mahotas\")" }, { "cell_type": "markdown", @@ -72,7 +59,7 @@ "This walkthrough uses synthetically generated 3D arrays so it runs anywhere without real microscopy data.\n", "Two random intensity channels and a label mask are generated from spherical objects placed at known positions.\n", "\n", - "The `channel_mapping` dictionary maps logical names to substrings found in your image filenames — ZEDprofiler uses these keys to identify which file corresponds to which channel or segmentation label.\n", + "The `channel_mapping` dictionary maps logical names to substrings found in your image filenames: ZEDprofiler uses these keys to identify which file corresponds to which channel or segmentation label.\n", "\n", "*Expand the cells below to see how paths are configured and how the synthetic data is generated.*" ] @@ -131,8 +118,8 @@ "rng = np.random.default_rng(seed=42)\n", "\n", "# --- build label mask and intensity channels ---\n", - "# Channel 1: nuclear stain — compact, bright signal confined to each nucleus\n", - "# Channel 2: diffuse stain — partially overlaps each nucleus to a varying degree,\n", + "# Channel 1: nuclear stain: compact, bright signal confined to each nucleus\n", + "# Channel 2: diffuse stain: partially overlaps each nucleus to a varying degree,\n", "# simulating a cytoplasmic/organelle marker with per-object colocalization\n", "nuclei_labels = np.zeros(VOLUME_SHAPE, dtype=np.uint16)\n", "channel1_array = np.zeros(VOLUME_SHAPE, dtype=np.float32)\n", @@ -162,13 +149,13 @@ " nucleus_mask = dist <= r\n", " nuclei_labels[nucleus_mask] = obj_id\n", "\n", - " # Channel 1 — compact nuclear signal with fine texture\n", + " # Channel 1: compact nuclear signal with fine texture\n", " ch1_base = rng.uniform(0.7, 1.0)\n", " channel1_array[nucleus_mask] = ch1_base + rng.normal(\n", " 0, 0.06, size=nucleus_mask.sum()\n", " )\n", "\n", - " # Channel 2 — diffuse stain with per-object colocalization strength\n", + " # Channel 2: diffuse stain with per-object colocalization strength\n", " # coloc_strength controls how much signal sits inside vs outside the nucleus\n", " coloc_strength = rng.uniform(0.15, 0.95)\n", " diffuse_r = r * rng.uniform(1.3, 2.0)\n", @@ -229,7 +216,7 @@ "data": { "text/html": [ "