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
9 changes: 9 additions & 0 deletions .github/workflows/deploy-book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ jobs:
run: |
pip install -r docs/requirements.txt

# Defensive cleanup: strip any orphaned ipywidgets state (metadata.widgets
# entries no longer referenced by a cell's widget-view output) before
# building, so stale widget content (e.g. old progress-bar text) can't
# leak into the published HTML even if it was hand-edited back in after
# the lint-notebooks check last ran.
- name: Strip orphaned ipywidgets state
run: |
python scripts/check_notebook_widgets.py --fix

# Build the book
- name: Build the book
run: |
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/lint-notebooks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: lint-notebooks

# Reject notebooks with stale/orphaned ipywidgets state (metadata.widgets
# entries no longer referenced by any cell's widget-view output). Left in
# place, MyST-NB/nbconvert renders that leftover state into the built docs,
# so old widget content (e.g. stale progress-bar text) can silently reappear
# in published pages even after the code that produced it is gone.
on:
pull_request:
paths:
- "**/*.ipynb"
- "scripts/check_notebook_widgets.py"
push:
branches: [main]
paths:
- "**/*.ipynb"
- "scripts/check_notebook_widgets.py"

jobs:
check-notebook-widgets:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Check for orphaned ipywidgets state
run: python scripts/check_notebook_widgets.py
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ dmypy.json

# data
*.zarr
*.zarr.zip
mydask.html

# IDE
.idea/
.idea/

# Claude
.claude/
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
repos:
- repo: local
hooks:
- id: check-notebook-widgets
name: Check for orphaned ipywidgets state in notebooks
description: >-
Fails if a notebook's metadata.widgets state is not referenced by
any cell's widget-view output. Stale state like this is invisible
in the notebook diff but gets rendered into the built docs by
MyST-NB/nbconvert (e.g. old tqdm progress-bar text reappearing).
entry: python scripts/check_notebook_widgets.py
language: system
files: \.ipynb$
7 changes: 5 additions & 2 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
# Learn more at https://jupyterbook.org/customize/config.html

title: ""
author: abTEM developers
author: ""
copyright: ""
logo: images/logo.png
exclude_patterns: ["_templates", "_build", "reference/benchmarks"]
exclude_patterns: ["_templates", "_ext", "_build", "reference/benchmarks"]
only_build_toc_files: false

# Force re-execution of notebooks on each build.
Expand Down Expand Up @@ -42,6 +43,8 @@ sphinx:
- 'sphinx.ext.autosummary'
- 'sphinx_autodoc_typehints'
- 'matplotlib.sphinxext.roles'
local_extensions:
abtem_version_footer: _ext
config:
autosummary_generate: true
templates_path: [ "_templates" ]
Expand Down
25 changes: 25 additions & 0 deletions docs/_ext/abtem_version_footer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""Show the installed abTEM version (the one the docs were built/tested against)
in the page footer, replacing the theme's static copyright notice.
"""


def _set_abtem_version_footer(app, config):
try:
import abtem

version = abtem.__version__
except Exception:
version = "unknown"

theme_options = dict(config.html_theme_options or {})
theme_options["extra_footer"] = (
"<p>Tested against "
'<a href="https://github.com/abTEM/abTEM">abTEM</a>'
f" v{version}.</p>"
)
config.html_theme_options = theme_options


def setup(app):
app.connect("config-inited", _set_abtem_version_footer)
return {"parallel_read_safe": True, "parallel_write_safe": True}
78 changes: 69 additions & 9 deletions docs/abtem/changelog.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,93 @@
# Changelog

Starting the changelog with version 1.0.8.
## Upcoming: major features

Features:
- Energy ensemble support across the codebase (PlaneWave, Probe, SMatrix, Bloch) ([PR #257](https://github.com/abTEM/abTEM/pull/257))
- Significant improvements on simulating large potentials on GPU, alongside minor performance improvements ([PR #269](https://github.com/abTEM/abTEM/pull/269))
- In addition to the Gaussian (G) distribution, now also implemented Lorentzian (L), Voigtian (convolution L * G) and
pseudo-Voigtian (L + G) source-size distributions and filters ([PR #270](https://github.com/abTEM/abTEM/pull/270))
- Support for skewed pixels (non-orthogonal x,y,z cell axes) ([PR #282](https://github.com/abTEM/abTEM/pull/282))
- Linear-scaling PRISM-EELS for core-loss simulations ([PR #289](https://github.com/abTEM/abTEM/pull/289))
- Radially variable detector sensitivity ([PR #283](https://github.com/abTEM/abTEM/pull/283))
- Plasmons: fast `PhaseScramblePlasmons` for multislice and PRISM, and `MonteCarloPlasmons` for Bloch wave
- CBED patterns for Bloch waves ([PR #254](https://github.com/abTEM/abTEM/pull/254))

## 1.0.10

## 1.0.10 (upcoming)
Features:
- Greatly expanded real-space multislice with propagator- and fully-corrected algorithms, as well as backscattered waves
- Updated `BullseyeAperture` to use smoothed aperture edges

- Expanded real-space multislice with propagator- and fully-corrected algorithms, and backscattered waves ([PR #236](https://github.com/abTEM/abTEM/pull/236))
- Related internal function name change: standard multislice is now properly called `FourierMultislice`
- Updated `BullseyeAperture` to use smoothed aperture edges/corners ([PR #266](https://github.com/abTEM/abTEM/pull/266))
- Logarithmic scale display for `DiffractionPatterns` and images ([PR #303](https://github.com/abTEM/abTEM/pull/303))
- Finite-projection integrals 7x faster on CPU ([PR #309](https://github.com/abTEM/abTEM/pull/309))

Documentation:

- Expanded tutorial on real-space multislice
- Depth-profile visualization of potentials in the walkthrough
- Single-file Zarr zip storage, logarithmic display scaling, soft Bullseye apertures, anisotropic
Debye-Waller factors and B-factor conversion helpers
- All published notebooks verified to run with this release

Dependencies:
- Support for Zarr 3 `ZipStore` (requiring `rich` as an additional dependency)
- Deprecated `[gpu]` optional dependency (just asking for `cupy` won't install the correct CUDA version)
- Moved testing, docs, and dev from optional dependencies to groups

- NumPy 2.0 or newer is now required ([PR #245](https://github.com/abTEM/abTEM/pull/245))
- GitHub actions based on `uv` and now cover more versions (including Python 3.14) ([PR #308](https://github.com/abTEM/abTEM/pull/308))
- New branching structure: `dev` for development, `main` for releases (only via PRs from `dev`)
- Support for Zarr 3 `ZipStore` (requiring `zarr>=3.1`)
- Added Zstandard compression of the arrays in the ZipStore at default level 4 (hat tip: quantEM) ([PR #252](https://github.com/abTEM/abTEM/pull/252))
- Deprecated `[gpu]` optional dependency (as just specifying `cupy` will not install the correct CUDA version)
- Moved `testing`, `docs`, and `dev` from optional dependencies to groups
- Narrow Dask version exclusion to !=2025.12.*,!=2026.1.0,!=2026.1.1 ([PR #285](https://github.com/abTEM/abTEM/pull/285))
- Declared `sympy` as an optional dependency (`core-loss` extra), required for core-loss EELS form
factors ([PR #320](https://github.com/abTEM/abTEM/pull/320))


Bugfixes:

- Frozen-phonon ensemble handling ([PR #267](https://github.com/abTEM/abTEM/pull/267) & [PR #292](https://github.com/abTEM/abTEM/pull/292))
- May also have resulted in incorrect behavior with `ensemble_mean = False` for e.g. defocus distributions
- `CrystalPotential` with frozen phonons bugs (especially bad on – luckily rare – eager compute) ([PR #306](https://github.com/abTEM/abTEM/pull/306))
- Minor bugs, unsafe patterns, and dead code ([PR #265](https://github.com/abTEM/abTEM/pull/265))
- Anistropic Debye-Waller factors for Bloch wave ([PR #271](https://github.com/abTEM/abTEM/pull/271))
- Added helper functions to convert between crystallographic B-factors and thermal sigmas
- Added missing `.calculate_exit_waves` for `BlochwaveEnsamble` ([PR #294](https://github.com/abTEM/abTEM/pull/294))
- Silent atom drop when `z`-position lands in SliceIndexedAtoms blind spot ([PR #273](https://github.com/abTEM/abTEM/pull/273))
- Early-exit bug in orthogonalize_cell ([PR #291](https://github.com/abTEM/abTEM/pull/291))
- Fixed broken tutorial workflow for core-loss filtered imaging ([PR #284](https://github.com/abTEM/abTEM/pull/284))
- Minor performance improvements for `transition_potential_scan` ([PR #286](https://github.com/abTEM/abTEM/pull/286))
- `Bullseye` aperture: `ring_width` and `spoke_width` are now validated, rejecting values that previously
produced a silently wrong (solid disk) aperture; docstring corrected to describe the actual fractional
units introduced by the soft-edge redesign ([PR #319](https://github.com/abTEM/abTEM/pull/319))
- Unified the task-level progress bar config key on `diagnostics.task_progress` (Bloch-wave code paths
previously read a different, non-functional key) ([PR #321](https://github.com/abTEM/abTEM/pull/321))

## 1.0.9

Dependencies:

- Support for `scipy>=1.7` and `cupy>=12`.
- Restricted Dask versions (>=2022.12.1,!=2025.12.*,!=2026.1.*") to avoid an issue with Numba in the latest ones
- Restricted Dask versions (`>=2022.12.1,!=2025.12.*,!=2026.1.*"`) to avoid an issue with Numba in the latest ones

## 1.0.8

Starting the changelog with version 1.0.8.

Features:

- Fully featured Bloch-wave simulations
- Simple real-space multislice algorithm
- Fully tested core-loss filtered imaging
- Core-loss filtered imaging
- Structured illumination (custom apertures and phase plates)

Documentation:

- Updated and fixed example gallery
- Appendix on convergence
- Expanded tutorial on orthogonal periodic supercells

Bugfixes:

- Numerous small bugfixes and improvements
14 changes: 11 additions & 3 deletions docs/abtem/contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,21 @@ git clone https://github.com/abtem/abtem
cd abtem
```

Next, install:
Next, install. The development dependencies are declared as [PEP 735 dependency groups](https://peps.python.org/pep-0735/)
(`dev`, `test`, and `docs`), so use a tool that understands them. We recommend [uv](https://docs.astral.sh/uv/),
which is also what our continuous integration uses:

```{code-block}
python -m pip install -e ".[testing,docs]"
uv sync --group test --group docs
```

This will install *ab*TEM locally in your Python environment (we recommend using Conda), along with the packages needed
Alternatively, with a recent pip (25.1 or newer):

```{code-block}
python -m pip install -e . --group test --group docs
```

This will install *ab*TEM locally in your Python environment, along with the packages needed
to test it and the packages for producing documentation.

### Optional: Install the pre-commit hooks
Expand Down
18 changes: 0 additions & 18 deletions docs/getting_started/basics.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
(getting_started:basic_examples)=
# Basic examples

:::{admonition} {material-regular}`engineering;1.5rem;sd-mr-1` Under construction
:class: no-icon
The examples are currently a work in progress.
:::

This is a selection of basic code examples for the most common types of simulations of electron microscopy experiments.

If you have previous experience with multislice simulations, you should be able to jump right in and modify the most
Expand Down Expand Up @@ -88,17 +83,4 @@ the [gallery](user_guide:example_gallery).
```{image} ../user_guide/examples/thumbnails/4d-stem_quickstart.png
:align: center
```
:::

:::{grid-item-card}
:link: examples:prism_quickstart
:link-type: ref
:class-body: text-center
:class-header: bg-light text-center

**PRISM**
^^^
```{image} ../user_guide/examples/thumbnails/prism_quickstart.png
:align: center
```
::::
2 changes: 1 addition & 1 deletion docs/reference/default_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fft: fftw
precision: float32
diagnostics:
# Show the progress bar. Options are 'true', 'false' or 'tqdm'
progress_bar: true
progress_bar: tqdm
# Show the progress of each task. Options are 'true' or 'false'
task_progress: false
dask:
Expand Down
Loading
Loading