23
23
"""
24
24
25
25
def test_read_input_points ():
26
+ _ , _ = _read_data ()
27
+
28
+
29
+ def _read_data () -> tuple [SurfacePointsTable , OrientationsTable ]:
26
30
data_path = 'https://raw.githubusercontent.com/cgre-aachen/gempy_data/master/'
27
31
surface_points_file = pooch .retrieve (
28
32
url = data_path + "data/input_data/jan_models/model1_surface_points.csv" ,
29
33
known_hash = "6f1a39ed77e87a4057f03629c946b1876b87e24409cadfe0e1cf7ab1488f69e4"
30
34
)
31
-
32
35
orientations_file = pooch .retrieve (
33
36
url = data_path + "data/input_data/jan_models/model1_orientations.csv" ,
34
37
known_hash = "04c307ae23f70252fe54144a2fb95ca7d96584a2d497ea539ed32dfd23e7cd5d"
35
38
)
36
-
37
39
print (pooch .file_hash (surface_points_file ))
38
40
print (pooch .file_hash (orientations_file ))
39
-
40
41
surface_points : SurfacePointsTable = read_surface_points (
41
42
path = surface_points_file ,
42
43
)
43
-
44
44
orientations : OrientationsTable = read_orientations (
45
45
path = orientations_file
46
46
)
47
-
48
47
return surface_points , orientations
49
48
50
49
51
- def test_create_grid () -> gp .data .Grid :
50
+ def test_create_grid ():
51
+ _generate_grid ()
52
+
53
+
54
+ def _generate_grid ():
52
55
grid : gp .data .Grid = gp .data .Grid (
53
56
extent = [0 , 1000 , 0 , 1000 , 0 , 500 ],
54
57
resolution = [50 , 5 , 50 ]
55
58
)
56
-
57
59
return grid
58
60
59
61
60
- def test_create_structural_frame () -> StructuralFrame :
62
+ def test_create_structural_frame ():
61
63
# * Structural elements
62
- surface_points , orientations = test_read_input_points ()
64
+ _create_structural_frame ()
65
+
66
+
67
+ def _create_structural_frame ():
68
+ surface_points , orientations = _read_data ()
63
69
surface_points_groups = surface_points .get_surface_points_by_id_groups ()
64
70
orientations_groups = orientations .get_orientations_by_id_groups ()
65
-
66
71
structural_elements = []
67
72
color_gen = ColorsGenerator ()
68
73
for i in range (len (surface_points_groups )):
@@ -75,52 +80,52 @@ def test_create_structural_frame() -> StructuralFrame:
75
80
)
76
81
77
82
structural_elements .append (structural_element )
78
-
79
83
# * Structural groups definitions
80
84
default_formation : Stack = Stack (
81
85
name = "default_formation" ,
82
86
elements = structural_elements ,
83
87
structural_relation = gp .data .StackRelationType .ERODE
84
88
)
85
-
86
89
# ? Should I move this to the constructor?
87
90
structural_frame : StructuralFrame = StructuralFrame (
88
91
structural_groups = [default_formation ],
89
92
color_gen = color_gen
90
93
)
91
-
92
94
return structural_frame
93
95
94
96
95
- def test_create_interpolation_options () -> InterpolationOptions :
97
+ def test_create_interpolation_options ():
98
+ interpolation_options = _generate_interpolation_options ()
99
+
100
+
101
+ def _generate_interpolation_options ():
96
102
range_ = 1000.0
97
103
interpolation_options : InterpolationOptions = InterpolationOptions .from_args (
98
104
range = range_ ,
99
105
c_o = (range_ ** 2 ) / 14 / 3 ,
100
106
)
101
-
102
107
return interpolation_options
103
108
104
109
105
- def test_create_geomodel () -> GeoModel :
110
+ def _create_geomodel () -> GeoModel :
106
111
geo_model : GeoModel = GeoModel .from_args (
107
112
name = "horizontal" ,
108
- structural_frame = test_create_structural_frame (),
109
- grid = test_create_grid (),
110
- interpolation_options = test_create_interpolation_options ()
113
+ structural_frame = _create_structural_frame (),
114
+ grid = _generate_grid (),
115
+ interpolation_options = _generate_interpolation_options ()
111
116
)
112
117
113
118
return geo_model
114
119
115
120
116
121
def test_structural_frame_surface_points ():
117
- structural_frame : StructuralFrame = test_create_structural_frame ()
122
+ structural_frame : StructuralFrame = _create_structural_frame ()
118
123
print (structural_frame .surface_points_copy )
119
124
pass
120
125
121
126
122
- def test_interpolate_numpy () -> GeoModel :
123
- geo_model : GeoModel = test_create_geomodel ()
127
+ def _interpolate_numpy () -> GeoModel :
128
+ geo_model : GeoModel = _create_geomodel ()
124
129
125
130
solutions : gempy_engine .core .data .solutions .Solutions = gempy_engine .compute_model (
126
131
interpolation_input = geo_model .interpolation_input_copy ,
@@ -147,11 +152,11 @@ def test_interpolate_numpy() -> GeoModel:
147
152
148
153
149
154
def test_interpolate_aesara ():
150
- geo_model : GeoModel = test_create_geomodel ()
155
+ geo_model : GeoModel = _create_geomodel ()
151
156
152
157
153
158
def test_plot_input ():
154
- geo_model : GeoModel = test_create_geomodel ()
159
+ geo_model : GeoModel = _create_geomodel ()
155
160
gp_viewer : gempy_viewer = require_gempy_viewer ()
156
161
# TODO: Add all the plot data in a plot options class
157
162
@@ -164,7 +169,7 @@ def test_plot_input():
164
169
165
170
166
171
def test_plot_results ():
167
- solved_geo_model : GeoModel = test_interpolate_numpy ()
172
+ solved_geo_model : GeoModel = _interpolate_numpy ()
168
173
gp_viewer : gempy_viewer = require_gempy_viewer ()
169
174
170
175
gp_viewer .plot_2d (
0 commit comments