Skip to content

Commit d1edaa8

Browse files
authored
Merge pull request #657 from achaikou/rev2_python
Update python interface with rev2 features
2 parents 1286090 + 4792eae commit d1edaa8

14 files changed

Lines changed: 1225 additions & 128 deletions

File tree

.github/workflows/wheels.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
CIBW_ENVIRONMENT_WINDOWS: >
5454
CMAKE_GENERATOR="${{ matrix.cmake_generator }}"
5555
CMAKE_GENERATOR_PLATFORM="${{ matrix.cmake_generator_platform }}"
56-
CIBW_SKIP: cp38-* *-musllinux_*
56+
CIBW_SKIP: cp38-* cp39-* *-musllinux_*
5757
CIBW_ARCHS: ${{ matrix.arch }}
5858
run: |
5959
python -m cibuildwheel --output-dir wheelhouse python/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ To build segyio you need:
9696
* A C99 compatible C compiler (tested mostly on gcc and clang)
9797
* A C++11 compiler for the Python extension and tests
9898
* [CMake](https://cmake.org/) version 3.18 or greater
99-
* [Python](https://www.python.org/) 3.9 or greater
99+
* [Python](https://www.python.org/) 3.10 or greater
100100
* [numpy](http://www.numpy.org/) version 1.10 or greater
101101
* [pytest](https://pypi.org/project/pytest)
102102

python/docs/conf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@
6262
#
6363
# ref http://luc.lino-framework.org/blog/2018/0821.html
6464

65-
from distutils.version import LooseVersion
65+
from packaging.version import Version
6666
import sphinx
6767

68-
if LooseVersion(sphinx.__version__) < LooseVersion("1.8"):
68+
if Version(sphinx.__version__) < Version("1.8"):
6969
autodoc_default_flags = ['members', 'inherited-members']
7070
else:
7171
autodoc_default_options = {
@@ -109,7 +109,7 @@
109109
#
110110
# This is also used if you do content translation via gettext catalogs.
111111
# Usually you set "language" from the command line for these cases.
112-
language = None
112+
language = 'en'
113113

114114
# There are two options for replacing |today|: either, you set today to some
115115
# non-false value, then it is used:
@@ -166,7 +166,7 @@
166166
'examples_dirs': ['../tutorials',],
167167
# path where to save gallery generated examples
168168
'gallery_dirs': ['tutorials'],
169-
'filename_pattern': '\.py',
169+
'filename_pattern': r'\.py',
170170
# Remove the "Download all examples" button from the top level gallery
171171
'download_all_examples': False,
172172
# Sort gallery example by file name instead of number of lines (default)

python/docs/segyio.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ Trace header and attributes
3535
.. autoclass:: segyio.trace.Attributes()
3636
:special-members: __getitem__, __setitem__, __len__, __contains__, __iter__
3737

38+
.. autoclass:: segyio.trace.FileFieldAccessor()
39+
:special-members: __getitem__, __setitem__, __len__, __iter__
40+
41+
.. autoclass:: segyio.trace.RowFieldAccessor()
42+
:special-members: __getitem__, __setitem__, __getattr__, __setattr__, __len__, __iter__
43+
3844
Data line
3945
---------
4046
.. autoclass:: segyio.line.Line()
@@ -67,11 +73,31 @@ Text
6773
.. autoclass:: segyio.trace.Text()
6874
:special-members: __getitem__, __setitem__, __len__, __contains__, __iter__
6975

76+
Stanza
77+
------
78+
.. autoclass:: segyio.trace.Stanza()
79+
:special-members: __getitem__, __len__, __iter__
80+
:exclude-members: count, index
81+
7082
Trace and binary header
7183
=======================
7284
.. autoclass:: segyio.field.Field()
7385
:special-members: __getitem__, __setitem__, __delitem__, __len__, __contains__, __iter__
7486

87+
.. autoclass:: segyio.field.HeaderFieldAccessor()
88+
:special-members: __getattr__, __setattr__, __getitem__, __setitem__, __delitem__, __len__, __iter__
89+
90+
.. autoclass:: segyio.trace.RowLayoutEntries()
91+
:special-members: __getitem__, __getattr__, __len__, __iter__
92+
:exclude-members: count, index
93+
94+
.. autoclass:: segyio.trace.HeaderLayoutEntries()
95+
:special-members: __getitem__, __getattr__, __len__, __iter__
96+
:exclude-members: count
97+
98+
.. autoclass:: segyio.trace.FieldLayoutEntry()
99+
:special-members: __getitem__
100+
75101
Tools
76102
=====
77103

python/examples/flip-endianness.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,12 @@ def main():
3232
dst.bin = src.bin
3333
dst.trace = src.trace
3434

35-
# intention:
36-
# dst.traceheader = src.traceheader
37-
3835
# traceheader mapping was copied after open. At the moment of creation
3936
# of this example file code can't deal with that, so we must reopen the
4037
# file after bin and ext_headers are copied so that mapping is
4138
# recognized.
4239
with segyio.open(dstfile, "r+", endian="little", ignore_geometry=True) as dst:
43-
for trace_index in range(src.tracecount):
44-
for traceheader_index in range(src.traceheader_count):
45-
traceheader = src.segyfd.getth(
46-
trace_index, traceheader_index, bytearray(240))
47-
dst.segyfd.putth(
48-
trace_index, traceheader_index, traceheader)
40+
dst.traceheader = src.traceheader
4941

5042

5143
if __name__ == '__main__':

python/pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ authors = [
1313
]
1414
urls.homepage = "https://github.com/equinor/segyio"
1515
license = "LGPL-3.0-or-later"
16-
requires-python = ">=3.9"
16+
requires-python = ">=3.10"
1717
dependencies = ["numpy >= 1.10"]
1818
readme = { text = """
1919
=======
@@ -66,7 +66,6 @@ classifiers = [
6666
"Intended Audience :: Science/Research",
6767
"Natural Language :: English",
6868
"Programming Language :: Python",
69-
"Programming Language :: Python :: 3.9",
7069
"Programming Language :: Python :: 3.10",
7170
"Programming Language :: Python :: 3.11",
7271
"Programming Language :: Python :: 3.12",

0 commit comments

Comments
 (0)