Skip to content

Commit

Permalink
fix: parameter names, and adding get_data method
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlangrose committed Mar 11, 2024
1 parent bbbfe0c commit e770a45
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions LoopStructural/modelling/features/_lambda_geological_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from ...utils import getLogger
from ...modelling.features import FeatureType
import numpy as np
from typing import Optional

logger = getLogger(__name__)

Expand Down Expand Up @@ -45,7 +46,7 @@ def __init__(
self.function = function
self.gradient_function = gradient_function

def evaluate_value(self, xyz: np.ndarray) -> np.ndarray:
def evaluate_value(self, pos: np.ndarray) -> np.ndarray:
"""_summary_
Parameters
Expand All @@ -58,14 +59,14 @@ def evaluate_value(self, xyz: np.ndarray) -> np.ndarray:
np.ndarray
_description_
"""
v = np.zeros((xyz.shape[0]))
v = np.zeros((pos.shape[0]))
if self.function is None:
v[:] = np.nan
else:
v[:] = self.function(xyz)
v[:] = self.function(pos)
return v

def evaluate_gradient(self, xyz: np.ndarray) -> np.ndarray:
def evaluate_gradient(self, pos: np.ndarray) -> np.ndarray:
"""_summary_
Parameters
Expand All @@ -78,9 +79,12 @@ def evaluate_gradient(self, xyz: np.ndarray) -> np.ndarray:
np.ndarray
_description_
"""
v = np.zeros((xyz.shape[0], 3))
v = np.zeros((pos.shape[0], 3))
if self.gradient_function is None:
v[:, :] = np.nan
else:
v[:, :] = self.gradient_function(xyz)
v[:, :] = self.gradient_function(pos)
return v

def get_data(self, value_map: Optional[dict] = None):
return

0 comments on commit e770a45

Please sign in to comment.