Skip to content

Commit 708d8cb

Browse files
committed
mostly white spaces
1 parent d8a8c63 commit 708d8cb

File tree

4 files changed

+6
-32
lines changed

4 files changed

+6
-32
lines changed

LoopStructural/datatypes/_bounding_box.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ def volume(self):
156156
def bb(self):
157157
return np.array([self.origin, self.maximum])
158158

159+
159160
@nelements.setter
160161
def nelements(self, nelements: Union[int, float]):
161162
"""Update the number of elements in the associated grid

LoopStructural/modelling/core/geological_model.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -188,36 +188,6 @@ def prepare_data(self, data: pd.DataFrame) -> pd.DataFrame:
188188
].astype(float)
189189
return data
190190

191-
if "type" in data:
192-
logger.warning("'type' is deprecated replace with 'feature_name' \n")
193-
data.rename(columns={"type": "feature_name"}, inplace=True)
194-
if "feature_name" not in data:
195-
logger.error("Data does not contain 'feature_name' column")
196-
raise BaseException("Cannot load data")
197-
for h in all_heading():
198-
if h not in data:
199-
data[h] = np.nan
200-
if h == "w":
201-
data[h] = 1.0
202-
if h == "coord":
203-
data[h] = 0
204-
if h == "polarity":
205-
data[h] = 1.0
206-
# LS wants polarity as -1 or 1, change 0 to -1
207-
data.loc[data["polarity"] == 0, "polarity"] = -1.0
208-
data.loc[np.isnan(data["w"]), "w"] = 1.0
209-
if "strike" in data and "dip" in data:
210-
logger.info("Converting strike and dip to vectors")
211-
mask = np.all(~np.isnan(data.loc[:, ["strike", "dip"]]), axis=1)
212-
data.loc[mask, gradient_vec_names()] = (
213-
strikedip2vector(data.loc[mask, "strike"], data.loc[mask, "dip"])
214-
* data.loc[mask, "polarity"].to_numpy()[:, None]
215-
)
216-
data.drop(["strike", "dip"], axis=1, inplace=True)
217-
data[['X', 'Y', 'Z', 'val', 'nx', 'ny', 'nz', 'gx', 'gy', 'gz', 'tx', 'ty', 'tz']] = data[
218-
['X', 'Y', 'Z', 'val', 'nx', 'ny', 'nz', 'gx', 'gy', 'gz', 'tx', 'ty', 'tz']
219-
].astype(float)
220-
return data
221191
@classmethod
222192
def from_processor(cls, processor):
223193
"""Builds a model from a :class:`LoopStructural.modelling.input.ProcessInputData` object

LoopStructural/modelling/features/_lambda_geological_feature.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ def evaluate_value(self, pos: np.ndarray, ignore_regions=False) -> np.ndarray:
6969
mask = self._calculate_mask(pos, ignore_regions=ignore_regions)
7070
pos = self._apply_faults(pos)
7171
if self.function is not None:
72-
7372
v[mask] = self.function(pos[mask,:])
7473
return v
7574

@@ -159,3 +158,7 @@ def copy(self, name: Optional[str] = None):
159158
self.faults,
160159
self.builder,
161160
)
161+
def is_valid(self):
162+
if self.function is None and self.gradient_function is None:
163+
return False
164+
return True

LoopStructural/modelling/features/fold/_foldframe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def calculate_fold_axis_rotation(self, feature_builder, fold_axis=None):
7474
s1gyg /= np.linalg.norm(s1gyg, axis=1)[:, None]
7575
l1 = points[:, 3:]
7676
l1 /= np.linalg.norm(l1, axis=1)[:, None]
77-
fad = self.features[1].evaluate_value(points[:, :3])
77+
fad = self.features[1].evaluate_value(points[:, :3])
7878
# Turn the faults back on
7979
# self.features[0].faults_enabled = True
8080
# self.features[1].faults_enabled = True

0 commit comments

Comments
 (0)