Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .streamlit/config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[theme]
base = "auto"
primaryColor = "#F63366"
backgroundColor = "#0E1117"
secondaryBackgroundColor = "#262730"
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
## [1.0.2] – 2025-07-08  :dependabot: **“Dependency Update”**
### Changed
- **Streamlit App**:
- Updated `kaleido` dependency to latest version.
- Updated `kaleido` dependency to latest version.

## [1.0.3] – 2025-07-15  :bug: **“Patch Release”**
### Fixed
- **Streamlit Cloud App**:
- Fixed issue with PNG export not working in the latest version of Kaleido, new major version of Kaleido now requires Chromium to be installed. So we have downgraded Kaleido to 0.2.1. We have tried to call `kaleido.get_chrome_sync()` to ensure it works in Streamlit Cloud and other environments, but it is not
possible to call it in the Streamlit Cloud environment, the Streamlit Cloud environment does not allow changing system environment variables like `KALEIDO_CACHE_DIR` or calling `kaleido.get_chrome_sync()`. So we have removed the call to `kaleido.get_chrome_sync()` and set the default format, width, height, and scale for PNG export using `pio.kaleido.scope`. For this we also had to update the `plotly` dependency to `<6.0.0` to ensure compatibility with the `0.2.1` version of `kaleido`.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RUN apt-get update && apt-get install -y \
# Install Python dependencies
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir -e . \
&& pip install --no-cache-dir streamlit plotly matplotlib kaleido
&& pip install --no-cache-dir streamlit "plotly<6.0.0" matplotlib "kaleido<1.0.0"

# Set the Streamlit port
ENV PORT=8501
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ docker build -t merrypopins-app .
# Run the app on http://localhost:8501
docker run -p 8501:8501 merrypopins-app
```
#### 🌐 Option 2: Pull and Run Pre-built Image from Docker Hub
#### 🌐 Option 2: Pull and Run Pre-built Image from Docker Hub (Recommended)

```bash
# Pull the latest pre-built image from Docker Hub
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "merrypopins"
version = "1.0.2"
version = "1.0.3"
description = "Merrypopins: Automated pop-in detection for nano-indentation experiments tooling: load_datasets, preprocess, locate, statistics & make_dataset"
readme = "README.md"
requires-python = ">=3.10,<3.13"
Expand Down
2 changes: 1 addition & 1 deletion src/merrypopins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- `make_dataset`: Construct enriched datasets by running the full pipeline and exporting annotated results and visualizations.
"""

__version__ = "1.0.2"
__version__ = "1.0.3"

# Expose submodules at the package level
from . import load_datasets, preprocess, locate, statistics, make_dataset
Expand Down
17 changes: 4 additions & 13 deletions streamlit_app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import plotly.express as px
import plotly.io as pio
import streamlit as st
import kaleido

from merrypopins.load_datasets import load_txt, load_tdm
from merrypopins.preprocess import (
Expand All @@ -44,14 +43,6 @@
default_statistics_stress_strain,
)

# Ensure Kaleido uses the latest version and has access to Chrome for rendering
# This is necessary for Plotly to export figures as PNGs correctly.
# Note: Kaleido 1.0.0+ requires a Chromium installation to work properly
# This is a workaround to ensure it works in Streamlit Cloud and other environments.
# If you encounter issues with PNG export, ensure you have Chrome installed or use a compatible version
# of Kaleido that does not require Chrome.
kaleido.get_chrome_sync()

# ───────────────────────────────────────────────────────────────
# 1 ∙ PAGE CONFIG & APP‑LEVEL LOGGING
# ───────────────────────────────────────────────────────────────
Expand All @@ -76,10 +67,10 @@

# —— upload and png helper ————————————————————————————
# ── ensure PNG export always uses Kaleido ──────────────────────
pio.defaults.default_format = "png" # <-- new
pio.defaults.default_width = 1000 # optional defaults
pio.defaults.default_height = 600
pio.defaults.default_scale = 2
pio.kaleido.scope.default_format = "png" # <-- new
pio.kaleido.scope.default_width = 1000 # optional defaults
pio.kaleido.scope.default_height = 600
pio.kaleido.scope.default_scale = 2


def _fig_to_png(fig) -> bytes:
Expand Down
4 changes: 2 additions & 2 deletions streamlit_app/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
streamlit
plotly
plotly<6.0.0
pandas
merrypopins
kaleido
kaleido<1.0.0