-
-
Notifications
You must be signed in to change notification settings - Fork 262
[ENH] Add fault relation example model and fix fault relation implementation #1075
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+212
−26
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
56dac8f
Tests to check if set fault relations work. Example Model "FAULT_RELA…
NilsChudalla b6de9f0
[TEST] Getting test running in the agent
Leguark 532bb55
[BUG] Custom fault relation was broken for a refactor
Leguark e2fb21e
[BUG] Pandas 3.0 breaks gempy oh surprise
Leguark ed3b2a7
[META] Fix pandas version until subsurface update
Leguark 34cb405
Refactor geophysics module and adjust server configs
Leguark ef5a50f
[TEST] Remove serialization validation for this PR since we have alre…
Leguark File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
examples/data/input_data/tests/fault_relations_test_ori.csv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| X,Y,Z,G_x,G_y,G_z,id,nugget,formation | ||
| 350.0,500.0,-700.0,0.8949343616020251,5.4798925069145e-17,0.4461978131098087,26244822,0.01,fault1 | ||
| 550.0,500.0,-600.0,-0.8949343616015264,-1.6439677520734337e-16,0.44619781311080886,124053343,0.01,fault2 | ||
| 400.0,500.0,-625.0,0.0,0.0,1.0,563652887,0.01,rock4 | ||
| 150.0,500.0,-550.0,0.0,0.0,1.0,563652887,0.01,rock4 | ||
| 850.0,500.0,-525.0,0.0,0.0,1.0,563652887,0.01,rock4 | ||
| 400.0,500.0,-675.0,0.0,0.0,1.0,438217026,0.01,rock3 | ||
| 150.0,500.0,-600.0,0.0,0.0,1.0,438217026,0.01,rock3 | ||
| 850.0,500.0,-575.0,0.0,0.0,1.0,438217026,0.01,rock3 | ||
| 850.0,500.0,-625.0,0.0,0.0,1.0,317776925,0.01,rock2 | ||
| 150.0,500.0,-650.0,0.0,0.0,1.0,317776925,0.01,rock2 | ||
| 150.0,500.0,-700.0,0.0,0.0,1.0,267239155,0.01,rock1 | ||
| 850.0,500.0,-675.0,0.0,0.0,1.0,267239155,0.01,rock1 |
73 changes: 73 additions & 0 deletions
73
examples/data/input_data/tests/fault_relations_test_surf.csv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| X,Y,Z,id,nugget,formation | ||
| 300.0,200.0,-600.0,26244822,2e-05,fault1 | ||
| 300.0,500.0,-600.0,26244822,2e-05,fault1 | ||
| 300.0,800.0,-600.0,26244822,2e-05,fault1 | ||
| 350.0,200.0,-700.0,26244822,2e-05,fault1 | ||
| 350.0,500.0,-700.0,26244822,2e-05,fault1 | ||
| 350.0,800.0,-700.0,26244822,2e-05,fault1 | ||
| 400.0,800.0,-800.0,26244822,2e-05,fault1 | ||
| 400.0,500.0,-800.0,26244822,2e-05,fault1 | ||
| 400.0,200.0,-800.0,26244822,2e-05,fault1 | ||
| 500.0,500.0,-700.0,124053343,2e-05,fault2 | ||
| 500.0,200.0,-700.0,124053343,2e-05,fault2 | ||
| 500.0,800.0,-700.0,124053343,2e-05,fault2 | ||
| 550.0,200.0,-600.0,124053343,2e-05,fault2 | ||
| 550.0,500.0,-600.0,124053343,2e-05,fault2 | ||
| 550.0,800.0,-600.0,124053343,2e-05,fault2 | ||
| 600.0,200.0,-500.0,124053343,2e-05,fault2 | ||
| 600.0,500.0,-500.0,124053343,2e-05,fault2 | ||
| 600.0,800.0,-500.0,124053343,2e-05,fault2 | ||
| 400.0,200.0,-625.0,563652887,2e-05,rock4 | ||
| 100.0,500.0,-550.0,563652887,2e-05,rock4 | ||
| 100.0,800.0,-550.0,563652887,2e-05,rock4 | ||
| 100.0,200.0,-550.0,563652887,2e-05,rock4 | ||
| 200.0,200.0,-550.0,563652887,2e-05,rock4 | ||
| 200.0,500.0,-550.0,563652887,2e-05,rock4 | ||
| 200.0,800.0,-550.0,563652887,2e-05,rock4 | ||
| 800.0,200.0,-525.0,563652887,2e-05,rock4 | ||
| 800.0,500.0,-525.0,563652887,2e-05,rock4 | ||
| 800.0,800.0,-525.0,563652887,2e-05,rock4 | ||
| 900.0,200.0,-525.0,563652887,2e-05,rock4 | ||
| 900.0,500.0,-525.0,563652887,2e-05,rock4 | ||
| 900.0,800.0,-525.0,563652887,2e-05,rock4 | ||
| 400.0,500.0,-625.0,563652887,2e-05,rock4 | ||
| 400.0,800.0,-625.0,563652887,2e-05,rock4 | ||
| 400.0,800.0,-675.0,438217026,2e-05,rock3 | ||
| 100.0,200.0,-600.0,438217026,2e-05,rock3 | ||
| 100.0,500.0,-600.0,438217026,2e-05,rock3 | ||
| 100.0,800.0,-600.0,438217026,2e-05,rock3 | ||
| 200.0,200.0,-600.0,438217026,2e-05,rock3 | ||
| 200.0,500.0,-600.0,438217026,2e-05,rock3 | ||
| 200.0,800.0,-600.0,438217026,2e-05,rock3 | ||
| 800.0,200.0,-575.0,438217026,2e-05,rock3 | ||
| 800.0,500.0,-575.0,438217026,2e-05,rock3 | ||
| 800.0,800.0,-575.0,438217026,2e-05,rock3 | ||
| 900.0,500.0,-575.0,438217026,2e-05,rock3 | ||
| 900.0,200.0,-575.0,438217026,2e-05,rock3 | ||
| 900.0,800.0,-575.0,438217026,2e-05,rock3 | ||
| 400.0,200.0,-675.0,438217026,2e-05,rock3 | ||
| 400.0,500.0,-675.0,438217026,2e-05,rock3 | ||
| 200.0,800.0,-650.0,317776925,2e-05,rock2 | ||
| 200.0,500.0,-650.0,317776925,2e-05,rock2 | ||
| 200.0,200.0,-650.0,317776925,2e-05,rock2 | ||
| 100.0,500.0,-650.0,317776925,2e-05,rock2 | ||
| 100.0,800.0,-650.0,317776925,2e-05,rock2 | ||
| 100.0,200.0,-650.0,317776925,2e-05,rock2 | ||
| 900.0,200.0,-625.0,317776925,2e-05,rock2 | ||
| 900.0,500.0,-625.0,317776925,2e-05,rock2 | ||
| 900.0,800.0,-625.0,317776925,2e-05,rock2 | ||
| 800.0,200.0,-625.0,317776925,2e-05,rock2 | ||
| 800.0,500.0,-625.0,317776925,2e-05,rock2 | ||
| 800.0,800.0,-625.0,317776925,2e-05,rock2 | ||
| 100.0,200.0,-700.0,267239155,2e-05,rock1 | ||
| 100.0,500.0,-700.0,267239155,2e-05,rock1 | ||
| 100.0,800.0,-700.0,267239155,2e-05,rock1 | ||
| 200.0,200.0,-700.0,267239155,2e-05,rock1 | ||
| 200.0,500.0,-700.0,267239155,2e-05,rock1 | ||
| 200.0,800.0,-700.0,267239155,2e-05,rock1 | ||
| 900.0,200.0,-675.0,267239155,2e-05,rock1 | ||
| 900.0,500.0,-675.0,267239155,2e-05,rock1 | ||
| 900.0,800.0,-675.0,267239155,2e-05,rock1 | ||
| 800.0,200.0,-675.0,267239155,2e-05,rock1 | ||
| 800.0,500.0,-675.0,267239155,2e-05,rock1 | ||
| 800.0,800.0,-675.0,267239155,2e-05,rock1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,4 +2,4 @@ | |
|
|
||
| # This install matplotlib | ||
| gempy_viewer~=2025.1.4 | ||
| pandas | ||
| pandas>=2.2.0,<3.0.0 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import numpy as np | ||
| import gempy as gp | ||
| from gempy.core.data.enumerators import ExampleModel | ||
| from gempy.optional_dependencies import require_gempy_viewer | ||
|
|
||
| PLOT = True | ||
|
|
||
|
|
||
| def test_fault_relations_implementation(): | ||
| # TODO! (Miguel Dec25) These fault description are not serializing! | ||
| model = gp.generate_example_model(ExampleModel.FAULT_RELATION, compute_model=True) | ||
|
|
||
| correct_relations = np.array([ | ||
| [0, 1, 1, 1], | ||
| [0, 0, 0, 1], | ||
| [0, 0, 0, 0], | ||
| [0, 0, 0, 0] | ||
| ], dtype=bool) | ||
|
|
||
| # Assert | ||
| assert np.array_equal(model.structural_frame.fault_relations, correct_relations) == True | ||
|
|
||
| if PLOT: | ||
| gpv = require_gempy_viewer() | ||
| gtv: gpv.GemPyToVista = gpv.plot_3d( | ||
| model=model, | ||
| show_data=True, | ||
| image=True, | ||
| show=True | ||
| ) |
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| import numpy as np | ||
| import os | ||
| import pandas as pd | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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!