Skip to content

Commit

Permalink
Merge branch 'main' of github.com:SpikeInterface/spikeinterface into …
Browse files Browse the repository at this point in the history
…test-tmp-kachery-cloud
  • Loading branch information
alejoe91 committed Sep 19, 2024
2 parents 30845cf + 4ab6223 commit e24144f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions doc/releases/0.101.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Main changes:

core:

* Update the method of creating an empty file with right size when saving binary files (#3408)
* Refactor pandas save load and convert dtypes (#3412)
* Check run info completed only if it exists (back-compatibility) (#3407)
* Fix argument spelling in check for binary compatibility (#3409)
Expand Down Expand Up @@ -72,6 +73,7 @@ curation:

widgets:

* Fix metrics widgets for convert_dtypes (#3417)
* Fix plot motion for multi-segment (#3414)
* Sortingview: only round float properties (#3406)
* Fix widgets tests and add test on unit_table_properties (#3354)
Expand Down
9 changes: 6 additions & 3 deletions src/spikeinterface/core/recording_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,12 @@ def write_binary_recording(
data_size_bytes = dtype_size_bytes * num_frames * num_channels
file_size_bytes = data_size_bytes + byte_offset

file = open(file_path, "wb+")
file.truncate(file_size_bytes)
file.close()
# Create an empty file with file_size_bytes
with open(file_path, "wb+") as file:
# The previous implementation `file.truncate(file_size_bytes)` was slow on Windows (#3408)
file.seek(file_size_bytes - 1)
file.write(b"\0")

assert Path(file_path).is_file()

# use executor (loop or workers)
Expand Down

0 comments on commit e24144f

Please sign in to comment.