Skip to content

Commit

Permalink
docs: adding links to kwargs in docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlangrose committed Sep 27, 2022
1 parent 0eebca6 commit 6e3a6e2
Showing 1 changed file with 42 additions and 4 deletions.
46 changes: 42 additions & 4 deletions LoopStructural/modelling/core/geological_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,16 @@ def dtm(self):

@dtm.setter
def dtm(self, dtm):
"""Set a dtm to the model.
The dtm is a function that can be called for dtm(xy) where xy is
a numpy array of xy locations. The function will return an array of
z values corresponding to the elevation at xy.
Parameters
----------
dtm : callable
"""
if not callable(dtm):
raise BaseException(
"DTM must be a callable function \n"
Expand Down Expand Up @@ -490,7 +500,7 @@ def _add_feature(self, feature):
self._add_unconformity_above(feature)
feature.model = self

def data_for_feature(self, feature_name):
def data_for_feature(self, feature_name:str)-> pd.DataFrame:
return self.data.loc[self.data["feature_name"] == feature_name, :]

@property
Expand Down Expand Up @@ -998,12 +1008,23 @@ def create_and_add_folded_fold_frame(
fold_frame : StructuralFrame, optional
the fold frame for the fold if not specified uses last feature added
kwargs
kwargs : dict
parameters passed to child functions
Returns
-------
fold_frame : FoldFrame
created fold frame
Notes
-----
This function build a structural frame where the first coordinate is constrained
with a fold interpolator.
Keyword arguments can be included to constrain
* :meth:`LoopStructural.GeologicalModel.get_interpolator`
* :class:`LoopStructural.StructuralFrameBuilder`
* :meth:`LoopStructural.StructuralFrameBuilder.setup`
"""
if not self.check_inialisation():
return False
Expand Down Expand Up @@ -1269,6 +1290,13 @@ def create_and_add_unconformity(self, unconformity_surface_data, **kwargs):
Returns
-------
Notes
-----
Additional kwargs are found in
* :meth:`LoopStructural.GeologicalModel.get_interpolator`
"""
if not self.check_initialisation():
return False
Expand Down Expand Up @@ -1383,6 +1411,10 @@ def create_and_add_domain_fault(self, fault_surface_data, **kwargs):
domain_Fault : GeologicalFeature
the created domain fault
Notes
-----
* :meth:`LoopStructural.GeologicalModel.get_interpolator`
"""
interpolator = self.get_interpolator(**kwargs)
domain_fault_feature_builder = GeologicalFeatureBuilder(
Expand Down Expand Up @@ -1442,6 +1474,12 @@ def create_and_add_fault(
-------
fault : FaultSegment
created fault
Notes
-----
* :meth:`LoopStructural.GeologicalModel.get_interpolator`
* :class:`LoopStructural.modelling.features.FaultBuilder`
* :meth:`LoopStructural.modelling.features.FaultBuilder.setup`
"""
if "fault_extent" in kwargs and major_axis is None:
major_axis = kwargs["fault_extent"]
Expand Down Expand Up @@ -1609,7 +1647,7 @@ def create_and_add_fault(

return fault

def rescale(self, points, inplace=True):
def rescale(self, points:np.ndarray, inplace:bool=True) ->np.ndarray:
"""
Convert from model scale to real world scale - in the future this
should also do transformations?
Expand All @@ -1631,7 +1669,7 @@ def rescale(self, points, inplace=True):
points += self.origin
return points

def scale(self, points, inplace=True):
def scale(self, points:np.ndarray, inplace:bool=True)->np.ndarray:
"""Take points in UTM coordinates and reproject
into scaled model space
Expand Down

0 comments on commit 6e3a6e2

Please sign in to comment.