OpenZGY/Python API and Internals (ALPHA)
Access seismic data stored in ZGY format.
Public Member Functions | List of all members
openzgy.impl.file.LocalFileOther Class Reference
Inheritance diagram for openzgy.impl.file.LocalFileOther:
openzgy.impl.file.LocalFile openzgy.impl.file.FileADT

Public Member Functions

def xx_read (self, offset, size, *usagehint=UsageHint.Unknown)
 
def xx_readv (self, requests, *parallel_ok=False, immutable_ok=False, transient_ok=False, usagehint=UsageHint.Unknown)
 
def xx_write (self, data, offset, *usagehint=UsageHint.Unknown)
 
def threadsafe (self)
 
- Public Member Functions inherited from openzgy.impl.file.LocalFile
def __init__ (self, filename, mode, iocontext)
 
def xx_eof (self)
 
def xx_close (self)
 
- Public Member Functions inherited from openzgy.impl.file.FileADT
def __enter__ (self)
 
def __exit__ (self, type, value, traceback)
 
def xx_iscloud (self)
 

Member Function Documentation

◆ xx_read()

def openzgy.impl.file.LocalFileOther.xx_read (   self,
  offset,
  size,
usagehint = UsageHint.Unknown 
)
Read binary data from the file. Both size and offset are mandatory.
I.e. caller is not allowed to read "the entire file", and not
allowed to "read from where I left off the last time".
The actual reading will be done in a derived class.
The base class only validates the arguments.

Reimplemented from openzgy.impl.file.FileADT.

◆ xx_readv()

def openzgy.impl.file.LocalFileOther.xx_readv (   self,
  requests,
parallel_ok = False,
  immutable_ok = False,
  transient_ok = False,
  usagehint = UsageHint.Unknown 
)
Read binary data from multiple regions in the file. Each part
of the request specifies offset, size, and a delivery functor
which will be invoked to pass back the returned bulk.

Arguments:
    parallel_ok:  If true then the delivery functor might be called
          simultaneously from multiple worker threads.
          The function itself will block until all the data
          has been read or an error occurs.
    immutable_ok: If true the caller promises that the delivery
          functor will not try to modify the data buffer.
          Pass False e.g. if the functor may need to byteswap
          the data it has read from file.
    transient_ok: If true the caller promises that the delivery
          functor will not keep a reference to the data buffer
          after the functor returns.

The delivery functor is called as
    fn(data)

FUTURE: a new argument partial_ok may be set to True if it is ok to
call the delivery functor with less data than requested, and to keep
calling it until all data has been delivered. The signature of the
delivery functor gets changed to fn(data, offset, size). Offset is the
absolute file offset. I.e. not relative to the requested offset.
Passing partial_ok=True might elide some buffer copies if the
caller is doing something simple (such as reading an uncompressed
brick) where partial copies are possible, and the backend is in the
cloud, and a longer lived cache is being maintained, and the cache
block size is smaller than the requested size. That is a lot of ifs.
There was some code to handle partial_ok but it has been removed.
Get it from the git history if you really want it.

Reimplemented from openzgy.impl.file.FileADT.

◆ xx_write()

def openzgy.impl.file.LocalFileOther.xx_write (   self,
  data,
  offset,
usagehint = UsageHint.Unknown 
)
Write binary data to the file. Offset is mandatory. I.e. caller
is not allowed to "write to where I left off the last time".
The actual writing will be done in a derived class.
The base class only validates the arguments.

Reimplemented from openzgy.impl.file.FileADT.


The documentation for this class was generated from the following file: