Add _CellView helper subclass to Vector datastructure for Imaging Infrastructure needs#179
Closed
darshan-mali wants to merge 2 commits intoelectronmicroscopy:devfrom
Closed
Add _CellView helper subclass to Vector datastructure for Imaging Infrastructure needs#179darshan-mali wants to merge 2 commits intoelectronmicroscopy:devfrom
darshan-mali wants to merge 2 commits intoelectronmicroscopy:devfrom
Conversation
Collaborator
|
@cophus Okay so I feel a little bad for only looking at Long story short, My general comments:
|
Collaborator
Author
|
Closing this in lieu of PR #184 |
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.

What does this PR do?
Implementation of the helper subclass
_CellViewforVector.Enables accessing data in Vector class by each cell in addition to by each Field (current default).
This is an essential Infrastructure change for automating imaging analysis.
For example, if you create a
Vectordatastructure as follows:The current infrastructure only allows data access based on each Field only as shown:
x_data = atoms["x"]This PR enables access via Cells and Field access for Cells as follows:
This is very important when dealing with large number of atoms and their data, especially for doing automated polarization measurements. More details regarding the same have been explained in the notebook attached.
Also includes 1 basic pytest for
_CellView.Modified files
src/quantem/core/datastructures/vector.py- Added the _CellView helper subclass. Updated__getitem__()to return _CellView object based on indexing used. Also added shape validation forfrom_shape()method.tests/datastructures/test_vector.py- Added basic pytest to test _CellView functionality.Brief example can be found in this notebook:
Vector_example.ipynb
What should the reviewer(s) do?
This is a PR into core
Ensure nothing else breaks because of this
Checklist items:
Reviewer checklist