detkit.Disk.write#

Disk.write()#

Inquiry the amount of write to disk.

Returns:
write_sizeint

The amount of write to disk divided by the specified unit size.

See also

read

Notes

The write amount is measured from the point where detkit.Disk.set() is called to the current. The reported write amount is divided by the give unit (see argument to detkit.Disk).

Examples

>>> from detkit import Disk, memdet

>>> # Initialize with MB unit
>>> disk = Disk(unit='MB')

>>> # Set (or reset) the starting point of disk inquiry
>>> disk.set()

>>> # Perform an operation that reads from and writes to disk
>>> import numpy
>>> A = numpy.random.randn(1000, 1000)
>>> ld = memdet(A, num_blocks=4)

>>> # Inquiry write to disk during the above operation, in MB unit
>>> print(disk.write())
5.72