Skip to content

Expose datasource to python - #632

Merged
achaikou merged 4 commits into
equinor:mainfrom
achaikou:python_datasource
Jul 9, 2025
Merged

Expose datasource to python#632
achaikou merged 4 commits into
equinor:mainfrom
achaikou:python_datasource

Conversation

@achaikou

@achaikou achaikou commented Jul 3, 2025

Copy link
Copy Markdown
Contributor

Datasource finally reaching the users. 🏁
Please double check that I am providing them with enough correct and useful information 😇 and that this solution is good enough and works as I think it does 😅 .

Only thing left is benchmark workflow, but I want to add it after this PR is merged.

Relevant for #573

As we extend our support of i/o media, some information needs to be
generalized as currently it is specific to files only.

@ajaust ajaust left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good to me overall. 🙂

I added quite some questions for clarification again, but I think its all things and nothing serious.

Comment thread python/segyio/segy.py
Comment thread python/segyio/create.py Outdated
Comment thread python/segyio/create.py Outdated
Comment thread python/segyio/utils.py Outdated
Comment thread python/segyio/open.py Outdated
Comment on lines +186 to +188
Configuration for certain algorithms. True to minimize the number of
requests to the stream at the cost of reading/writing unnecessary data.
False to minimize memory usage at the cost of many requests.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we update the docstring in create_with this should be updated accordingly.

Comment thread python/test/stream.py
Comment thread python/tutorials/using_own_stream.ipynb Outdated
Comment thread python/tutorials/using_own_stream.ipynb Outdated
Comment thread python/tutorials/using_own_stream.ipynb
Comment thread python/tutorials/using_own_stream.ipynb

@achaikou achaikou left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fast review! 🐱
Some few things are updated, some are waiting your opinion :)

Comment thread python/segyio/segy.py
Comment thread python/segyio/create.py Outdated
Comment thread python/segyio/open.py
Comment thread python/segyio/open.py Outdated
Comment thread python/segyio/utils.py Outdated
Comment thread python/test/stream.py
Comment thread test-data/README.md
Comment thread python/tutorials/using_own_stream.ipynb
Comment thread python/tutorials/using_own_stream.ipynb Outdated
Comment thread python/tutorials/using_own_stream.ipynb

@ajaust ajaust left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! I have only minor comments/answers to the open discussions and found a typo.

Comment thread python/segyio/create.py Outdated
Comment thread python/segyio/open.py
Comment thread .github/workflows/build.yaml
Comment thread python/test/segyio_c.py
Comment thread python/test/segyio_c.py Outdated
Comment thread python/test/segyio_c.py Outdated
Comment thread python/test/segyio_c.py Outdated
Comment thread python/test/stream.py
Comment thread python/tutorials/using_own_stream.ipynb
Comment thread python/tutorials/using_own_stream.ipynb

@achaikou achaikou left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Finding typos is good, finding typos I like!

Comment thread python/test/segyio_c.py
Comment thread python/test/segyio_c.py Outdated
Comment thread python/test/stream.py

@ajaust ajaust left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome. Go ahead and squash the fixups and merge. 😄

achaikou added 3 commits July 9, 2025 12:32
- Stream datasources are tested in stream.py file. File is supposed to
be referenced in tutorials for users who want to implement their own
streams.
Tests are based on new tiny.sgy file. File is added to support
cloud testing and cloud operations can be very very slow. Even for this
tiny file "read" test sends almost 200 requests to the source.

- Memory buffer datasource is mostly tested in its own file which tests
are subsets of stream tests.

Benchmark tests are already updated to support datasources, but workflow
will be added later.
@achaikou
achaikou force-pushed the python_datasource branch from 737154a to 3b960a7 Compare July 9, 2025 10:56
@achaikou
achaikou merged commit 2b3be75 into equinor:main Jul 9, 2025
33 checks passed
@achaikou
achaikou deleted the python_datasource branch August 25, 2025 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants