Skip to content

Releases: trungnt13/bigarray

Update README and benchmarks code

16 Oct 11:38
Compare
Choose a tag to compare
0.2.2

Update readme and benchmark

Better support for multiprocess writing

09 Oct 12:39
Compare
Choose a tag to compare
0.2.1

Better support multiprocessing in PointerArrayWriter, more tests, new…

PointerArray and multiprocessing

08 Oct 21:33
Compare
Choose a tag to compare

PointerArray is a memory-mapped array support descriptive indexing.

Example writing:

import numpy as np

from bigarray import PointerArray, PointerArrayWriter

with PointerArrayWriter('/tmp/array',
                        shape=(0,),
                        dtype='float64',
                        remove_exist=True) as f:
  # NOTE: this write method support multiprocessing write
  # (use different `start_position` for multiprocessing)
  f.write({
      'name0': np.arange(0, 10),
      'name1': np.arange(10, 20),
  },
          start_position=0)

x = PointerArray('/tmp/array')
print(x)

for name, (start, end) in x.indices.items():
  print(name, start, end, x[start:end])

# fast indexing
for name in x.indices:
  print(name, x[name])

Output from above programme:

[ 0.  1.  2.  3.  4.  5.  6.  7.  8.  9. 10. 11. 12. 13. 14. 15. 16. 17.  18. 19.]
name0 0 10 [0. 1. 2. 3. 4. 5. 6. 7. 8. 9.]
name1 10 20 [10. 11. 12. 13. 14. 15. 16. 17. 18. 19.]
name0 [0. 1. 2. 3. 4. 5. 6. 7. 8. 9.]
name1 [10. 11. 12. 13. 14. 15. 16. 17. 18. 19.]

Initial release

08 Oct 12:21
Compare
Choose a tag to compare

Initial release includes:

  • MmapArrayWriter
  • MmapArray
  • unittests
  • Benchmarks