I've been experimenting with the library on macos, linux, and windows (which generally work great, thank you!) and I encountered a small problem on Windows (10) running in a VM (VMWare) on my mac. The call:
img = czi.asarray()
with no arguments, raises the following error:
C:\Users\sheinb\Anaconda3\lib\site-packages\czifile\czifile.py in func(directory_entry, resize, order, start, out)
393 start=self.start, out=out):
394 """Read, decode, and copy subblock data."""
--> 395 subblock = directory_entry.data_segment()
396 tile = subblock.data(resize=resize, order=order)
397 index = [slice(i-j, i-j+k) for i, j, k in
AttributeError: 'list' object has no attribute 'data_segment'
This virtual machine has 2 CPUs assigned, and multiprocessor.cpu_count seems to report this correctly. I found, though, if I explicitly pass max_workers as 2, then the call works but if I pass max_workers as 1, it does not. Probably a rare issue (since everyone presumably has >1 CPU) but maybe there's a small issue is this part of the code? My knowledge of executor maps is limited...
if max_workers > 1:
self._fh.lock = True
with ThreadPoolExecutor(max_workers) as executor:
executor.map(func, self.filtered_subblock_directory)
self._fh.lock = None
else:
func(self.filtered_subblock_directory)
I've been experimenting with the library on macos, linux, and windows (which generally work great, thank you!) and I encountered a small problem on Windows (10) running in a VM (VMWare) on my mac. The call:
with no arguments, raises the following error:
This virtual machine has 2 CPUs assigned, and multiprocessor.cpu_count seems to report this correctly. I found, though, if I explicitly pass
max_workers
as 2, then the call works but if I pass max_workers as 1, it does not. Probably a rare issue (since everyone presumably has >1 CPU) but maybe there's a small issue is this part of the code? My knowledge of executor maps is limited...