Pull Requests Since v6.4.2
Bug
- #1031 - Fix boost variable in both rogue CmakeLists and external library RogueConfig template
Unlabeled
- #1028 - cpplint v2 - linter fix
- #1027 - ESROGUE-684 - Frame.getNumpy now allows user defined data type
- #1030 - Add setup_rogue.fish for fish shell
Pull Request Details
ESROGUE-684 - Frame.getNumpy now allows user defined data type
Author: | Ryan Herbst [email protected] |
Date: | Wed Dec 4 20:15:23 2024 -0800 |
Pull: | #1027 (92 additions, 11 deletions, 2 files changed) |
Branch: | slaclab/get-numpy |
Notes:
Description
Changes to
Frame.getNumpy()
The
Frame.getNumpy()
method now takes an additionaldtype
argument, which allows a numpy type to be specified for the returned array.array = frame.getNumpy(0, frame.getPayload(), np.uint32)Additionally, the
getNumpy()
method now has default arguments for all parametersoffset = 0 count = 0, dtype = np.uint8
Allowing for calls such as
# Read the entire frame into a np.uint8 array array = frame.getNumpy() # Read the entire frame into a np.uint32 array array = frame.getNumpy(dtype=np.uint32)The
count
argument defaults to 0, which functionally will return the entire array starting atoffset
.The
offset
andcount
parameters are still specified in bytes, not in the dtype size.Other changes
The
offset
argument ofFrame.readPy()
andFrame.writePy()
has also been given a default of 0 when called from python.A new
Frame.getBa()
method has been added that will allocate the bytearray internally and return it. This makes things a bit more concise in python when reading from a Frame.# New ba = frame.getBa() # Create a bytearray, fill it, and return it #Old ba = bytearray(frame.getPayload()) frame.read(ba)The
getBa()
method takes anoffset
andcount
which function the same as ingetNumpy()
with the same defaults.Also, a new
Frame.getMemoryview()
method has been added that allocates a bytearray but returns it as amemoryview
. This allows for efficient slicing of the frame data without any copying. In most cases where copyless slicing is needed, agetNumpy()
would be preferred, butgetMemoryview()
is useful for efficiently parsing complex header structures.memory_view = frame.getMemoryview() # Parse the header (4 bytes), length (2 bytes), and checksum (2 bytes) header, length, checksum = struct.unpack_from('IHH', memory_view, 0)
cpplint v2 - linter fix
Author: | Benjamin Reese [email protected] |
Date: | Mon Nov 4 10:38:57 2024 -0800 |
Pull: | #1028 (166 additions, 113 deletions, 51 files changed) |
Branch: | slaclab/linter-fix |
Notes:
Description
- NOLINT for the C-based drivers
- ./include/rogue/protocols/xilinx/JtagDriver.h:213: Add #include for FILE [build/include_what_you_use] [4]
- Add #include for XXXXXX [build/include_what_you_use] [4]
- Add #include for XXXXXX [build/include_what_you_use] [4]
- Using C-style cast. Use static_cast(...) instead [readability/casting] [4]
- Using deprecated casting style. Use static_cast<uint32_t>(...) instead [readability/casting] [4]
- Replace C header includes with C++ includes, rerun clang-format
Add setup_rogue.fish for fish shell
Author: | Larry Ruckman [email protected] |
Date: | Wed Dec 4 13:47:37 2024 -0600 |
Pull: | #1030 (27 additions, 1 deletions, 2 files changed) |
Branch: | JJL772/pr-fish-env |
Notes:
Description
Adds setup_rogue.fish for the fish shell
Fix boost variable in both rogue CmakeLists and external library RogueConfig template
Author: | Ryan Herbst [email protected] |
Date: | Wed Dec 4 19:47:00 2024 -0800 |
Pull: | #1031 (2 additions, 2 deletions, 2 files changed) |
Branch: | slaclab/cmake_boost |
Labels: | bug |
Notes:
Fix boost variable in both rogue CmakeLists and external library RogueConfig template