LoopStructural 1.6.19__tar.gz → 1.6.21__tar.gz

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.

Files changed (150) hide show
  1. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/_p1interpolator.py +3 -2
  2. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/_p2interpolator.py +2 -1
  3. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/core/geological_model.py +29 -28
  4. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/core/stratigraphic_column.py +3 -3
  5. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/_base_geological_feature.py +2 -1
  6. loopstructural-1.6.21/LoopStructural/modelling/features/_feature_converters.py +39 -0
  7. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/_structural_frame.py +2 -6
  8. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/builders/_fault_builder.py +1 -1
  9. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/builders/_folded_feature_builder.py +6 -3
  10. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/builders/_structural_frame_builder.py +34 -0
  11. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/fold/__init__.py +0 -1
  12. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/fold/_foldframe.py +17 -0
  13. loopstructural-1.6.21/LoopStructural/version.py +1 -0
  14. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural.egg-info/PKG-INFO +1 -1
  15. {loopstructural-1.6.19 → loopstructural-1.6.21}/PKG-INFO +1 -1
  16. loopstructural-1.6.19/LoopStructural/modelling/features/_feature_converters.py +0 -13
  17. loopstructural-1.6.19/LoopStructural/version.py +0 -1
  18. {loopstructural-1.6.19 → loopstructural-1.6.21}/LICENSE +0 -0
  19. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/__init__.py +0 -0
  20. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datasets/__init__.py +0 -0
  21. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datasets/_base.py +0 -0
  22. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datasets/_example_models.py +0 -0
  23. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datasets/data/claudius.csv +0 -0
  24. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datasets/data/claudiusbb.txt +0 -0
  25. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datasets/data/duplex.csv +0 -0
  26. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datasets/data/duplexbb.txt +0 -0
  27. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datasets/data/fault_trace/fault_trace.cpg +0 -0
  28. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datasets/data/fault_trace/fault_trace.dbf +0 -0
  29. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datasets/data/fault_trace/fault_trace.prj +0 -0
  30. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datasets/data/fault_trace/fault_trace.shp +0 -0
  31. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datasets/data/fault_trace/fault_trace.shx +0 -0
  32. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datasets/data/geological_map_data/bbox.csv +0 -0
  33. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datasets/data/geological_map_data/contacts.csv +0 -0
  34. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datasets/data/geological_map_data/fault_displacement.csv +0 -0
  35. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datasets/data/geological_map_data/fault_edges.txt +0 -0
  36. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datasets/data/geological_map_data/fault_locations.csv +0 -0
  37. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datasets/data/geological_map_data/fault_orientations.csv +0 -0
  38. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datasets/data/geological_map_data/stratigraphic_order.csv +0 -0
  39. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datasets/data/geological_map_data/stratigraphic_orientations.csv +0 -0
  40. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datasets/data/geological_map_data/stratigraphic_thickness.csv +0 -0
  41. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datasets/data/intrusion.csv +0 -0
  42. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datasets/data/intrusionbb.txt +0 -0
  43. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datasets/data/onefoldbb.txt +0 -0
  44. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datasets/data/onefolddata.csv +0 -0
  45. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datasets/data/refolded_bb.txt +0 -0
  46. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datasets/data/refolded_fold.csv +0 -0
  47. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datasets/data/tabular_intrusion.csv +0 -0
  48. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datatypes/__init__.py +0 -0
  49. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datatypes/_bounding_box.py +0 -0
  50. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datatypes/_point.py +0 -0
  51. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datatypes/_structured_grid.py +0 -0
  52. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/datatypes/_surface.py +0 -0
  53. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/export/exporters.py +0 -0
  54. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/export/file_formats.py +0 -0
  55. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/export/geoh5.py +0 -0
  56. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/export/gocad.py +0 -0
  57. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/export/omf_wrapper.py +0 -0
  58. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/__init__.py +0 -0
  59. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/_api.py +0 -0
  60. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/_builders.py +0 -0
  61. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/_constant_norm.py +0 -0
  62. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/_cython/__init__.py +0 -0
  63. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/_discrete_fold_interpolator.py +0 -0
  64. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/_discrete_interpolator.py +0 -0
  65. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/_finite_difference_interpolator.py +0 -0
  66. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/_geological_interpolator.py +0 -0
  67. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/_interpolator_builder.py +0 -0
  68. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/_interpolator_factory.py +0 -0
  69. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/_interpolatortype.py +0 -0
  70. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/_operator.py +0 -0
  71. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/_surfe_wrapper.py +0 -0
  72. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/supports/_2d_base_unstructured.py +0 -0
  73. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/supports/_2d_p1_unstructured.py +0 -0
  74. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/supports/_2d_p2_unstructured.py +0 -0
  75. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/supports/_2d_structured_grid.py +0 -0
  76. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/supports/_2d_structured_tetra.py +0 -0
  77. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/supports/_3d_base_structured.py +0 -0
  78. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/supports/_3d_p2_tetra.py +0 -0
  79. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/supports/_3d_structured_grid.py +0 -0
  80. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/supports/_3d_structured_tetra.py +0 -0
  81. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/supports/_3d_unstructured_tetra.py +0 -0
  82. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/supports/__init__.py +0 -0
  83. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/supports/_aabb.py +0 -0
  84. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/supports/_base_support.py +0 -0
  85. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/supports/_face_table.py +0 -0
  86. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/interpolators/supports/_support_factory.py +0 -0
  87. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/__init__.py +0 -0
  88. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/core/__init__.py +0 -0
  89. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/core/fault_topology.py +0 -0
  90. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/__init__.py +0 -0
  91. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/_analytical_feature.py +0 -0
  92. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/_cross_product_geological_feature.py +0 -0
  93. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/_geological_feature.py +0 -0
  94. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/_lambda_geological_feature.py +0 -0
  95. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/_projected_vector_feature.py +0 -0
  96. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/_region.py +0 -0
  97. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/_unconformity_feature.py +0 -0
  98. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/builders/__init__.py +0 -0
  99. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/builders/_base_builder.py +0 -0
  100. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/builders/_geological_feature_builder.py +0 -0
  101. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/fault/__init__.py +0 -0
  102. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/fault/_fault_function.py +0 -0
  103. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/fault/_fault_function_feature.py +0 -0
  104. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/fault/_fault_segment.py +0 -0
  105. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/fold/_fold.py +0 -0
  106. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/fold/_fold_rotation_angle_feature.py +0 -0
  107. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/fold/_svariogram.py +0 -0
  108. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/fold/fold_function/__init__.py +0 -0
  109. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/fold/fold_function/_base_fold_rotation_angle.py +0 -0
  110. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/fold/fold_function/_fourier_series_fold_rotation_angle.py +0 -0
  111. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/fold/fold_function/_lambda_fold_rotation_angle.py +0 -0
  112. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/features/fold/fold_function/_trigo_fold_rotation_angle.py +0 -0
  113. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/input/__init__.py +0 -0
  114. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/input/fault_network.py +0 -0
  115. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/input/map2loop_processor.py +0 -0
  116. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/input/process_data.py +0 -0
  117. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/input/project_file.py +0 -0
  118. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/intrusions/__init__.py +0 -0
  119. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/intrusions/geom_conceptual_models.py +0 -0
  120. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/intrusions/geometric_scaling_functions.py +0 -0
  121. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/intrusions/intrusion_builder.py +0 -0
  122. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/intrusions/intrusion_feature.py +0 -0
  123. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/intrusions/intrusion_frame_builder.py +0 -0
  124. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/modelling/intrusions/intrusion_support_functions.py +0 -0
  125. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/utils/__init__.py +0 -0
  126. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/utils/_surface.py +0 -0
  127. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/utils/_transformation.py +0 -0
  128. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/utils/colours.py +0 -0
  129. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/utils/config.py +0 -0
  130. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/utils/dtm_creator.py +0 -0
  131. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/utils/exceptions.py +0 -0
  132. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/utils/features.py +0 -0
  133. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/utils/helper.py +0 -0
  134. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/utils/json_encoder.py +0 -0
  135. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/utils/linalg.py +0 -0
  136. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/utils/logging.py +0 -0
  137. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/utils/maths.py +0 -0
  138. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/utils/observer.py +0 -0
  139. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/utils/regions.py +0 -0
  140. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/utils/typing.py +0 -0
  141. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/utils/utils.py +0 -0
  142. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural/visualisation/__init__.py +0 -0
  143. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural.egg-info/SOURCES.txt +0 -0
  144. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural.egg-info/dependency_links.txt +0 -0
  145. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural.egg-info/requires.txt +0 -0
  146. {loopstructural-1.6.19 → loopstructural-1.6.21}/LoopStructural.egg-info/top_level.txt +0 -0
  147. {loopstructural-1.6.19 → loopstructural-1.6.21}/README.md +0 -0
  148. {loopstructural-1.6.19 → loopstructural-1.6.21}/pyproject.toml +0 -0
  149. {loopstructural-1.6.19 → loopstructural-1.6.21}/setup.cfg +0 -0
  150. {loopstructural-1.6.19 → loopstructural-1.6.21}/setup.py +0 -0
@@ -6,8 +6,9 @@ import logging
6
6
 
7
7
  import numpy as np
8
8
 
9
- from ._discrete_interpolator import DiscreteInterpolator
10
9
 
10
+ from ._discrete_interpolator import DiscreteInterpolator
11
+ from . import InterpolatorType
11
12
  logger = logging.getLogger(__name__)
12
13
 
13
14
 
@@ -37,7 +38,7 @@ class P1Interpolator(DiscreteInterpolator):
37
38
  "tpw": 1.0,
38
39
  "ipw": 1.0,
39
40
  }
40
-
41
+ self.type = InterpolatorType.PIECEWISE_LINEAR
41
42
  def add_gradient_constraints(self, w=1.0):
42
43
  pass
43
44
 
@@ -8,6 +8,7 @@ from typing import Optional, Callable
8
8
  import numpy as np
9
9
 
10
10
  from ..interpolators import DiscreteInterpolator
11
+ from . import InterpolatorType
11
12
 
12
13
  logger = logging.getLogger(__name__)
13
14
 
@@ -41,7 +42,7 @@ class P2Interpolator(DiscreteInterpolator):
41
42
  "tpw": 1.0,
42
43
  "ipw": 1.0,
43
44
  }
44
-
45
+ self.type = InterpolatorType.PIECEWISE_QUADRATIC
45
46
  def setup_interpolator(self, **kwargs):
46
47
  """
47
48
  Searches through kwargs for any interpolation weights and updates
@@ -21,6 +21,7 @@ from ...modelling.features import (
21
21
  UnconformityFeature,
22
22
  StructuralFrame,
23
23
  GeologicalFeature,
24
+ BaseFeature,
24
25
  FeatureType,
25
26
  )
26
27
  from ...modelling.features.fold import (
@@ -341,7 +342,7 @@ class GeologicalModel:
341
342
  feature : GeologicalFeature
342
343
  the geological feature to set
343
344
  """
344
- if not isinstance(feature, GeologicalFeature):
345
+ if not issubclass(type(feature), BaseFeature):
345
346
  raise TypeError("feature must be a GeologicalFeature")
346
347
  if feature.name != feature_name:
347
348
  raise ValueError("feature name does not match key")
@@ -616,7 +617,7 @@ class GeologicalModel:
616
617
  series_surface_name: str,
617
618
  *,
618
619
  index: Optional[int] = None,
619
- series_surface_data: Optional[pd.DataFrame] = None,
620
+ data: Optional[pd.DataFrame] = None,
620
621
  interpolatortype: str = "FDI",
621
622
  nelements: int = LoopStructuralConfig.nelements,
622
623
  tol=None,
@@ -671,13 +672,13 @@ class GeologicalModel:
671
672
  **kwargs,
672
673
  )
673
674
  # add data
674
- if series_surface_data is None:
675
- series_surface_data = self.data.loc[self.data["feature_name"] == series_surface_name]
675
+ if data is None:
676
+ data = self.data.loc[self.data["feature_name"] == series_surface_name]
676
677
 
677
- if series_surface_data.shape[0] == 0:
678
+ if data.shape[0] == 0:
678
679
  logger.warning("No data for {series_surface_data}, skipping")
679
680
  return
680
- series_builder.add_data_from_data_frame(self.prepare_data(series_surface_data))
681
+ series_builder.add_data_from_data_frame(self.prepare_data(data))
681
682
  self._add_faults(series_builder, features=faults)
682
683
 
683
684
  # build feature
@@ -696,7 +697,7 @@ class GeologicalModel:
696
697
  fold_frame_name: str,
697
698
  *,
698
699
  index: Optional[int] = None,
699
- fold_frame_data=None,
700
+ data=None,
700
701
  interpolatortype="FDI",
701
702
  nelements=LoopStructuralConfig.nelements,
702
703
  tol=None,
@@ -746,12 +747,12 @@ class GeologicalModel:
746
747
  **kwargs,
747
748
  )
748
749
  # add data
749
- if fold_frame_data is None:
750
- fold_frame_data = self.data.loc[self.data["feature_name"] == fold_frame_name]
751
- if fold_frame_data.shape[0] == 0:
750
+ if data is None:
751
+ data = self.data.loc[self.data["feature_name"] == fold_frame_name]
752
+ if data.shape[0] == 0:
752
753
  logger.warning(f"No data for {fold_frame_name}, skipping")
753
754
  return
754
- fold_frame_builder.add_data_from_data_frame(self.prepare_data(fold_frame_data))
755
+ fold_frame_builder.add_data_from_data_frame(self.prepare_data(data))
755
756
  self._add_faults(fold_frame_builder[0])
756
757
  self._add_faults(fold_frame_builder[1])
757
758
  self._add_faults(fold_frame_builder[2])
@@ -770,7 +771,7 @@ class GeologicalModel:
770
771
  foliation_name,
771
772
  *,
772
773
  index: Optional[int] = None,
773
- foliation_data=None,
774
+ data=None,
774
775
  interpolatortype="DFI",
775
776
  nelements=LoopStructuralConfig.nelements,
776
777
  buffer=0.1,
@@ -816,7 +817,7 @@ class GeologicalModel:
816
817
  fold_frame = self.features[-1]
817
818
  assert isinstance(fold_frame, FoldFrame), "Please specify a FoldFrame"
818
819
 
819
- fold = FoldEvent(fold_frame, name=f"Fold_{foliation_data}", invert_norm=invert_fold_norm)
820
+ fold = FoldEvent(fold_frame, name=f"Fold_{foliation_name}", invert_norm=invert_fold_norm)
820
821
 
821
822
  if interpolatortype != "DFI":
822
823
  logger.warning("Folded foliation only supports DFI interpolator, changing to DFI")
@@ -831,12 +832,12 @@ class GeologicalModel:
831
832
  model=self,
832
833
  **kwargs,
833
834
  )
834
- if foliation_data is None:
835
- foliation_data = self.data.loc[self.data["feature_name"] == foliation_name]
836
- if foliation_data.shape[0] == 0:
835
+ if data is None:
836
+ data = self.data.loc[self.data["feature_name"] == foliation_name]
837
+ if data.shape[0] == 0:
837
838
  logger.warning(f"No data for {foliation_name}, skipping")
838
839
  return
839
- series_builder.add_data_from_data_frame(self.prepare_data(foliation_data))
840
+ series_builder.add_data_from_data_frame(self.prepare_data(data))
840
841
 
841
842
  self._add_faults(series_builder)
842
843
  # series_builder.add_data_to_interpolator(True)
@@ -847,7 +848,7 @@ class GeologicalModel:
847
848
  # series_feature = series_builder.build(**kwargs)
848
849
  series_feature = series_builder.feature
849
850
  series_builder.update_build_arguments(kwargs)
850
- series_feature.type = FeatureType.INTERPOLATED
851
+ series_feature.type = FeatureType.FOLDED
851
852
  series_feature.fold = fold
852
853
 
853
854
  self._add_feature(series_feature,index)
@@ -858,7 +859,7 @@ class GeologicalModel:
858
859
  fold_frame_name: str,
859
860
  *,
860
861
  index: Optional[int] = None,
861
- fold_frame_data: Optional[pd.DataFrame] = None,
862
+ data: Optional[pd.DataFrame] = None,
862
863
  interpolatortype="FDI",
863
864
  nelements=LoopStructuralConfig.nelements,
864
865
  fold_frame=None,
@@ -913,7 +914,7 @@ class GeologicalModel:
913
914
  logger.info("Using last feature as fold frame")
914
915
  fold_frame = self.features[-1]
915
916
  assert isinstance(fold_frame, FoldFrame), "Please specify a FoldFrame"
916
- fold = FoldEvent(fold_frame, name=f"Fold_{fold_frame_data}")
917
+ fold = FoldEvent(fold_frame, name=f"Fold_{fold_frame_name}")
917
918
 
918
919
  interpolatortypes = [
919
920
  "DFI",
@@ -930,9 +931,9 @@ class GeologicalModel:
930
931
  model=self,
931
932
  **kwargs,
932
933
  )
933
- if fold_frame_data is None:
934
- fold_frame_data = self.data[self.data["feature_name"] == fold_frame_name]
935
- fold_frame_builder.add_data_from_data_frame(self.prepare_data(fold_frame_data))
934
+ if data is None:
935
+ data = self.data[self.data["feature_name"] == fold_frame_name]
936
+ fold_frame_builder.add_data_from_data_frame(self.prepare_data(data))
936
937
 
937
938
  for i in range(3):
938
939
  self._add_faults(fold_frame_builder[i])
@@ -1293,7 +1294,7 @@ class GeologicalModel:
1293
1294
  displacement: float,
1294
1295
  *,
1295
1296
  index: Optional[int] = None,
1296
- fault_data: Optional[pd.DataFrame] = None,
1297
+ data: Optional[pd.DataFrame] = None,
1297
1298
  interpolatortype="FDI",
1298
1299
  tol=None,
1299
1300
  fault_slip_vector=None,
@@ -1387,9 +1388,9 @@ class GeologicalModel:
1387
1388
  model=self,
1388
1389
  **kwargs,
1389
1390
  )
1390
- if fault_data is None:
1391
- fault_data = self.data.loc[self.data["feature_name"] == fault_name]
1392
- if fault_data.shape[0] == 0:
1391
+ if data is None:
1392
+ data = self.data.loc[self.data["feature_name"] == fault_name]
1393
+ if data.shape[0] == 0:
1393
1394
  logger.warning(f"No data for {fault_name}, skipping")
1394
1395
  return
1395
1396
 
@@ -1405,7 +1406,7 @@ class GeologicalModel:
1405
1406
  if intermediate_axis:
1406
1407
  intermediate_axis = intermediate_axis
1407
1408
  fault_frame_builder.create_data_from_geometry(
1408
- fault_frame_data=self.prepare_data(fault_data),
1409
+ fault_frame_data=self.prepare_data(data),
1409
1410
  fault_center=fault_center,
1410
1411
  fault_normal_vector=fault_normal_vector,
1411
1412
  fault_slip_vector=fault_slip_vector,
@@ -222,8 +222,8 @@ class StratigraphicColumn(Observable['StratigraphicColumn']):
222
222
  if basement:
223
223
  self.add_basement()
224
224
 
225
- else:
226
- self.order = []
225
+
226
+ self.order = []
227
227
  self.group_mapping = {}
228
228
  self.notify('column_cleared')
229
229
  def add_unit(self, name,*, colour=None, thickness=None, where='top',id=None):
@@ -460,7 +460,7 @@ class StratigraphicColumn(Observable['StratigraphicColumn']):
460
460
  with self.freeze_notifications():
461
461
  self.clear(basement=False)
462
462
  elements_data = data.get("elements", [])
463
- for element_data in elements_data:
463
+ for element_data in reversed(elements_data):
464
464
  if "unconformity_type" in element_data:
465
465
  element = StratigraphicUnconformity.from_dict(element_data)
466
466
  else:
@@ -271,7 +271,7 @@ class BaseFeature(metaclass=ABCMeta):
271
271
 
272
272
  def surfaces(
273
273
  self,
274
- value: Union[float, int, List[Union[float, int]]],
274
+ value: Optional[Union[float, int, List[Union[float, int]]]] = None,
275
275
  bounding_box=None,
276
276
  name: Optional[Union[List[str], str]] = None,
277
277
  colours: Optional[Union[str, np.ndarray]] = None,
@@ -293,6 +293,7 @@ class BaseFeature(metaclass=ABCMeta):
293
293
  raise ValueError("Must specify bounding box")
294
294
  bounding_box = self.model.bounding_box
295
295
  regions = self.regions
296
+
296
297
  try:
297
298
  self.regions = [
298
299
  r for r in self.regions if r.name != self.name and r.parent.name != self.name
@@ -0,0 +1,39 @@
1
+ from LoopStructural.modelling.features.fold import FoldEvent, FoldFrame
2
+ from LoopStructural.modelling.features.builders import FoldedFeatureBuilder, StructuralFrameBuilder
3
+ def add_fold_to_feature(feature, fold_frame,**kwargs):
4
+ if not isinstance(fold_frame, FoldFrame):
5
+ raise ValueError("fold_frame must be a FoldFrame instance")
6
+
7
+ fold = FoldEvent(fold_frame, name=f"Fold_{feature.name}", invert_norm=kwargs.get('invert_fold_norm', False))
8
+
9
+ builder = FoldedFeatureBuilder.from_feature_builder(
10
+ feature.builder,
11
+ fold,
12
+ **kwargs
13
+ )
14
+ feature = builder.feature
15
+ feature.fold = fold
16
+ return feature
17
+
18
+ def convert_feature_to_structural_frame(feature, **kwargs):
19
+ """
20
+ Convert a geological feature to a structural frame by adding the feature to the frame
21
+
22
+ Parameters
23
+ ----------
24
+ feature : GeologicalFeature
25
+ the geological feature to convert
26
+
27
+ Returns
28
+ -------
29
+ StructuralFrame
30
+ the updated structural frame with the feature added
31
+ """
32
+ builder = feature.builder
33
+
34
+ new_builder = StructuralFrameBuilder.from_feature_builder(
35
+ builder,
36
+ **kwargs
37
+ )
38
+ return new_builder.frame
39
+
@@ -134,7 +134,7 @@ class StructuralFrame(BaseFeature):
134
134
  v[:, 0] = self.features[0].evaluate_value(pos, ignore_regions=ignore_regions)
135
135
  v[:, 1] = self.features[1].evaluate_value(pos, ignore_regions=ignore_regions)
136
136
  v[:, 2] = self.features[2].evaluate_value(pos, ignore_regions=ignore_regions)
137
- return v
137
+ return v[:,0]
138
138
 
139
139
  def evaluate_gradient(self, pos, i=None, ignore_regions=False):
140
140
  """
@@ -152,11 +152,7 @@ class StructuralFrame(BaseFeature):
152
152
  """
153
153
  if i is not None:
154
154
  return self.features[i].support.evaluate_gradient(pos, ignore_regions=ignore_regions)
155
- return (
156
- self.features[0].support.evaluate_gradient(pos, ignore_regions=ignore_regions),
157
- self.features[1].support.evaluate_gradient(pos, ignore_regions=ignore_regions),
158
- self.features[2].support.evaluate_gradient(pos, ignore_regions=ignore_regions),
159
- )
155
+ return self.features[0].support.evaluate_gradient(pos, ignore_regions=ignore_regions)
160
156
 
161
157
  def get_data(self, value_map: Optional[dict] = None) -> List[Union[ValuePoints, VectorPoints]]:
162
158
  """Return the data associated with the features in the
@@ -226,7 +226,7 @@ class FaultBuilder(StructuralFrameBuilder):
226
226
  self.maximum = self.model.bounding_box.maximum
227
227
  return
228
228
  major_axis = np.max(distance)
229
- logger.warning(f"Fault major axis using map length: {major_axis}")
229
+ logger.info(f"Fault major axis using map length: {major_axis}")
230
230
 
231
231
  if minor_axis is None:
232
232
  logger.info(f"Fault minor axis not set, using half major axis: {major_axis/2}")
@@ -1,5 +1,6 @@
1
1
  from ....modelling.features.builders import GeologicalFeatureBuilder
2
2
  from ....modelling.features.fold.fold_function import FoldRotationType, get_fold_rotation_profile
3
+ from ....modelling.features import FeatureType
3
4
  import numpy as np
4
5
 
5
6
  from ....utils import getLogger, InterpolatorError
@@ -48,11 +49,13 @@ class FoldedFeatureBuilder(GeologicalFeatureBuilder):
48
49
  region=region,
49
50
  **kwargs,
50
51
  )
52
+ self._feature.type = FeatureType.FOLDED
51
53
  # link the interpolator to the fold object
52
54
  self.interpolator.fold = fold
53
55
  self.fold = fold
54
56
  self.fold_weights = fold_weights
55
- self.kwargs = kwargs
57
+ self.update_build_arguments(kwargs)
58
+ # self.kwargs = kwargs
56
59
  self.svario = svario
57
60
  self.axis_profile_type = axis_profile_type
58
61
  self.limb_profile_type = limb_profile_type
@@ -87,7 +90,7 @@ class FoldedFeatureBuilder(GeologicalFeatureBuilder):
87
90
 
88
91
  def set_fold_axis(self):
89
92
  """calculates the fold axis/ fold axis rotation and adds this to the fold"""
90
- kwargs = self.kwargs
93
+ kwargs = self.build_arguments
91
94
  fold_axis = kwargs.get("fold_axis", None)
92
95
  if fold_axis is not None:
93
96
  fold_axis = np.array(fold_axis)
@@ -112,7 +115,7 @@ class FoldedFeatureBuilder(GeologicalFeatureBuilder):
112
115
 
113
116
  def set_fold_limb_rotation(self):
114
117
  """Calculates the limb rotation of the fold and adds it to the fold object"""
115
- kwargs = self.kwargs
118
+ kwargs = self.build_arguments
116
119
  # need to calculate the fold axis before the fold limb rotation angle
117
120
  if self.fold.fold_axis is None:
118
121
  self.set_fold_axis()
@@ -7,6 +7,7 @@ from typing import Union
7
7
  from LoopStructural.utils.exceptions import LoopException
8
8
 
9
9
  import numpy as np
10
+ import copy
10
11
 
11
12
  from ....utils import getLogger
12
13
  from ....datatypes import BoundingBox
@@ -120,6 +121,39 @@ class StructuralFrameBuilder:
120
121
  model=self.model,
121
122
  )
122
123
  self._frame.builder = self
124
+
125
+ @classmethod
126
+ def from_feature_builder(cls, feature_builder, **kwargs):
127
+ """
128
+ Create a structural frame builder from an existing feature builder
129
+
130
+ Parameters
131
+ ----------
132
+ feature_builder - a geological feature builder
133
+ kwargs
134
+
135
+ Returns
136
+ -------
137
+
138
+ """
139
+ if not isinstance(feature_builder, GeologicalFeatureBuilder):
140
+ raise LoopException(
141
+ f"feature_builder is {type(feature_builder)} and must be a GeologicalFeatureBuilder"
142
+ )
143
+ if hasattr(feature_builder, 'fold'):
144
+ logger.warning("feature builder has a fold - using this to create a folded frame")
145
+ kwargs['fold'] = copy.deepcopy(feature_builder.fold)
146
+ builder = cls(
147
+ interpolatortype=[feature_builder.interpolator.type]*3,
148
+ bounding_box=feature_builder.model.bounding_box,
149
+ nelements=[feature_builder.interpolator.n_elements]*3,
150
+ name=feature_builder.name,
151
+ model=feature_builder.model,
152
+ **kwargs
153
+ )
154
+ builder.add_data_from_data_frame(feature_builder.data)
155
+ return builder
156
+
123
157
  @property
124
158
  def build_arguments(self):
125
159
  return self.builders[0].build_arguments
@@ -1,6 +1,5 @@
1
1
  """ """
2
2
 
3
- from ._fold import FoldEvent
4
3
  from ._svariogram import SVariogram
5
4
  from ._fold_rotation_angle_feature import FoldRotationAngleFeature
6
5
  from ._foldframe import FoldFrame
@@ -19,7 +19,24 @@ class FoldFrame(StructuralFrame):
19
19
  features
20
20
  """
21
21
  super().__init__(name, features, fold, model)
22
+ @classmethod
23
+ def from_structural_frame(cls, frame, fold=None):
24
+ """
25
+ Create a FoldFrame from an existing StructuralFrame
26
+
27
+ Parameters
28
+ ----------
29
+ frame - StructuralFrame
30
+ the structural frame to convert to a fold frame
31
+ fold - FoldEvent, optional
32
+ the fold event to associate with the fold frame
22
33
 
34
+ Returns
35
+ -------
36
+ FoldFrame
37
+ the new fold frame
38
+ """
39
+ return cls(frame.name, frame.features, fold, frame.model)
23
40
  def calculate_fold_axis_rotation(self, feature_builder, fold_axis=None):
24
41
  """
25
42
  Calculate the fold axis rotation angle by finding the angle between the
@@ -0,0 +1 @@
1
+ __version__ = "1.6.21"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: LoopStructural
3
- Version: 1.6.19
3
+ Version: 1.6.21
4
4
  Summary: 3D geological modelling
5
5
  Author-email: Lachlan Grose <lachlan.grose@monash.edu>
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: LoopStructural
3
- Version: 1.6.19
3
+ Version: 1.6.21
4
4
  Summary: 3D geological modelling
5
5
  Author-email: Lachlan Grose <lachlan.grose@monash.edu>
6
6
  License: MIT
@@ -1,13 +0,0 @@
1
- from LoopStructural.modelling.features.fold import FoldEvent
2
- from LoopStructural.modelling.features.builders import FoldedFeatureBuilder
3
- def add_fold_to_feature(feature, fold_frame,**kwargs):
4
- fold = FoldEvent(fold_frame, name=f"Fold_{feature.name}", invert_norm=kwargs.get('invert_fold_norm', False))
5
-
6
- builder = FoldedFeatureBuilder.from_feature_builder(
7
- feature.builder,
8
- fold,
9
- **kwargs
10
- )
11
- feature = builder.feature
12
- feature.fold = fold
13
- return feature
@@ -1 +0,0 @@
1
- __version__ = "1.6.19"
File without changes