LoopStructural 1.6.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of LoopStructural might be problematic. Click here for more details.
- LoopStructural/__init__.py +52 -0
- LoopStructural/datasets/__init__.py +23 -0
- LoopStructural/datasets/_base.py +301 -0
- LoopStructural/datasets/_example_models.py +10 -0
- LoopStructural/datasets/data/claudius.csv +21049 -0
- LoopStructural/datasets/data/claudiusbb.txt +2 -0
- LoopStructural/datasets/data/duplex.csv +126 -0
- LoopStructural/datasets/data/duplexbb.txt +2 -0
- LoopStructural/datasets/data/fault_trace/fault_trace.cpg +1 -0
- LoopStructural/datasets/data/fault_trace/fault_trace.dbf +0 -0
- LoopStructural/datasets/data/fault_trace/fault_trace.prj +1 -0
- LoopStructural/datasets/data/fault_trace/fault_trace.shp +0 -0
- LoopStructural/datasets/data/fault_trace/fault_trace.shx +0 -0
- LoopStructural/datasets/data/geological_map_data/bbox.csv +2 -0
- LoopStructural/datasets/data/geological_map_data/contacts.csv +657 -0
- LoopStructural/datasets/data/geological_map_data/fault_displacement.csv +7 -0
- LoopStructural/datasets/data/geological_map_data/fault_edges.txt +2 -0
- LoopStructural/datasets/data/geological_map_data/fault_locations.csv +79 -0
- LoopStructural/datasets/data/geological_map_data/fault_orientations.csv +19 -0
- LoopStructural/datasets/data/geological_map_data/stratigraphic_order.csv +13 -0
- LoopStructural/datasets/data/geological_map_data/stratigraphic_orientations.csv +207 -0
- LoopStructural/datasets/data/geological_map_data/stratigraphic_thickness.csv +13 -0
- LoopStructural/datasets/data/intrusion.csv +1017 -0
- LoopStructural/datasets/data/intrusionbb.txt +2 -0
- LoopStructural/datasets/data/onefoldbb.txt +2 -0
- LoopStructural/datasets/data/onefolddata.csv +2226 -0
- LoopStructural/datasets/data/refolded_bb.txt +2 -0
- LoopStructural/datasets/data/refolded_fold.csv +205 -0
- LoopStructural/datasets/data/tabular_intrusion.csv +23 -0
- LoopStructural/datatypes/__init__.py +4 -0
- LoopStructural/datatypes/_bounding_box.py +422 -0
- LoopStructural/datatypes/_point.py +166 -0
- LoopStructural/datatypes/_structured_grid.py +94 -0
- LoopStructural/datatypes/_surface.py +184 -0
- LoopStructural/export/exporters.py +554 -0
- LoopStructural/export/file_formats.py +15 -0
- LoopStructural/export/geoh5.py +100 -0
- LoopStructural/export/gocad.py +126 -0
- LoopStructural/export/omf_wrapper.py +88 -0
- LoopStructural/interpolators/__init__.py +105 -0
- LoopStructural/interpolators/_api.py +143 -0
- LoopStructural/interpolators/_builders.py +149 -0
- LoopStructural/interpolators/_cython/__init__.py +0 -0
- LoopStructural/interpolators/_discrete_fold_interpolator.py +183 -0
- LoopStructural/interpolators/_discrete_interpolator.py +692 -0
- LoopStructural/interpolators/_finite_difference_interpolator.py +470 -0
- LoopStructural/interpolators/_geological_interpolator.py +380 -0
- LoopStructural/interpolators/_interpolator_factory.py +89 -0
- LoopStructural/interpolators/_non_linear_discrete_interpolator.py +0 -0
- LoopStructural/interpolators/_operator.py +38 -0
- LoopStructural/interpolators/_p1interpolator.py +228 -0
- LoopStructural/interpolators/_p2interpolator.py +277 -0
- LoopStructural/interpolators/_surfe_wrapper.py +174 -0
- LoopStructural/interpolators/supports/_2d_base_unstructured.py +340 -0
- LoopStructural/interpolators/supports/_2d_p1_unstructured.py +68 -0
- LoopStructural/interpolators/supports/_2d_p2_unstructured.py +288 -0
- LoopStructural/interpolators/supports/_2d_structured_grid.py +462 -0
- LoopStructural/interpolators/supports/_2d_structured_tetra.py +0 -0
- LoopStructural/interpolators/supports/_3d_base_structured.py +467 -0
- LoopStructural/interpolators/supports/_3d_p2_tetra.py +331 -0
- LoopStructural/interpolators/supports/_3d_structured_grid.py +470 -0
- LoopStructural/interpolators/supports/_3d_structured_tetra.py +746 -0
- LoopStructural/interpolators/supports/_3d_unstructured_tetra.py +637 -0
- LoopStructural/interpolators/supports/__init__.py +55 -0
- LoopStructural/interpolators/supports/_aabb.py +77 -0
- LoopStructural/interpolators/supports/_base_support.py +114 -0
- LoopStructural/interpolators/supports/_face_table.py +70 -0
- LoopStructural/interpolators/supports/_support_factory.py +32 -0
- LoopStructural/modelling/__init__.py +29 -0
- LoopStructural/modelling/core/__init__.py +0 -0
- LoopStructural/modelling/core/geological_model.py +1867 -0
- LoopStructural/modelling/features/__init__.py +32 -0
- LoopStructural/modelling/features/_analytical_feature.py +79 -0
- LoopStructural/modelling/features/_base_geological_feature.py +364 -0
- LoopStructural/modelling/features/_cross_product_geological_feature.py +100 -0
- LoopStructural/modelling/features/_geological_feature.py +288 -0
- LoopStructural/modelling/features/_lambda_geological_feature.py +93 -0
- LoopStructural/modelling/features/_region.py +18 -0
- LoopStructural/modelling/features/_structural_frame.py +186 -0
- LoopStructural/modelling/features/_unconformity_feature.py +83 -0
- LoopStructural/modelling/features/builders/__init__.py +5 -0
- LoopStructural/modelling/features/builders/_base_builder.py +111 -0
- LoopStructural/modelling/features/builders/_fault_builder.py +590 -0
- LoopStructural/modelling/features/builders/_folded_feature_builder.py +129 -0
- LoopStructural/modelling/features/builders/_geological_feature_builder.py +543 -0
- LoopStructural/modelling/features/builders/_structural_frame_builder.py +237 -0
- LoopStructural/modelling/features/fault/__init__.py +3 -0
- LoopStructural/modelling/features/fault/_fault_function.py +444 -0
- LoopStructural/modelling/features/fault/_fault_function_feature.py +82 -0
- LoopStructural/modelling/features/fault/_fault_segment.py +505 -0
- LoopStructural/modelling/features/fold/__init__.py +9 -0
- LoopStructural/modelling/features/fold/_fold.py +167 -0
- LoopStructural/modelling/features/fold/_fold_rotation_angle.py +149 -0
- LoopStructural/modelling/features/fold/_fold_rotation_angle_feature.py +67 -0
- LoopStructural/modelling/features/fold/_foldframe.py +194 -0
- LoopStructural/modelling/features/fold/_svariogram.py +188 -0
- LoopStructural/modelling/input/__init__.py +2 -0
- LoopStructural/modelling/input/fault_network.py +80 -0
- LoopStructural/modelling/input/map2loop_processor.py +165 -0
- LoopStructural/modelling/input/process_data.py +650 -0
- LoopStructural/modelling/input/project_file.py +84 -0
- LoopStructural/modelling/intrusions/__init__.py +25 -0
- LoopStructural/modelling/intrusions/geom_conceptual_models.py +142 -0
- LoopStructural/modelling/intrusions/geometric_scaling_functions.py +123 -0
- LoopStructural/modelling/intrusions/intrusion_builder.py +672 -0
- LoopStructural/modelling/intrusions/intrusion_feature.py +410 -0
- LoopStructural/modelling/intrusions/intrusion_frame_builder.py +971 -0
- LoopStructural/modelling/intrusions/intrusion_support_functions.py +460 -0
- LoopStructural/utils/__init__.py +38 -0
- LoopStructural/utils/_surface.py +143 -0
- LoopStructural/utils/_transformation.py +76 -0
- LoopStructural/utils/config.py +18 -0
- LoopStructural/utils/dtm_creator.py +17 -0
- LoopStructural/utils/exceptions.py +31 -0
- LoopStructural/utils/helper.py +292 -0
- LoopStructural/utils/json_encoder.py +18 -0
- LoopStructural/utils/linalg.py +8 -0
- LoopStructural/utils/logging.py +79 -0
- LoopStructural/utils/maths.py +245 -0
- LoopStructural/utils/regions.py +103 -0
- LoopStructural/utils/typing.py +7 -0
- LoopStructural/utils/utils.py +68 -0
- LoopStructural/version.py +1 -0
- LoopStructural/visualisation/__init__.py +11 -0
- LoopStructural-1.6.1.dist-info/LICENSE +21 -0
- LoopStructural-1.6.1.dist-info/METADATA +81 -0
- LoopStructural-1.6.1.dist-info/RECORD +129 -0
- LoopStructural-1.6.1.dist-info/WHEEL +5 -0
- LoopStructural-1.6.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
from LoopStructural.utils import getLogger
|
|
2
|
+
|
|
3
|
+
logger = getLogger(__name__)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class BaseBuilder:
|
|
7
|
+
def __init__(self, model, name: str = "Feature"):
|
|
8
|
+
"""Base builder that provides a template for
|
|
9
|
+
implementing different builders.
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
Parameters
|
|
13
|
+
----------
|
|
14
|
+
name : str, optional
|
|
15
|
+
The name of the feature being built. The name needs to be unique
|
|
16
|
+
for the model, by default "Feature"
|
|
17
|
+
|
|
18
|
+
Notes
|
|
19
|
+
------
|
|
20
|
+
The interpolation/work should only be done when .build() is called
|
|
21
|
+
.feature should return a reference to the feature, which may not be up
|
|
22
|
+
to date.
|
|
23
|
+
If the build arguments are changed, this will flag that the feature needs to be rebuilt
|
|
24
|
+
"""
|
|
25
|
+
self._name = name
|
|
26
|
+
self._model = model
|
|
27
|
+
self._feature = None
|
|
28
|
+
self._up_to_date = False
|
|
29
|
+
self._build_arguments = {}
|
|
30
|
+
self.faults = []
|
|
31
|
+
|
|
32
|
+
@property
|
|
33
|
+
def model(self):
|
|
34
|
+
return self._model
|
|
35
|
+
|
|
36
|
+
@property
|
|
37
|
+
def feature(self):
|
|
38
|
+
return self._feature
|
|
39
|
+
|
|
40
|
+
@property
|
|
41
|
+
def build_arguments(self):
|
|
42
|
+
return self._build_arguments
|
|
43
|
+
|
|
44
|
+
@build_arguments.setter
|
|
45
|
+
def build_arguments(self, build_arguments):
|
|
46
|
+
# self._build_arguments = {}
|
|
47
|
+
for k, i in build_arguments.items():
|
|
48
|
+
if i != self._build_arguments.get(k, None):
|
|
49
|
+
self._build_arguments[k] = i
|
|
50
|
+
## if build_arguments change then flag to reinterpolate
|
|
51
|
+
self._up_to_date = False
|
|
52
|
+
|
|
53
|
+
def update(self):
|
|
54
|
+
if self._up_to_date:
|
|
55
|
+
logger.info(f"{self.name} is up to date")
|
|
56
|
+
return
|
|
57
|
+
logger.info(f"Updating {self.name}")
|
|
58
|
+
self._feature.faults = self.faults
|
|
59
|
+
self.build(**self.build_arguments)
|
|
60
|
+
|
|
61
|
+
def build(self, **kwargs):
|
|
62
|
+
raise NotImplementedError("BaseBuilder should be inherited and build method overwritten")
|
|
63
|
+
|
|
64
|
+
@property
|
|
65
|
+
def name(self):
|
|
66
|
+
return self._name
|
|
67
|
+
|
|
68
|
+
def up_to_date(self, callback=None):
|
|
69
|
+
"""
|
|
70
|
+
check if the feature is uptodate
|
|
71
|
+
if its not update.
|
|
72
|
+
|
|
73
|
+
Parameters
|
|
74
|
+
----------
|
|
75
|
+
callback : function
|
|
76
|
+
a function that is called when the feature is updated
|
|
77
|
+
|
|
78
|
+
"""
|
|
79
|
+
logger.info(f'Feature: {self.name} up to date: {self._up_to_date}')
|
|
80
|
+
for f in self.faults:
|
|
81
|
+
f.builder.up_to_date(callback=callback)
|
|
82
|
+
# has anything changed in the builder since we built the feature? if so update
|
|
83
|
+
if not self._up_to_date:
|
|
84
|
+
self.update()
|
|
85
|
+
if callable(callback):
|
|
86
|
+
callback(1)
|
|
87
|
+
return
|
|
88
|
+
# check if the interpolator is up to date, if not solve
|
|
89
|
+
if not self._interpolator.up_to_date:
|
|
90
|
+
self.update()
|
|
91
|
+
if callable(callback):
|
|
92
|
+
callback(1)
|
|
93
|
+
return
|
|
94
|
+
if callable(callback):
|
|
95
|
+
callback(1)
|
|
96
|
+
|
|
97
|
+
def add_fault(self, fault):
|
|
98
|
+
"""
|
|
99
|
+
Add a fault to the geological feature builder
|
|
100
|
+
|
|
101
|
+
Parameters
|
|
102
|
+
----------
|
|
103
|
+
fault : FaultSegment
|
|
104
|
+
A faultsegment to add to the geological feature
|
|
105
|
+
|
|
106
|
+
Returns
|
|
107
|
+
-------
|
|
108
|
+
|
|
109
|
+
"""
|
|
110
|
+
self._up_to_date = False
|
|
111
|
+
self.faults.append(fault)
|