[segyio] 298/376: Add since version in docstrings

Jørgen Kvalsvik jokva-guest at moszumanska.debian.org
Wed Sep 20 08:04:48 UTC 2017


This is an automated email from the git hooks/post-receive script.

jokva-guest pushed a commit to branch debian
in repository segyio.

commit 06ec0f8bbbe9c50a63f17b94b640e332d23ac0e0
Author: Jørgen Kvalsvik <jokva at statoil.com>
Date:   Fri Jun 9 11:29:08 2017 +0200

    Add since version in docstrings
---
 python/segyio/create.py |  2 ++
 python/segyio/open.py   |  2 ++
 python/segyio/segy.py   | 28 ++++++++++++++++++++++++++++
 python/segyio/su.py     |  4 ++--
 python/segyio/tools.py  | 13 ++++++++++---
 5 files changed, 44 insertions(+), 5 deletions(-)

diff --git a/python/segyio/create.py b/python/segyio/create.py
index bada70d..7ad6131 100644
--- a/python/segyio/create.py
+++ b/python/segyio/create.py
@@ -23,6 +23,8 @@ def default_text_header(iline, xline, offset):
 def create(filename, spec):
     """Create a new segy file.
 
+    Since v1.1
+
     Create a new segy file with the geometry and properties given by `spec`.
     This enables creating SEGY files from your data. The created file supports
     all segyio modes, but has an emphasis on writing. The spec must be
diff --git a/python/segyio/open.py b/python/segyio/open.py
index d726cdb..ed8751b 100644
--- a/python/segyio/open.py
+++ b/python/segyio/open.py
@@ -9,6 +9,8 @@ def open(filename, mode="r", iline = 189,
                              ignore_geometry = False):
     """Open a segy file.
 
+    Since v1.1
+
     Opens a segy file and tries to figure out its sorting, inline numbers,
     crossline numbers, and offsets, and enables reading and writing to this
     file in a simple manner.
diff --git a/python/segyio/segy.py b/python/segyio/segy.py
index d8a7f3f..54d3a98 100644
--- a/python/segyio/segy.py
+++ b/python/segyio/segy.py
@@ -119,6 +119,8 @@ class SegyFile(object):
     def flush(self):
         """Flush a file - write the library buffers to disk.
 
+        Since v1.1
+
         This method is mostly useful for testing.
 
         It is not necessary to call this method unless you want to observe your
@@ -137,6 +139,8 @@ class SegyFile(object):
     def close(self):
         """Close the file.
 
+        Since v1.1
+
         This method is mostly useful for testing.
 
         It is not necessary to call this method if you're using the `with`
@@ -148,6 +152,8 @@ class SegyFile(object):
         """Memory map the file
         :rtype: bool
 
+        Since v1.1
+
         Memory map the file. This is an advanced feature for speed and
         optimization; however, it is no silver bullet. If your file is smaller
         than the memory available on your system this will likely result in
@@ -205,6 +211,8 @@ class SegyFile(object):
     def header(self):
         """ Interact with segy in header mode.
 
+        Since v1.1
+
         This mode gives access to reading and writing functionality of headers,
         both in individual (trace) mode and line mode. Individual headers are
         accessed via generators and are not read from or written to disk until
@@ -315,6 +323,8 @@ class SegyFile(object):
     def attributes(self, field):
         """ File-wide attribute (header word) reading
 
+        Since v1.1
+
         A range-oriented function that reads some attribute for all the
         specified headers file-wide. Supports index lookup, slices and
         numpy-style list-of-indices.
@@ -369,6 +379,8 @@ class SegyFile(object):
     def trace(self):
         """ Interact with segy in trace mode.
 
+        Since v1.1
+
         This mode gives access to reading and writing functionality for traces.
         The primary data type is the numpy ndarray. Traces can be accessed
         individually or with python slices, and writing is done via assignment.
@@ -504,6 +516,8 @@ class SegyFile(object):
     def iline(self):
         """ Interact with segy in inline mode.
 
+        Since v1.1
+
         This mode gives access to reading and writing functionality for inlines.
         The primary data type is the numpy ndarray. Inlines can be accessed
         individually or with python slices, and writing is done via assignment.
@@ -640,6 +654,8 @@ class SegyFile(object):
     def xline(self):
         """ Interact with segy in crossline mode.
 
+        Since v1.1
+
         This mode gives access to reading and writing functionality for crosslines.
         The primary data type is the numpy ndarray. crosslines can be accessed
         individually or with python slices, and writing is done via assignment.
@@ -784,6 +800,8 @@ class SegyFile(object):
     def fast(self):
         """ Access the 'fast' dimension
 
+        Since v1.1
+
         This mode yields iline or xline mode, depending on which one is laid
         out "faster", i.e. the line with linear disk layout. Use this mode if
         the inline/crossline distinction isn't as interesting as traversing in
@@ -801,6 +819,8 @@ class SegyFile(object):
     def slow(self):
         """ Access the 'slow' dimension
 
+        Since v1.1
+
         This mode yields iline or xline mode, depending on which one is laid
         out "slower", i.e. the line with strided disk layout. Use this mode if
         the inline/crossline distinction isn't as interesting as traversing in
@@ -817,6 +837,8 @@ class SegyFile(object):
     def depth_slice(self):
         """ Interact with segy in depth slice mode.
 
+        Since v1.1
+
         This mode gives access to reading and writing functionality for depth slices.
         The primary data type is the numpy ndarray. Depth slices can be accessed
         individually or with python slices, and writing is done via assignment.
@@ -912,6 +934,8 @@ class SegyFile(object):
     def gather(self):
         """ Interact with segy in gather mode
 
+        Since v1.1
+
         A gather is in this context the intersection of lines in a cube, i.e.
         all the offsets at some iline/xline intersection. The primary data type
         is the numpy ndarray, with dimensions depending on the range of offsets
@@ -952,6 +976,8 @@ class SegyFile(object):
     def text(self):
         """ Interact with segy in text mode.
 
+        Since v1.1
+
         This mode gives access to reading and writing functionality for textual
         headers.
 
@@ -1005,6 +1031,8 @@ class SegyFile(object):
     def bin(self):
         """ Interact with segy in binary mode.
 
+        Since v1.1
+
         This mode gives access to reading and writing functionality for the
         binary header. Please note that using numeric binary offsets uses the
         offset numbers from the specification, i.e. the first field of the
diff --git a/python/segyio/su.py b/python/segyio/su.py
index ca36446..c60cd71 100644
--- a/python/segyio/su.py
+++ b/python/segyio/su.py
@@ -3,7 +3,7 @@ from segyio import TraceField as tf
 from segyio import BinField as bf
 
 class su(Enum):
-    """
+    """ Since v1.1
         Seismic Unix style aliases for binary and trace header fields.
 
     About names:
@@ -14,7 +14,7 @@ class su(Enum):
         and in conflicts take presedence after some time. If there are no
         conflicts, segyio names are considered for deprecation on a
         case-by-case basis, but will most likely be supported along with the
-        Seismic Unix name-
+        Seismic Unix name.
     """
 # trace
     tracl  = tf.TRACE_SEQUENCE_LINE
diff --git a/python/segyio/tools.py b/python/segyio/tools.py
index d6dfd09..d5ac9a2 100644
--- a/python/segyio/tools.py
+++ b/python/segyio/tools.py
@@ -4,7 +4,7 @@ import textwrap
 
 
 def dt(segyfile, fallback_dt=4000.0):
-    """
+    """Since v1.1
     Find a *dt* value in the SegyFile. If none is found use the provided *fallback_dt* value.
 
     :type segyfile: segyio.SegyFile
@@ -15,7 +15,8 @@ def dt(segyfile, fallback_dt=4000.0):
 
 
 def sample_indexes(segyfile, t0=0.0, dt_override=None):
-    """
+    """Since v1.1
+
     Creates a list of values representing the samples in a trace at depth or time.
     The list starts at *t0* and is incremented with am*dt* for the number of samples.
     If a *dt_override* is not provided it will try to find a *dt* in the file.
@@ -53,7 +54,7 @@ def create_text_header(lines):
     return rows
 
 def wrap(s, width=80):
-    """
+    """Since v1.1
     Formats the text input with newlines given the user specified width for each line
 
     :type s: str
@@ -68,6 +69,8 @@ def native(data,
            copy = True):
     """ Convert numpy array to native float
 
+    Since v1.1
+
     :type data: numpy.ndarray
     :type format: int|segyio.SegySampleFormat
     :type copy: bool
@@ -92,6 +95,8 @@ def native(data,
 def collect(itr):
     """ Collect traces or lines into one ndarray
 
+    Since v1.1
+
     Eagerly copy a series of traces, lines or depths into one numpy ndarray. If
     collecting traces or fast-direction over a post-stacked file, reshaping the
     resulting array is equivalent to calling `tools.cube`.
@@ -112,6 +117,8 @@ def collect(itr):
 def cube(f):
     """ Read a full cube from a file
 
+    Since v1.1
+
     Takes an open segy file (created with segyio.open) or a file name.
 
     If the file is a prestack file, the cube returned has the dimensions

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/segyio.git



More information about the debian-science-commits mailing list