From 5c9341b4c788b39fb663a277d1a0d0ed028bbd5d Mon Sep 17 00:00:00 2001 From: vcantarella Date: Fri, 20 Sep 2024 15:17:52 +0200 Subject: [PATCH] improving docstrings for object functions --- src/hyvr/objects/channel.py | 9 +++++---- src/hyvr/objects/sheet.py | 10 ++++++---- src/hyvr/objects/trough.py | 9 +++++---- src/hyvr/tools.py | 19 +++++++++++++------ 4 files changed, 29 insertions(+), 18 deletions(-) diff --git a/src/hyvr/objects/channel.py b/src/hyvr/objects/channel.py index 0495718..b80bb95 100644 --- a/src/hyvr/objects/channel.py +++ b/src/hyvr/objects/channel.py @@ -27,8 +27,8 @@ def channel( trajectory of the channel and a parabola, which defines the cross section. Besides, it may have internal structure (Not currently implemented). - params: - --- + Parameters + ---------- f_array: ndarray(int32) of the facies values at the coordinates (x,y,z) dip_array: ndarray(float32) of the dip (positive value) of the internal structure at (x,y,z) dip_dir_array: ndarray(float32) of the dip-direction of the internal structure @@ -43,8 +43,9 @@ def channel( layer_dist: perpendicular to dip distance between layers facies: np.array(int32) with the facies code (1 in case no layering or more in case of layering) - Modified arrays: - --- + Returns + ------- + Modifies the following arrays in place: f_array: ndarray(int32) of the facies values at the coordinates (x,y,z) dip_array: ndarray(float32) of the dip (positive value) of the internal structure at (x,y,z) dip_dir_array: ndarray(float32) of the dip-direction of the internal structure diff --git a/src/hyvr/objects/sheet.py b/src/hyvr/objects/sheet.py index 671a102..b48270f 100644 --- a/src/hyvr/objects/sheet.py +++ b/src/hyvr/objects/sheet.py @@ -33,8 +33,9 @@ def sheet( Assigns a sheet to the grid points x,y,z. The sheet is a layer is defined by bounding x and y coordinates and top and bottom contacts. It may have internal layering (inclined or planar) - params: - --- + + Parameters + ---------- f_array: ndarray(int32) of the facies values at the coordinates (x,y,z) dip_array: ndarray(float32) of the dip (positive value) of the internal structure at (x,y,z) dip_dir_array: ndarray(float32) of the dip-direction of the internal structure @@ -51,8 +52,9 @@ def sheet( follows the mathematical convention, anticlockwise from east layer_dist: perpendicular to dip distance between layers - Modified arrays: - --- + Returns + ------- + Modifies the following arrays in place: f_array: ndarray(int32) of the facies values at the coordinates (x,y,z) dip_array: ndarray(float32) of the dip (positive value) of the internal structure at (x,y,z) dip_dir_array: ndarray(float32) of the dip-direction of the internal structure diff --git a/src/hyvr/objects/trough.py b/src/hyvr/objects/trough.py index 8eeca59..112dd77 100644 --- a/src/hyvr/objects/trough.py +++ b/src/hyvr/objects/trough.py @@ -34,8 +34,8 @@ def half_ellipsoid( Half ellipsoid is the lower half of an ellipsoid, defined by its center, dimensions and azimuth. It can be used to model discrete lenses, trough structure, scour pool fills, etc. - params: - --- + Parameters + ---------- f_array: ndarray(int32) of the facies values at the coordinates (x,y,z) dip_array: ndarray(float32) of the dip (positive value) of the internal structure at (x,y,z) dip_dir_array: ndarray(float32) of the dip-direction of the internal structure @@ -53,8 +53,9 @@ def half_ellipsoid( follows the mathematical convention, anticlockwise from east layer_dist: perpendicular to dip distance between layers - Modified arrays: - --- + Returns + ------- + Modifies the following arrays in place: f_array: ndarray(int32) of the facies values at the coordinates (x,y,z) dip_array: ndarray(float32) of the dip (positive value) of the internal structure at (x,y,z) dip_dir_array: ndarray(float32) of the dip-direction of the internal structure diff --git a/src/hyvr/tools.py b/src/hyvr/tools.py index dc0f36d..15fab3a 100644 --- a/src/hyvr/tools.py +++ b/src/hyvr/tools.py @@ -103,14 +103,16 @@ def specsim_surface( """ Creates gaussian random surface with mean value and variance input with the spectral method from Dietrich & Newsam (1993). - Input: + Parameters: ------------- x,y: 2D grid of x and y points mean: mean value var: variance corl: correlation lenghts (same unit as x and y) in x and y directions mask: mask array (same dimensions as x and y) - Returns: + + Returns + ------- Z: output np.array with same dimensions as x and y and with Z values corrensponding to the surface """ M = np.diag(1 / corl ** 2) @@ -137,14 +139,17 @@ def contact_surface( """ Creates gaussian random contact surface with mean value and variance input with the spectral method from Dietrich & Newsam (1993). - Input: + + Parameters: ------------- x,y: 2D grid of x and y points mean: mean value var: variance corl: correlation lenghts (same unit as x and y) in x and y directions mask: mask array (same dimensions as x and y) - Returns: + + Returns + ------- Z: output np.array with same dimensions as x and y and with Z values corrensponding to the surface """ return None @@ -162,10 +167,12 @@ def surface_gauss_regression( """ Performs surface gaussian regression on input x,y data with given dataset (x,y,z) and error Based on the algorithm from Rasmussen & Williams (2006) Gaussian Processes for Machine Learning - Input: + Parameters: ------------- x,y: 2D grid of x and y points - Returns: + + Returns + ------- Z: output np.array with same dimensions as x and y and with Z values corrensponding to the surface """ # Calculating distances: