Skip to content

Bring over the unmerged commits of the old v1.1.0 branch (sampling='auto', ePIE removal) - #44

Merged
TomaSusi merged 14 commits into
devfrom
docs/sampling-auto-and-epie-removal
Oct 22, 2026
Merged

TomaSusi merged 14 commits into
devfrom
docs/sampling-auto-and-epie-removal

Conversation

@TomaSusi

Copy link
Copy Markdown
Member

Summary

Brings over the 11 commits that were only on the old v1.1.0 branch (merged as #20 on 2026-08-29, but with 11 more commits added on 2026-08-29/30 that never reached the default branch). They cherry-pick onto dev without conflicts (each commit message carries (cherry picked from commit ...)):

  • Remove the ePIE tutorial and its entries in _toc.yml and references.bib: abtem.reconstruct is no longer in abTEM dev.
  • Use sampling='auto'/slice_thickness='auto' in the walkthroughs (multislice, frozen phonons, scan and detect), the ensembles appendix, the phonon-loss and core-loss tutorials and the quickstart examples; reorder the potentials walkthrough and add gpts as an explicit override of the automatic sampling; the convergence sweep uses explicit gpts.
  • Keep manual sampling where the structure is large or the sampling is the point (structured illumination, PRISM and SAED quickstarts).

None of this is in an open PR (checked the heads of #21 to #24, #32 to #34, #37).

Conflicts with open PRs

Notebook JSON conflicts, to be resolved by whichever PR lands second: #21 (core_loss.ipynb), #24 (references.bib), #32 (ensembles.ipynb, hrtem_quickstart.ipynb) and #37 (phonon_loss.ipynb). #22, #23, #33 and #34 merge cleanly with this branch.

Notebook outputs were not re-executed.

🤖 Generated with Claude Code

TomaSusi and others added 12 commits October 22, 2026 15:34
…moved)

abtem.reconstruct (RegularizedPtychographicOperator and friends) is being
removed from the abTEM main repo. Its only doc-repo usage was
user_guide/tutorials/epie.ipynb, already hidden from _toc.yml -- deleted
along with the commented-out toc entry and the maiden_pie bibliography
entry it was the sole citer of. Checked: no other notebook or doc page
referenced the file, its anchor, its classes, or the citation; build
warnings drop by one (fewer orphaned-notebook toctree warnings) and stay
otherwise unchanged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
(cherry picked from commit 7bb7883)
"Slicing the potential" now comes before "Choosing sampling and slice
thickness automatically", so the auto section can build on the
already-established slice-thickness rule of thumb (0.5-2 A, default 1 A)
instead of restating it. The depth-profile demo inside "Slicing the
potential" built its own local srtio3/repeated_srtio3, shadowing the
walkthrough's shared ones -- harmless in the old order (nothing after it
used those names) but would have fed the wrong structure into the
auto-sampling demo once moved ahead of it, so renamed to
srtio3_depth/repeated_srtio3_depth. Fixed one now-backwards "below" cross-
reference to walkthrough:slicing.

Added a short gpts-as-override note + demo between the auto-sampling
mechanism explanation and the commensurability demo: gpts still works
exactly as before and takes precedence over sampling when given,
composing freely with slice_thickness="auto". Verified gpts=160 (the
grid sampling="auto" picks for this structure) reproduces potential_auto
bit-for-bit.

Re-executed everything from the reordered "Slicing" section onward; all
numbers unchanged from before the reorder.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
(cherry picked from commit 0097c22)
Converts explicit Potential(sampling=..., slice_thickness=...) calls to
'auto' in multislice.ipynb, scan_and_detect.ipynb and frozen_phonons.ipynb,
following the potentials walkthrough's new default recommendation. Each
notebook re-executed end to end; multislice.ipynb's prose already worked
out the same 4.08/2=2.04 A slice thickness by hand, so it now says auto
finds it instead. Fixed several unrelated staleness issues surfaced by
actually re-running frozen_phonons.ipynb for the first time in a while:
prose claiming "99 slices on 512x512" that didn't match the code even
before this change, a mismatched detector label (65 vs 80 mrad), an
integrate_radial(outer=200) that exceeded the antialiasing-limited max
angle by a hair, .tile(2) no longer accepting a bare int, and
common_scale having been renamed to common_color_scale. Also found and
worked around (not fixed -- flagged for a dedicated abTEM session) a
Visualization bug where explicitly passing common_color_scale=False, its
own default, crashes only after enough prior .show() calls have
accumulated in the same kernel session.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
(cherry picked from commit d74a02a)
…gpts

ensembles.ipynb: incidental sampling=0.1/slice_thickness=2 -> auto,
no downstream numeric dependencies.

convergence.ipynb: per instructions, its manual sweeps stay manual (that
is the point of the appendix) but the "Real-space sampling" section now
expresses the swept resolution as gpts=fraction directly instead of
sampling=a/fraction -- gpts = a/sampling here exactly by construction
(a/fraction divides evenly), so passing gpts skips a division and its
rounding, and lines up with the gpts-as-override option documented in
the potentials walkthrough. Also fixed a hardcoded 5.12 that should have
been the variable a (5.43 for this Si cell) in the illustrative print
just above the sweep -- pre-existing, caught while re-executing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
(cherry picked from commit 71afb88)
Tried converting both Potential calls to sampling="auto" and hit a real
problem: the Ni surface structure here is ~27,000 atoms, and auto's
0.05 A default target produces a 1000x980 grid against the tutorial's
deliberately coarse 246x244 (16x more pixels) -- the multislice +
12-config frozen-phonon ensemble didn't finish in 10 minutes. The COVID
spike protein potential is a similarly large structure at sampling=0.5.
Both were clearly chosen coarse on purpose to keep this tutorial's
demonstrations tractable, not incidentally -- the same class of exception
as convergence.ipynb and performance_tips.ipynb, just not called out by
name since the reason (structure size, not a pedagogical point about
sampling itself) wasn't obvious from the file list alone. Left the
manual values, added a one-line comment explaining why.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
(cherry picked from commit 84f3d78)
Verified slice_thickness="auto" independently rediscovers a/2 = 2.025 A
(the {200} plane spacing this tutorial's dispersion model assumes) --
same value as before, just no longer hardcoded. sampling="auto" costs
~2.5x more pixels (1280x320 vs 810x203) since 0.08 was chosen a bit
coarser than the 0.05 A default; multislice now takes ~2.5 min instead
of under a minute, still tractable. Re-executed end to end, S(q,E)
dispersion figure unchanged in character.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
(cherry picked from commit 93c09e5)
The oxygen/strontium EELS potential (SrTiO3, cell 52) computed
slice_thickness = atoms.cell[2, 2] / 2 by hand; verified slice_thickness=
"auto" reproduces the exact same value (1.972565 A, 50 slices) since
that's the crystal-plane spacing auto finds independently -- same
Potential object either way, so left the committed outputs as-is rather
than re-running this notebook's expensive PRISM-EELS cells for a
behavior-preserving change.

Left the Si thickness-series potential (cell 17) alone: slice_thickness=
5.43 there is deliberately one full conventional-cell height per slice,
matching exit_planes=1's "one exit plane per unit cell" thickness-series
convention (traced to the paper this section reproduces) -- auto instead
merges to the crystal's finer sub-plane spacing (0.68 A, 369 slices),
which would both change the thickness series' meaning and make an
already-expensive transition-potential calculation ~4x slower.

Both potentials keep their explicit gpts=256 (core-loss transition-
potential scans are expensive; a known, fixed grid size matters more
here than commensurability).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
(cherry picked from commit 27e17d0)
4d-stem, hrtem, ped, stem and pacbed quickstarts all used sampling
already close to the 0.05 A auto default with no downstream numeric
dependencies. All five re-executed end to end, no errors.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
(cherry picked from commit 2a86d39)
Refreshes the outputs of the two notebooks that #32 re-executed and #44
converts to automatic sampling, against abTEM dev (d978997f).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@TomaSusi
TomaSusi force-pushed the docs/sampling-auto-and-epie-removal branch from 5b9a6f1 to 9e38a7b Compare October 22, 2026 13:48
TomaSusi and others added 2 commits October 22, 2026 16:02
…M dev

Refreshes the outputs of the convergence appendix, the walkthroughs and the
stem, 4d-stem, cbed, pacbed, ped and interactions examples, which still
showed results from the previous manual sampling. core_loss and phonon_loss
are not included: they do not run against abTEM dev for reasons unrelated
to the sampling change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
phonon_loss: phonon_loss_diffraction_patterns takes components, with
'diffuse' for what was 'tds'; the text names the order of the stacked
components.

core_loss: overlay the single and double channel curves with
show(overlay=(1, 2), explode=(0,), legend=True), which works since
abTEM#624; build the Atoms that show_atoms needs from the positions
that filter_sites now returns; give both detectors the same outer
angle, since the PRISM waves are cropped to the aperture and the
default cutoff differs between the two scans.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@TomaSusi
TomaSusi merged commit 03fbc7c into dev Oct 22, 2026
1 check passed
@TomaSusi
TomaSusi deleted the docs/sampling-auto-and-epie-removal branch October 22, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant