Skip to content

Commit

Permalink
Fix subtle bug with file sizes.
Browse files Browse the repository at this point in the history
  • Loading branch information
wtclarke committed Oct 11, 2023
1 parent d428ef5 commit 5a04539
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
This document contains the pymapvbvd release history in reverse chronological order.

0.5.6 (Wednesday 11th October 2023)
-----------------------------------
- Fixed issue with large files on Windows. Thanks to FrankZijlstra for reporting.
- Fixed subtle bug with precisely sized files interacting with memory chunking size. Thanks to FrankZijlstra for reporting.

0.5.5 (Tuesday 10th October 2023)
---------------------------------
- Suppress warning `RuntimeWarning: invalid value encountered in cast`.
Expand Down
4 changes: 2 additions & 2 deletions mapvbvd/mapVBVD.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def loop_mdh_read(fid, version, Nscans, scan, measOffset, measLength, print_prog
n_acq = n_acq + 1

# grow arrays in batches
if n_acq > szBlob:
if n_acq >= szBlob:
grownArray = np.zeros((mdh_blob.shape[0], allocSize),
dtype=np.uint8) # pylint: disable=E1136 # pylint/issues/3139
mdh_blob = np.concatenate((mdh_blob, grownArray), axis=1)
Expand All @@ -160,7 +160,7 @@ def loop_mdh_read(fid, version, Nscans, scan, measOffset, measLength, print_prog

cPos = cPos + int(ulDMALength)

if isEOF or n_acq == len(filePos):
if isEOF:
n_acq = n_acq - 1 # ignore the last attempt
# import pdb; pdb.set_trace()
filePos[n_acq] = cPos
Expand Down

0 comments on commit 5a04539

Please sign in to comment.