Skip to content

Commit

Permalink
improving docstrings for object functions
Browse files Browse the repository at this point in the history
  • Loading branch information
vcantarella committed Sep 20, 2024
1 parent 6bc0ebd commit 5c9341b
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 18 deletions.
9 changes: 5 additions & 4 deletions src/hyvr/objects/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
10 changes: 6 additions & 4 deletions src/hyvr/objects/sheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
9 changes: 5 additions & 4 deletions src/hyvr/objects/trough.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
19 changes: 13 additions & 6 deletions src/hyvr/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 5c9341b

Please sign in to comment.