detkit.Disk.set#

Disk.set()#

Set or reset tracing disk read and write.

See also

read
write

Notes

When an object of detkit.Disk is instantiated, the detkit.Disk.set() method is automatically called. So, you may not need to call this on a newly created disk object.

Examples

>>> from detkit import Disk, memdet

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

>>> # Set 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 read from disk during the above operation, in MB unit
>>> print(disk.read())
5.72

>>> # Reset the starting point of disk inquiry
>>> disk.set()

>>> # Inquiry read from disk again
>>> print(disk.read())
0.0