Skip to content

Commit 718effb

Browse files
committed
doc: adding class/method links
1 parent 0ff0ba9 commit 718effb

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

LoopStructural/modelling/core/geological_model.py

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,11 @@ def from_map2loop_directory(
244244
-------
245245
(GeologicalModel, dict)
246246
the created geological model and a dictionary of the map2loop data
247+
248+
Notes
249+
------
250+
For additional information see :class:`LoopStructural.modelling.input.Map2LoopProcessor`
251+
and :meth:`LoopStructural.GeologicalModel.from_processor`
247252
"""
248253
from LoopStructural.modelling.input.map2loop_processor import Map2LoopProcessor
249254

@@ -274,6 +279,19 @@ def from_map2loop_directory(
274279

275280
@classmethod
276281
def from_processor(cls, processor):
282+
"""Builds a model from a :class:`LoopStructural.modelling.input.ProcessInputData` object
283+
This object stores the observations and order of the geological features
284+
285+
Parameters
286+
----------
287+
processor : ProcessInputData
288+
any type of ProcessInputData
289+
290+
Returns
291+
-------
292+
GeologicalModel
293+
a model with all of the features, need to call model.update() to run interpolation
294+
"""
277295
logger.info("Creating model from processor")
278296
model = GeologicalModel(processor.origin, processor.maximum)
279297
model.data = processor.data
@@ -416,6 +434,13 @@ def dtm(self, dtm):
416434

417435
@property
418436
def faults(self):
437+
"""Get all of the fault features in the model
438+
439+
Returns
440+
-------
441+
list
442+
a list of :class:`LoopStructural.modelling.features.FaultSegment`
443+
"""
419444
faults = []
420445
for f in self.features:
421446
if type(f) == FaultSegment:
@@ -450,7 +475,13 @@ def feature_names(self):
450475
return self.feature_name_index.keys()
451476

452477
def fault_names(self):
478+
"""Get name of all faults in the model
453479
480+
Returns
481+
-------
482+
list
483+
list of the names of the faults in the model
484+
"""
454485
return [f.name for f in self.faults]
455486

456487
def check_inialisation(self):
@@ -509,6 +540,18 @@ def _add_feature(self, feature):
509540
feature.model = self
510541

511542
def data_for_feature(self, feature_name: str) -> pd.DataFrame:
543+
"""Get all of the data associated with a geological feature
544+
545+
Parameters
546+
----------
547+
feature_name : str
548+
the unique identifying name of the feature
549+
550+
Returns
551+
-------
552+
pd.DataFrame
553+
data frame containing all of the data in the model associated with this feature
554+
"""
512555
return self.data.loc[self.data["feature_name"] == feature_name, :]
513556

514557
@property
@@ -680,6 +723,31 @@ def get_interpolator(
680723
681724
Returns
682725
-------
726+
interpolator : GeologicalInterpolator
727+
A geological interpolator
728+
729+
Notes
730+
-----
731+
This method will create a geological interpolator for the bounding box of the model. A
732+
buffer area is added to the interpolation region to avoid boundaries and issues with faults.
733+
This function wil create a :class:`LoopStructural.interpolators.GeologicalInterpolator` which can either be:
734+
A discrete interpolator :class:`LoopStructural.interpolators.DiscreteInterpolator`
735+
736+
- 'FDI' :class:`LoopStructural.interpolators.FiniteDifferenceInterpolator`
737+
- 'PLI' :class:`LoopStructural.interpolators.PiecewiseLinearInterpolator`
738+
- 'P1' :class:`LoopStructural.interpolators.P1Interpolator`
739+
- 'DFI' :class:`LoopStructural.interpolators.DiscreteFoldInterpolator`
740+
- 'P2' :class:`LoopStructural.interpolators.P2Interpolator`
741+
or
742+
743+
- 'surfe' :class:`LoopStructural.interpolators.SurfeRBFInterpolator`
744+
745+
The discrete interpolators will require a support.
746+
747+
- 'PLI','DFI','P1Interpolator','P2Interpolator' :class:`LoopStructural.interpolators.supports.TetMesh` or you can provide another
748+
mesh builder which returns :class:`LoopStructural.interpolators.support.UnStructuredTetMesh`
749+
750+
- 'FDI' :class:`LoopStructural.interpolators.supports.StructuredGrid`
683751
"""
684752
bb = np.copy(self.bounding_box)
685753
# add a buffer to the interpolation domain, this is necessary for
@@ -839,6 +907,18 @@ def create_and_add_foliation(
839907
-------
840908
feature : GeologicalFeature
841909
the created geological feature
910+
911+
Notes
912+
------
913+
This function creates an instance of a
914+
:class:`LoopStructural.modelling.features.builders.GeologicalFeatureBuilder` and will return
915+
a :class:`LoopStructural.modelling.features.builders.GeologicalFeature`
916+
The feature is not interpolated until either
917+
:meth:`LoopStructural.modelling.features.builders.GeologicalFeature.evaluate_value` is called or
918+
:meth:`LoopStructural.modelling.core.GeologicalModel.update`
919+
920+
An interpolator will be chosen by calling :meth:`LoopStructural.GeologicalModel.get_interpolator`
921+
842922
"""
843923
if not self.check_inialisation():
844924
logger.warning(f"{series_surface_data} not added, model not initialised")

0 commit comments

Comments
 (0)