Skip to content

Patch Release v6.4.3

Latest
Compare
Choose a tag to compare
@ruck314 ruck314 released this 05 Dec 06:17
65f90cd

Pull Requests Since v6.4.2

Bug

  1. #1031 - Fix boost variable in both rogue CmakeLists and external library RogueConfig template

Unlabeled

  1. #1028 - cpplint v2 - linter fix
  2. #1027 - ESROGUE-684 - Frame.getNumpy now allows user defined data type
  3. #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 additional dtype 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 parameters

offset = 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 at offset.

The offset and count parameters are still specified in bytes, not in the dtype size.

Other changes

The offset argument of Frame.readPy() and Frame.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 an offset and count which function the same as in getNumpy() with the same defaults.

Also, a new Frame.getMemoryview() method has been added that allocates a bytearray but returns it as a memoryview. This allows for efficient slicing of the frame data without any copying. In most cases where copyless slicing is needed, a getNumpy() would be preferred, but getMemoryview() 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


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