23
23
"""
24
24
25
25
def test_read_input_points ():
26
+ _ , _ = _read_data ()
27
+
28
+
29
+ def _read_data () -> tuple [OrientationsTable , SurfacePointsTable ]:
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
+ return orientations , surface_points
48
+
47
49
48
- return surface_points , orientations
50
+ def test_create_grid ():
51
+ _generate_grid ()
49
52
50
53
51
- def test_create_grid () -> gp . data . Grid :
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,46 +80,46 @@ 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
110
def test_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
0 commit comments