LoopStructural 1.6.8__tar.gz → 1.6.10__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 (143) hide show
  1. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datatypes/_bounding_box.py +23 -1
  2. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datatypes/_surface.py +3 -1
  3. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/interpolators/_finite_difference_interpolator.py +3 -18
  4. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/interpolators/supports/_3d_base_structured.py +3 -3
  5. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/interpolators/supports/_3d_structured_tetra.py +3 -3
  6. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/interpolators/supports/_3d_unstructured_tetra.py +3 -3
  7. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/interpolators/supports/_face_table.py +3 -3
  8. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/core/geological_model.py +13 -5
  9. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/_base_geological_feature.py +9 -4
  10. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/_geological_feature.py +2 -1
  11. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/_lambda_geological_feature.py +11 -0
  12. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/builders/_fault_builder.py +7 -0
  13. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/input/process_data.py +6 -6
  14. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/utils/_surface.py +5 -1
  15. loopstructural-1.6.10/LoopStructural/version.py +1 -0
  16. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural.egg-info/PKG-INFO +5 -4
  17. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural.egg-info/requires.txt +2 -2
  18. {loopstructural-1.6.8 → loopstructural-1.6.10}/PKG-INFO +5 -4
  19. {loopstructural-1.6.8 → loopstructural-1.6.10}/pyproject.toml +2 -2
  20. loopstructural-1.6.8/LoopStructural/version.py +0 -1
  21. {loopstructural-1.6.8 → loopstructural-1.6.10}/LICENSE +0 -0
  22. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/__init__.py +0 -0
  23. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datasets/__init__.py +0 -0
  24. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datasets/_base.py +0 -0
  25. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datasets/_example_models.py +0 -0
  26. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datasets/data/claudius.csv +0 -0
  27. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datasets/data/claudiusbb.txt +0 -0
  28. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datasets/data/duplex.csv +0 -0
  29. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datasets/data/duplexbb.txt +0 -0
  30. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datasets/data/fault_trace/fault_trace.cpg +0 -0
  31. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datasets/data/fault_trace/fault_trace.dbf +0 -0
  32. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datasets/data/fault_trace/fault_trace.prj +0 -0
  33. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datasets/data/fault_trace/fault_trace.shp +0 -0
  34. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datasets/data/fault_trace/fault_trace.shx +0 -0
  35. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datasets/data/geological_map_data/bbox.csv +0 -0
  36. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datasets/data/geological_map_data/contacts.csv +0 -0
  37. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datasets/data/geological_map_data/fault_displacement.csv +0 -0
  38. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datasets/data/geological_map_data/fault_edges.txt +0 -0
  39. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datasets/data/geological_map_data/fault_locations.csv +0 -0
  40. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datasets/data/geological_map_data/fault_orientations.csv +0 -0
  41. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datasets/data/geological_map_data/stratigraphic_order.csv +0 -0
  42. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datasets/data/geological_map_data/stratigraphic_orientations.csv +0 -0
  43. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datasets/data/geological_map_data/stratigraphic_thickness.csv +0 -0
  44. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datasets/data/intrusion.csv +0 -0
  45. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datasets/data/intrusionbb.txt +0 -0
  46. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datasets/data/onefoldbb.txt +0 -0
  47. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datasets/data/onefolddata.csv +0 -0
  48. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datasets/data/refolded_bb.txt +0 -0
  49. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datasets/data/refolded_fold.csv +0 -0
  50. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datasets/data/tabular_intrusion.csv +0 -0
  51. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datatypes/__init__.py +0 -0
  52. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datatypes/_point.py +0 -0
  53. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/datatypes/_structured_grid.py +0 -0
  54. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/export/exporters.py +0 -0
  55. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/export/file_formats.py +0 -0
  56. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/export/geoh5.py +0 -0
  57. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/export/gocad.py +0 -0
  58. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/export/omf_wrapper.py +0 -0
  59. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/interpolators/__init__.py +0 -0
  60. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/interpolators/_api.py +0 -0
  61. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/interpolators/_builders.py +0 -0
  62. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/interpolators/_cython/__init__.py +0 -0
  63. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/interpolators/_discrete_fold_interpolator.py +0 -0
  64. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/interpolators/_discrete_interpolator.py +0 -0
  65. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/interpolators/_geological_interpolator.py +0 -0
  66. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/interpolators/_interpolator_builder.py +0 -0
  67. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/interpolators/_interpolator_factory.py +0 -0
  68. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/interpolators/_operator.py +0 -0
  69. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/interpolators/_p1interpolator.py +0 -0
  70. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/interpolators/_p2interpolator.py +0 -0
  71. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/interpolators/_surfe_wrapper.py +0 -0
  72. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/interpolators/supports/_2d_base_unstructured.py +0 -0
  73. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/interpolators/supports/_2d_p1_unstructured.py +0 -0
  74. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/interpolators/supports/_2d_p2_unstructured.py +0 -0
  75. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/interpolators/supports/_2d_structured_grid.py +0 -0
  76. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/interpolators/supports/_2d_structured_tetra.py +0 -0
  77. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/interpolators/supports/_3d_p2_tetra.py +0 -0
  78. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/interpolators/supports/_3d_structured_grid.py +0 -0
  79. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/interpolators/supports/__init__.py +0 -0
  80. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/interpolators/supports/_aabb.py +0 -0
  81. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/interpolators/supports/_base_support.py +0 -0
  82. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/interpolators/supports/_support_factory.py +0 -0
  83. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/__init__.py +0 -0
  84. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/core/__init__.py +0 -0
  85. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/__init__.py +0 -0
  86. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/_analytical_feature.py +0 -0
  87. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/_cross_product_geological_feature.py +0 -0
  88. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/_projected_vector_feature.py +0 -0
  89. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/_region.py +0 -0
  90. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/_structural_frame.py +0 -0
  91. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/_unconformity_feature.py +0 -0
  92. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/builders/__init__.py +0 -0
  93. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/builders/_base_builder.py +0 -0
  94. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/builders/_folded_feature_builder.py +0 -0
  95. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/builders/_geological_feature_builder.py +0 -0
  96. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/builders/_structural_frame_builder.py +0 -0
  97. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/fault/__init__.py +0 -0
  98. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/fault/_fault_function.py +0 -0
  99. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/fault/_fault_function_feature.py +0 -0
  100. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/fault/_fault_segment.py +0 -0
  101. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/fold/__init__.py +0 -0
  102. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/fold/_fold.py +0 -0
  103. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/fold/_fold_rotation_angle_feature.py +0 -0
  104. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/fold/_foldframe.py +0 -0
  105. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/fold/_svariogram.py +0 -0
  106. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/fold/fold_function/__init__.py +0 -0
  107. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/fold/fold_function/_base_fold_rotation_angle.py +0 -0
  108. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/fold/fold_function/_fourier_series_fold_rotation_angle.py +0 -0
  109. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/fold/fold_function/_lambda_fold_rotation_angle.py +0 -0
  110. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/features/fold/fold_function/_trigo_fold_rotation_angle.py +0 -0
  111. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/input/__init__.py +0 -0
  112. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/input/fault_network.py +0 -0
  113. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/input/map2loop_processor.py +0 -0
  114. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/input/project_file.py +0 -0
  115. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/intrusions/__init__.py +0 -0
  116. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/intrusions/geom_conceptual_models.py +0 -0
  117. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/intrusions/geometric_scaling_functions.py +0 -0
  118. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/intrusions/intrusion_builder.py +0 -0
  119. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/intrusions/intrusion_feature.py +0 -0
  120. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/intrusions/intrusion_frame_builder.py +0 -0
  121. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/modelling/intrusions/intrusion_support_functions.py +0 -0
  122. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/utils/__init__.py +0 -0
  123. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/utils/_transformation.py +0 -0
  124. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/utils/colours.py +0 -0
  125. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/utils/config.py +0 -0
  126. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/utils/dtm_creator.py +0 -0
  127. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/utils/exceptions.py +0 -0
  128. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/utils/features.py +0 -0
  129. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/utils/helper.py +0 -0
  130. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/utils/json_encoder.py +0 -0
  131. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/utils/linalg.py +0 -0
  132. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/utils/logging.py +0 -0
  133. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/utils/maths.py +0 -0
  134. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/utils/regions.py +0 -0
  135. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/utils/typing.py +0 -0
  136. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/utils/utils.py +0 -0
  137. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural/visualisation/__init__.py +0 -0
  138. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural.egg-info/SOURCES.txt +0 -0
  139. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural.egg-info/dependency_links.txt +0 -0
  140. {loopstructural-1.6.8 → loopstructural-1.6.10}/LoopStructural.egg-info/top_level.txt +0 -0
  141. {loopstructural-1.6.8 → loopstructural-1.6.10}/README.md +0 -0
  142. {loopstructural-1.6.8 → loopstructural-1.6.10}/setup.cfg +0 -0
  143. {loopstructural-1.6.8 → loopstructural-1.6.10}/setup.py +0 -0
@@ -326,7 +326,9 @@ class BoundingBox:
326
326
  if iy == -1:
327
327
  return self.origin[ix]
328
328
 
329
- return self.bb[ix,]
329
+ return self.bb[
330
+ ix,
331
+ ]
330
332
 
331
333
  def __getitem__(self, name):
332
334
  if isinstance(name, str):
@@ -430,6 +432,26 @@ class BoundingBox:
430
432
  "nsteps": self.nsteps.tolist(),
431
433
  }
432
434
 
435
+ @classmethod
436
+ def from_dict(cls, data: dict) -> 'BoundingBox':
437
+ """Create a bounding box from a dictionary
438
+
439
+ Parameters
440
+ ----------
441
+ data : dict
442
+ dictionary with origin, maximum and nsteps
443
+
444
+ Returns
445
+ -------
446
+ BoundingBox
447
+ bounding box object
448
+ """
449
+ return cls(
450
+ origin=np.array(data["origin"]),
451
+ maximum=np.array(data["maximum"]),
452
+ nsteps=np.array(data["nsteps"]),
453
+ )
454
+
433
455
  def vtk(self):
434
456
  """Export the model as a pyvista RectilinearGrid
435
457
 
@@ -1,5 +1,5 @@
1
1
  from dataclasses import dataclass, field
2
- from typing import Optional
2
+ from typing import Optional, Union
3
3
  import numpy as np
4
4
  import io
5
5
  from LoopStructural.utils import getLogger
@@ -11,6 +11,8 @@ logger = getLogger(__name__)
11
11
  class Surface:
12
12
  vertices: np.ndarray = field(default_factory=lambda: np.array([[0, 0, 0]]))
13
13
  triangles: np.ndarray = field(default_factory=lambda: np.array([[0, 0, 0]]))
14
+ colour: Optional[Union[str, np.ndarray]] = field(default_factory=lambda: None)
15
+
14
16
  normals: Optional[np.ndarray] = None
15
17
  name: str = 'surface'
16
18
  values: Optional[np.ndarray] = None
@@ -272,12 +272,7 @@ class FiniteDifferenceInterpolator(DiscreteInterpolator):
272
272
  idc[inside, :] = gi[node_idx[inside, :]]
273
273
  inside = np.logical_and(~np.any(idc == -1, axis=1), inside)
274
274
 
275
- (
276
- vertices,
277
- T,
278
- elements,
279
- inside_,
280
- ) = self.support.get_element_gradient_for_location(
275
+ (vertices, T, elements, inside_,) = self.support.get_element_gradient_for_location(
281
276
  points[inside, : self.support.dimension]
282
277
  )
283
278
  # normalise constraint vector and scale element matrix by this
@@ -340,12 +335,7 @@ class FiniteDifferenceInterpolator(DiscreteInterpolator):
340
335
  # calculate unit vector for node gradients
341
336
  # this means we are only constraining direction of grad not the
342
337
  # magnitude
343
- (
344
- vertices,
345
- T,
346
- elements,
347
- inside_,
348
- ) = self.support.get_element_gradient_for_location(
338
+ (vertices, T, elements, inside_,) = self.support.get_element_gradient_for_location(
349
339
  points[inside, : self.support.dimension]
350
340
  )
351
341
  # T*=np.product(self.support.step_vector)
@@ -432,12 +422,7 @@ class FiniteDifferenceInterpolator(DiscreteInterpolator):
432
422
  vectors[norm > 0, :] /= norm[norm > 0, None]
433
423
 
434
424
  # normalise element vector to unit vector for dot product
435
- (
436
- vertices,
437
- T,
438
- elements,
439
- inside_,
440
- ) = self.support.get_element_gradient_for_location(
425
+ (vertices, T, elements, inside_,) = self.support.get_element_gradient_for_location(
441
426
  points[inside, : self.support.dimension]
442
427
  )
443
428
  T[norm > 0, :, :] /= norm[norm > 0, None, None]
@@ -162,9 +162,9 @@ class BaseStructuredSupport(BaseSupport):
162
162
  length = self.maximum - origin
163
163
  length /= self.step_vector
164
164
  self._nsteps = np.ceil(length).astype(np.int64)
165
- self._nsteps[self._nsteps == 0] = (
166
- 3 # need to have a minimum of 3 elements to apply the finite difference mask
167
- )
165
+ self._nsteps[
166
+ self._nsteps == 0
167
+ ] = 3 # need to have a minimum of 3 elements to apply the finite difference mask
168
168
  if np.any(~(self._nsteps > 0)):
169
169
  logger.error(
170
170
  f"Cannot resize the interpolation support. The proposed number of steps is {self._nsteps}, these must be all > 0"
@@ -166,9 +166,9 @@ class TetMesh(BaseStructuredSupport):
166
166
  shared_face_index[:] = -1
167
167
  shared_face_index[row.reshape(-1, 3)[:, 0], :] = col.reshape(-1, 3)
168
168
 
169
- self.shared_elements[np.arange(self.shared_element_relationships.shape[0]), :] = (
170
- shared_face_index
171
- )
169
+ self.shared_elements[
170
+ np.arange(self.shared_element_relationships.shape[0]), :
171
+ ] = shared_face_index
172
172
  # resize
173
173
  self.shared_elements = self.shared_elements[: len(self.shared_element_relationships), :]
174
174
 
@@ -173,9 +173,9 @@ class UnStructuredTetMesh(BaseSupport):
173
173
  shared_face_index[:] = -1
174
174
  shared_face_index[row.reshape(-1, 3)[:, 0], :] = col.reshape(-1, 3)
175
175
 
176
- self.shared_elements[np.arange(self.shared_element_relationships.shape[0]), :] = (
177
- shared_face_index
178
- )
176
+ self.shared_elements[
177
+ np.arange(self.shared_element_relationships.shape[0]), :
178
+ ] = shared_face_index
179
179
  # resize
180
180
  self.shared_elements = self.shared_elements[: len(self.shared_element_relationships), :]
181
181
  # flag = np.zeros(self.elements.shape[0])
@@ -63,8 +63,8 @@ def _init_face_table(grid):
63
63
  shared_face_index = np.zeros((shared_faces.shape[0], grid.dimension), dtype=int)
64
64
  shared_face_index[:] = -1
65
65
  shared_face_index[row.reshape(-1, grid.dimension)[:, 0], :] = col.reshape(-1, grid.dimension)
66
- grid._shared_elements[np.arange(grid.shared_element_relationships.shape[0]), :] = (
67
- shared_face_index
68
- )
66
+ grid._shared_elements[
67
+ np.arange(grid.shared_element_relationships.shape[0]), :
68
+ ] = shared_face_index
69
69
  # resize
70
70
  grid._shared_elements = grid.shared_elements[: len(grid.shared_element_relationships), :]
@@ -598,10 +598,12 @@ class GeologicalModel:
598
598
  * self._data.loc[mask, "polarity"].to_numpy()[:, None]
599
599
  )
600
600
  self._data.drop(["strike", "dip"], axis=1, inplace=True)
601
- self._data[['X', 'Y', 'Z', 'val', 'nx', 'ny', 'nz', 'gx', 'gy', 'gz', 'tx', 'ty', 'tz']] = (
602
- self._data[
603
- ['X', 'Y', 'Z', 'val', 'nx', 'ny', 'nz', 'gx', 'gy', 'gz', 'tx', 'ty', 'tz']
604
- ].astype(float)
601
+ self._data[
602
+ ['X', 'Y', 'Z', 'val', 'nx', 'ny', 'nz', 'gx', 'gy', 'gz', 'tx', 'ty', 'tz']
603
+ ] = self._data[
604
+ ['X', 'Y', 'Z', 'val', 'nx', 'ny', 'nz', 'gx', 'gy', 'gz', 'tx', 'ty', 'tz']
605
+ ].astype(
606
+ float
605
607
  )
606
608
 
607
609
  def set_model_data(self, data):
@@ -1293,6 +1295,7 @@ class GeologicalModel:
1293
1295
  fault_trace_anisotropy=0.0,
1294
1296
  fault_dip=90,
1295
1297
  fault_dip_anisotropy=0.0,
1298
+ fault_pitch=None,
1296
1299
  **kwargs,
1297
1300
  ):
1298
1301
  """
@@ -1379,6 +1382,7 @@ class GeologicalModel:
1379
1382
  major_axis = major_axis / self.scale_factor
1380
1383
  if intermediate_axis:
1381
1384
  intermediate_axis = intermediate_axis / self.scale_factor
1385
+ print(fault_dip, fault_normal_vector)
1382
1386
  fault_frame_builder.create_data_from_geometry(
1383
1387
  fault_frame_data=fault_frame_data,
1384
1388
  fault_center=fault_center,
@@ -1393,6 +1397,7 @@ class GeologicalModel:
1393
1397
  fault_trace_anisotropy=fault_trace_anisotropy,
1394
1398
  fault_dip=fault_dip,
1395
1399
  fault_dip_anisotropy=fault_dip_anisotropy,
1400
+ fault_pitch=fault_pitch,
1396
1401
  )
1397
1402
  if "force_mesh_geometry" not in kwargs:
1398
1403
  fault_frame_builder.set_mesh_geometry(kwargs.get("fault_buffer", 0.2), 0)
@@ -1798,7 +1803,10 @@ class GeologicalModel:
1798
1803
  values = values.loc[~np.logical_or(values == np.inf, values == -np.inf)]
1799
1804
  surfaces.extend(
1800
1805
  self.get_feature_by_name(u).surfaces(
1801
- values.to_list(), self.bounding_box, name=names.loc[values.index].to_list()
1806
+ values.to_list(),
1807
+ self.bounding_box,
1808
+ name=names.loc[values.index].to_list(),
1809
+ colours=unit_table.loc[unit_table['feature_name'] == u, 'colour'].tolist(),
1802
1810
  )
1803
1811
  )
1804
1812
 
@@ -274,6 +274,7 @@ class BaseFeature(metaclass=ABCMeta):
274
274
  value: Union[float, int, List[Union[float, int]]],
275
275
  bounding_box=None,
276
276
  name: Optional[Union[List[str], str]] = None,
277
+ colours: Optional[Union[str, np.ndarray]] = None,
277
278
  ) -> surface_list:
278
279
  """Find the surfaces of the geological feature at a given value
279
280
 
@@ -305,7 +306,7 @@ class BaseFeature(metaclass=ABCMeta):
305
306
  isosurfacer = LoopIsosurfacer(bounding_box, callable=callable)
306
307
  if name is None and self.name is not None:
307
308
  name = self.name
308
- surfaces = isosurfacer.fit(value, name)
309
+ surfaces = isosurfacer.fit(value, name, colours=colours)
309
310
  except Exception as e:
310
311
  logger.error(f"Failed to create surface for {self.name} at value {value}")
311
312
  logger.error(e)
@@ -333,9 +334,13 @@ class BaseFeature(metaclass=ABCMeta):
333
334
  raise ValueError("Must specify bounding box")
334
335
  bounding_box = self.model.bounding_box
335
336
  grid = bounding_box.structured_grid(name=self.name)
336
- value = self.evaluate_value(
337
- self.model.scale(bounding_box.regular_grid(local=False, order='F'))
338
- )
337
+ value = self.evaluate_value(bounding_box.regular_grid(local=False, order='F'))
338
+ if self.model is not None:
339
+
340
+ value = self.evaluate_value(
341
+ self.model.scale(bounding_box.regular_grid(local=False, order='F'))
342
+ )
343
+
339
344
  grid.properties[self.name] = value
340
345
 
341
346
  value = self.evaluate_value(bounding_box.cell_centres(order='F'))
@@ -42,6 +42,7 @@ class GeologicalFeature(BaseFeature):
42
42
  builder,
43
43
  regions: list = [],
44
44
  faults: list = [],
45
+ interpolator=None,
45
46
  model=None,
46
47
  ):
47
48
  """Default constructor for geological feature
@@ -60,7 +61,7 @@ class GeologicalFeature(BaseFeature):
60
61
  BaseFeature.__init__(self, name, model, faults, regions, builder)
61
62
  self.name = name
62
63
  self.builder = builder
63
- self.interpolator = self.builder.interpolator if self.builder is not None else None
64
+ self.interpolator = self.builder.interpolator if self.builder is not None else interpolator
64
65
  self.type = FeatureType.INTERPOLATED
65
66
 
66
67
  def to_json(self):
@@ -90,3 +90,14 @@ class LambdaGeologicalFeature(BaseFeature):
90
90
 
91
91
  def get_data(self, value_map: Optional[dict] = None):
92
92
  return
93
+
94
+ def copy(self, name: Optional[str] = None):
95
+ return LambdaGeologicalFeature(
96
+ self.function,
97
+ name if name is not None else f'{self.name}_copy',
98
+ self.gradient_function,
99
+ self.model,
100
+ self.regions,
101
+ self.faults,
102
+ self.builder,
103
+ )
@@ -91,6 +91,7 @@ class FaultBuilder(StructuralFrameBuilder):
91
91
  fault_trace_anisotropy=1.0,
92
92
  fault_dip=90,
93
93
  fault_dip_anisotropy=1.0,
94
+ fault_pitch=None,
94
95
  ):
95
96
  """Generate the required data for building a fault frame for a fault with the
96
97
  specified parameters
@@ -204,6 +205,7 @@ class FaultBuilder(StructuralFrameBuilder):
204
205
  fault_frame_data["coord"] == 1, ~np.isnan(fault_frame_data["gz"])
205
206
  )
206
207
  fault_slip_data = fault_frame_data.loc[slip_mask, ["gx", "gy", "gz"]]
208
+
207
209
  if len(fault_slip_data) == 0:
208
210
  logger.warning(
209
211
  "There is no slip vector data for the fault, using vertical slip vector\n\
@@ -211,6 +213,11 @@ class FaultBuilder(StructuralFrameBuilder):
211
213
  )
212
214
  strike_vector, dip_vector = get_vectors(fault_normal_vector[None, :])
213
215
  fault_slip_vector = dip_vector[:, 0]
216
+ if fault_pitch is not None:
217
+ print('using pitch')
218
+ rotm = rotation(fault_normal_vector[None,:],[fault_pitch])
219
+ print(rotm.shape,fault_slip_vector.shape)
220
+ fault_slip_vector = np.einsum("ijk,k->ij", rotm, fault_slip_vector)[0,:]
214
221
  logger.info(f"Estimated fault slip vector: {fault_slip_vector}")
215
222
  else:
216
223
  fault_slip_vector = fault_slip_data.mean(axis=0).to_numpy()
@@ -299,9 +299,9 @@ class ProcessInputData:
299
299
  pts = self.fault_locations.loc[
300
300
  self.fault_locations["feature_name"] == fname, ["X", "Y", "Z"]
301
301
  ]
302
- fault_properties.loc[fname, ["centreEasting", "centreNorthing", "centreAltitude"]] = (
303
- np.nanmean(pts, axis=0)
304
- )
302
+ fault_properties.loc[
303
+ fname, ["centreEasting", "centreNorthing", "centreAltitude"]
304
+ ] = np.nanmean(pts, axis=0)
305
305
  if (
306
306
  "avgNormalEasting" not in fault_properties.columns
307
307
  or "avgNormalNorthing" not in fault_properties.columns
@@ -449,9 +449,9 @@ class ProcessInputData:
449
449
  for _name, sg in self.stratigraphic_order:
450
450
  value = 0.0 # reset for each supergroup
451
451
  if sg[0] not in self.thicknesses or self.thicknesses[sg[0]] <= 0:
452
- self.thicknesses[sg[0]] = (
453
- np.inf
454
- ) # make the top unit infinite as it should extend to the top of the model
452
+ self.thicknesses[
453
+ sg[0]
454
+ ] = np.inf # make the top unit infinite as it should extend to the top of the model
455
455
  for g in reversed(
456
456
  sg[:-1]
457
457
  ): # don't add the last unit as we never see the base of this unit.
@@ -64,6 +64,7 @@ class LoopIsosurfacer:
64
64
  values: Optional[Union[list, int, float]],
65
65
  name: Optional[Union[List[str], str]] = None,
66
66
  local=False,
67
+ colours: Optional[List] = None,
67
68
  ) -> surface_list:
68
69
  """Extract isosurfaces from the interpolator
69
70
 
@@ -120,7 +121,9 @@ class LoopIsosurfacer:
120
121
  names = [name] * len(isovalues)
121
122
  if isinstance(name, list):
122
123
  names = name
123
- for name, isovalue in zip(names, isovalues):
124
+ if colours is None:
125
+ colours = [None] * len(isovalues)
126
+ for name, isovalue, colour in zip(names, isovalues, colours):
124
127
  try:
125
128
  step_vector = (self.bounding_box.maximum - self.bounding_box.origin) / (
126
129
  np.array(self.bounding_box.nsteps) - 1
@@ -150,6 +153,7 @@ class LoopIsosurfacer:
150
153
  normals=normals,
151
154
  name=f"{name}_{isovalue}",
152
155
  values=values,
156
+ colour=colour,
153
157
  )
154
158
  )
155
159
  return surfaces
@@ -0,0 +1 @@
1
+ __version__ = "1.6.10"
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: LoopStructural
3
- Version: 1.6.8
3
+ Version: 1.6.10
4
4
  Summary: 3D geological modelling
5
5
  Author-email: Lachlan Grose <lachlan.grose@monash.edu>
6
6
  License: MIT
@@ -29,12 +29,12 @@ Requires-Dist: scipy
29
29
  Requires-Dist: scikit-image
30
30
  Requires-Dist: scikit-learn
31
31
  Provides-Extra: all
32
- Requires-Dist: loopstructural[export,inequalities,visualisation]; extra == "all"
32
+ Requires-Dist: loopstructural[export,inequalities,jupyter,visualisation]; extra == "all"
33
33
  Requires-Dist: tqdm; extra == "all"
34
34
  Provides-Extra: visualisation
35
35
  Requires-Dist: matplotlib; extra == "visualisation"
36
36
  Requires-Dist: pyvista; extra == "visualisation"
37
- Requires-Dist: loopstructuralviusualisation>0.1.4; extra == "visualisation"
37
+ Requires-Dist: loopstructuralviusualisation>=0.1.14; extra == "visualisation"
38
38
  Provides-Extra: export
39
39
  Requires-Dist: geoh5py; extra == "export"
40
40
  Requires-Dist: pyevtk; extra == "export"
@@ -58,6 +58,7 @@ Requires-Dist: geopandas; extra == "docs"
58
58
  Requires-Dist: sphinxcontrib-bibtex; extra == "docs"
59
59
  Requires-Dist: myst-parser; extra == "docs"
60
60
  Requires-Dist: sphinx-design; extra == "docs"
61
+ Dynamic: license-file
61
62
 
62
63
  # LoopStructural: Loop3D Implicit Geological Modelling
63
64
 
@@ -5,7 +5,7 @@ scikit-image
5
5
  scikit-learn
6
6
 
7
7
  [all]
8
- loopstructural[export,inequalities,visualisation]
8
+ loopstructural[export,inequalities,jupyter,visualisation]
9
9
  tqdm
10
10
 
11
11
  [docs]
@@ -38,4 +38,4 @@ pyvista[all]
38
38
  [visualisation]
39
39
  matplotlib
40
40
  pyvista
41
- loopstructuralviusualisation>0.1.4
41
+ loopstructuralviusualisation>=0.1.14
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: LoopStructural
3
- Version: 1.6.8
3
+ Version: 1.6.10
4
4
  Summary: 3D geological modelling
5
5
  Author-email: Lachlan Grose <lachlan.grose@monash.edu>
6
6
  License: MIT
@@ -29,12 +29,12 @@ Requires-Dist: scipy
29
29
  Requires-Dist: scikit-image
30
30
  Requires-Dist: scikit-learn
31
31
  Provides-Extra: all
32
- Requires-Dist: loopstructural[export,inequalities,visualisation]; extra == "all"
32
+ Requires-Dist: loopstructural[export,inequalities,jupyter,visualisation]; extra == "all"
33
33
  Requires-Dist: tqdm; extra == "all"
34
34
  Provides-Extra: visualisation
35
35
  Requires-Dist: matplotlib; extra == "visualisation"
36
36
  Requires-Dist: pyvista; extra == "visualisation"
37
- Requires-Dist: loopstructuralviusualisation>0.1.4; extra == "visualisation"
37
+ Requires-Dist: loopstructuralviusualisation>=0.1.14; extra == "visualisation"
38
38
  Provides-Extra: export
39
39
  Requires-Dist: geoh5py; extra == "export"
40
40
  Requires-Dist: pyevtk; extra == "export"
@@ -58,6 +58,7 @@ Requires-Dist: geopandas; extra == "docs"
58
58
  Requires-Dist: sphinxcontrib-bibtex; extra == "docs"
59
59
  Requires-Dist: myst-parser; extra == "docs"
60
60
  Requires-Dist: sphinx-design; extra == "docs"
61
+ Dynamic: license-file
61
62
 
62
63
  # LoopStructural: Loop3D Implicit Geological Modelling
63
64
 
@@ -41,8 +41,8 @@ dependencies = [
41
41
  dynamic = ['version']
42
42
 
43
43
  [project.optional-dependencies]
44
- all = ['loopstructural[visualisation,inequalities,export]', 'tqdm']
45
- visualisation = ["matplotlib", "pyvista", "loopstructuralviusualisation>0.1.4"]
44
+ all = ['loopstructural[visualisation,inequalities,export,jupyter]', 'tqdm']
45
+ visualisation = ["matplotlib", "pyvista", "loopstructuralviusualisation>=0.1.14"]
46
46
  export = ["geoh5py", "pyevtk", "dill"]
47
47
  jupyter = ["pyvista[all]"]
48
48
  inequalities = ["loopsolver"]
@@ -1 +0,0 @@
1
- __version__ = "1.6.8"
File without changes
File without changes