Skip to content

Conversation

@NilsChudalla
Copy link
Member

@NilsChudalla NilsChudalla commented Nov 12, 2025

Description

In example "ch1_5", function set_fault_relation does not work as intended as described in issue #1074. I tried this in some other models, where the behaviour is still off. This is a WIP, where I turned the model from ch1_5 into a test. For this model it works.

I am willingt to try myself, @Leguark, but I spent quite some time in it already and am a bit out of ideas.

Added a new example model for fault relations testing and fixed an issue in the fault relations implementation. The bug was in the fault_relations property of the StructuralFrame class, where fault relations were not being properly set in the matrix. This PR adds a test case that verifies the correct implementation of fault relations.

Also added support for pandas StringArray type in the generate_ids_from_names function to handle different pandas data types properly. Updated the pandas dependency to require version 2.2.0 or higher.

Additionally, moved the geophysics tests from the "_geophysics_TO_UPDATE" directory to "test_geophysics" and updated the test verification files to match the current output format.

Checklist

  • My code uses type hinting for function and method arguments and return values.
  • I have created tests which cover my code.
  • The test code either 1. demonstrates at least one valuable use case (e.g. integration tests)
    or 2. verifies that outputs are as expected for given inputs (e.g. unit tests).
  • New tests pass locally with my changes.

…TION" is based on the model from tutorial ch1_5, where this did not work. For the video tutorial model, set fault relations does work.
Copy link
Member

Leguark commented Nov 13, 2025

it is failing the new test looking for the data. I will look into it

    FileNotFoundError: [Errno 2] No such file or directory: '/home/leguark/buildAgent/work/d766739d2d98fcb9/gempy/API/..\\..\\examples\\data\\input_data\\tests\\fault_relations_test_surf.csv'

venv/lib/python3.13/site-packages/pandas/io/common.py:873: FileNotFoundError

@Leguark Leguark self-requested a review December 5, 2025 10:19
j = self.structural_groups.index(fault_group)
if j <= i: # Only consider groups that are
raise ValueError(f"Fault {group.name} cannot affect older fault {fault_group.name}")
fault_relations[i, j] = True
Copy link
Member

@Leguark Leguark Dec 5, 2025

Choose a reason for hiding this comment

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

This line of code was removed in 2023 when I added the next case and no test was picking it up thank you Nils. Great catch!

Leguark
Leguark previously approved these changes Dec 5, 2025
Copy link
Member

@Leguark Leguark left a comment

Choose a reason for hiding this comment

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

Thank you for finding such a huge bug and provide the a test for it!

@Leguark Leguark self-requested a review December 5, 2025 10:49
@Leguark Leguark dismissed their stale review December 5, 2025 10:50

my changes are breaking other functions looking into it

Renamed and restructured the geophysics test module to improve organization. Updated server configuration to disable GPU usage and set logging level to debug. Enhanced file verification functionality with environment-aware diff reporters.
Copy link
Member

@Leguark Leguark left a comment

Choose a reason for hiding this comment

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

Well, it took a couple of extra steps that had nothing to do with your PR. But this is ready for big green button to be pressed. I will do it and make a pip pre- release with the changes in case you need the code

@Leguark Leguark changed the title Unidentified issue with "set_fault_relation" [ENH] Add fault relation example model and fix fault relation implementation Dec 9, 2025
@Leguark Leguark merged commit 7a2a176 into gempy-project:main Dec 9, 2025
2 checks passed
@NilsChudalla
Copy link
Member Author

Thank you very much Miguel! I am happy I could contribute. Also, I am learning a bunch!

Copy link
Member

Leguark commented Dec 9, 2025

here the pre release pip install gempy==2025.2.1a1

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