Open
Conversation
added 14 commits
March 25, 2026 19:09
…ith PySlice logic and preallocation of arrays
…ection via environment variable
…ice_abtem.ipynb looks good for NumPy and PyTorch CPU backend.
…ntial problems overloading default Python operators
Claude and Github Copilot made the majority of changes. The backend is now much more compartmentalized and fully testable. Need to verify the correctness of calculations more.
… functions to trajectory deleted by mistake
1. Removed parameter store_all_slices from MultisliceCalculator 2. Added force_rerun parameter to MultisliceCalculator.run in order to force recalculation even if tacaw.npy exists. 3. Fixed bug regarding chunk_size_time handling in TACAWData if chunkFFT=True 4. Added force_rerun parameter to TACAWData class to force recalculation even if tacaw.npy exists in the cache. Now tests/test_pyslice_abtem.ipynb runs successfully!
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.
This PR introduces a new backend implementation, which allows for a very clean handling of the arrays without relying on global module variables. Backends can now be freely mixed and matched in the same process. Furthermore the backend is easily testable as shown in the script
tests/test_backend.py.Most of the rewriting was done using Github Copilot and Claude Code. Most testing has focused on the Jupyter notebook
tests/test_pyslice_abtem.ipynb. It runs successfully and compares favorably with an abTEM calculation.We will need to test this more rigorously than I was able to do. Specifically, we should make sure all of the tests in the tests directory work. I could not verify a lot of them due to memory issues. Will try on a cluster in the near future.