Repository navigation
Add convenience methods to extract ORM plane blocks - #489
Open
HarshRajSinghania wants to merge 2 commits into
Open
HarshRajSinghania wants to merge 2 commits into
HarshRajSinghania wants to merge 2 commits into
Conversation
Implements get_h2h_matrix, get_v2v_matrix, get_h2v_matrix, and get_v2h_matrix on OrbitResponseMatrix to provide easy access to the four plane blocks of the latest measurement without requiring users to slice the matrix themselves. Fixes python-accelerator-middle-layer#486
Implements get_h2h_matrix, get_v2v_matrix, get_h2v_matrix, and get_v2h_matrix on OrbitResponseMatrix to provide easy access to the four plane blocks of the latest measurement without requiring users to slice the matrix themselves. Fixes python-accelerator-middle-layer#486
This branch has not been deployed
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
Adds four convenience methods on
OrbitResponseMatrixto extract the plane-specific blocks of the latest orbit response matrix measurement:get_h2h_matrix()get_v2v_matrix()get_h2v_matrix()get_v2h_matrix()Motivation
Addresses #486. The ORM measurement stores the full matrix and plane metadata in
latest_measurement(returned byget()). Users currently need to manually slice this matrix using the plane lists. These methods provide a direct, readable way to obtain the four standard blocks (horizontal-to-horizontal, vertical-to-vertical, and the two cross terms).Implementation
A private
_get_submatrixhelper selects rows and columns according to the observable and variable plane labels stored with the measurement. The public methods simply call it with the appropriate plane pairs. If no measurement is available the methods return an empty list.Testing
test_orm_block_gettersintests/tuning_tools/test_tuning_orm.pythat performs a small ORM measurement and asserts the expected shapes of each block.pytest tests/tuning_tools/test_tuning_orm.py::test_orm_block_getters— passed.ruff checkandruff formaton the changed files — clean.Fixes #486