Skip to content

Grid overrides: NonBinned & HasDuplicates - over UPDATED v1 - #633

Closed
dmitriyrepin wants to merge 9 commits into
TGSAI:v1from
dmitriyrepin:NonBinned_HasDuplicates_v1plus
Closed

dmitriyrepin wants to merge 9 commits into
TGSAI:v1from
dmitriyrepin:NonBinned_HasDuplicates_v1plus

Conversation

@dmitriyrepin

Copy link
Copy Markdown
Contributor
image

@BrianMichell BrianMichell left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please be sure to run pre-commit before pushing. You can use nox to set this up as a hook to ensure that part of the CI pipeline will pass.

Comment thread src/mdio/segy/geometry.py
Comment thread src/mdio/segy/geometry.py Outdated
Comment thread src/mdio/segy/geometry.py
Comment thread src/mdio/segy/geometry.py
Comment thread src/mdio/segy/utilities.py
Comment thread tests/integration/conftest.py
Comment thread tests/integration/conftest.py Outdated
Comment thread tests/integration/test_segy_import_export.py

@BrianMichell BrianMichell left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM
Regression discovered

Comment thread src/mdio/segy/utilities.py Outdated
return dimensions, chunksize, headers_subset
# We need to return both dimension and coordinate headers
horizontal_coordinates = template.coordinate_names
coordinate_headers = parse_headers(segy_file=segy_file, subset=horizontal_coordinates)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

parse_headers is a very expensive operation. Please see if you can find a way to re-use the output from the call above.

Comment thread src/mdio/segy/utilities.py Outdated
# We need to return both dimension and coordinate headers
horizontal_coordinates = template.coordinate_names
coordinate_headers = parse_headers(segy_file=segy_file, subset=horizontal_coordinates)
headers_subset = rfn.merge_arrays((dimension_headers, coordinate_headers), asrecarray=True, flatten=True)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This merge function is single threaded and computationally expensive. Please investigate whether there are any better approaches.

@BrianMichell BrianMichell left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Great work @dmitriyrepin! Thank you for resolving the regressions so quicky.


return dimensions, chunksize
if grid_overrides.get("NonBinned") or grid_overrides.get("HasDuplicates"):
horiz_dims_coords_headers = rfn.append_fields(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Untested on scale data that would enter this branch, but resolves the regression for binned data

# Conflicts:
#	src/mdio/converters/segy.py
#	src/mdio/schemas/v1/templates/abstract_dataset_template.py
#	tests/integration/conftest.py
#	tests/integration/test_segy_import_export.py
@tasansal

tasansal commented Sep 5, 2025

Copy link
Copy Markdown
Contributor

The logic of this is completely wrong and only works for a Template type that doesn't usually have these problems. I am going to merge this after minor corrections is but needs a large rework.

@tasansal

tasansal commented Sep 5, 2025

Copy link
Copy Markdown
Contributor

after looking at this in more detail, this breaks other functionality and needs to be reimplemented. going to close.

@tasansal tasansal closed this Sep 5, 2025
@tasansal tasansal mentioned this pull request Sep 5, 2025
3 tasks done
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.

3 participants