Skip to content

Commit

Permalink
ref: replace np.string_ with np.bytes_
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Aug 13, 2024
1 parent 349dad3 commit 7a076cd
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
0.25.1
- ref: replace np.string_ with np.bytes_
0.25.0
- feat: identify flickering in raw data via dcnum.read.detect_flickering
- fix: handle out-of-bounds slice indexing for BaseImageChunkCache
Expand Down
14 changes: 14 additions & 0 deletions benchmark/bm_write.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""Benchmark the writer thread"""
from dcnum import write


def main():

thr_coll = write.QueueCollectorThread(
data=self.dtin,
event_queue=fe_kwargs["event_queue"],
writer_dq=writer_dq,
feat_nevents=fe_kwargs["feat_nevents"],
write_threshold=500,
)
print("hello")
2 changes: 1 addition & 1 deletion src/dcnum/write/queue_collector_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def __init__(self,
name="QueueCollector", *args, **kwargs)
self.logger = logging.getLogger("dcnum.write.QueueCollector")
#: HDF5 data instance
self.data = data
self.data = None
#: Event queue from which to collect event data
self.event_queue = event_queue
#: Writer deque to which event arrays are appended
Expand Down
6 changes: 3 additions & 3 deletions src/dcnum/write/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ def require_feature(self,
feat_dtype=feat_dtype),
**ds_kwds)
if len(item_shape) == 2:
dset.attrs.create('CLASS', np.string_('IMAGE'))
dset.attrs.create('IMAGE_VERSION', np.string_('1.2'))
dset.attrs.create('CLASS', np.bytes_('IMAGE'))
dset.attrs.create('IMAGE_VERSION', np.bytes_('1.2'))
dset.attrs.create('IMAGE_SUBCLASS',
np.string_('IMAGE_GRAYSCALE'))
np.bytes_('IMAGE_GRAYSCALE'))
offset = 0
else:
dset = egroup[feat]
Expand Down

0 comments on commit 7a076cd

Please sign in to comment.