Repository navigation
Bring over the unmerged commits of the old v1.1.0 branch (sampling='auto', ePIE removal) - #44
Merged
Merged
Conversation
…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)
(cherry picked from commit fe3e912)
(cherry picked from commit 5aee0a2)
(cherry picked from commit 4ede906)
TomaSusi
force-pushed
the
docs/sampling-auto-and-epie-removal
branch
from
October 22, 2026 13:48
5b9a6f1 to
9e38a7b
Compare
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Brings over the 11 commits that were only on the old
v1.1.0branch (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 ontodevwithout conflicts (each commit message carries(cherry picked from commit ...)):_toc.ymlandreferences.bib:abtem.reconstructis no longer in abTEMdev.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 addgptsas an explicit override of the automatic sampling; the convergence sweep uses explicitgpts.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