Skip to content

Commit 1692d67

Browse files
committed
fix: cast data to float to avoid deprecation warning
1 parent d886e81 commit 1692d67

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

LoopStructural/modelling/core/geological_model.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,7 @@ def data(self, data: pd.DataFrame):
566566
raise BaseException("Cannot load data")
567567
logger.info(f"Adding data to GeologicalModel with {len(data)} data points")
568568
self._data = data.copy()
569+
569570
self._data["X"] -= self.origin[0]
570571
self._data["Y"] -= self.origin[1]
571572
self._data["Z"] -= self.origin[2]
@@ -598,6 +599,11 @@ def data(self, data: pd.DataFrame):
598599
* self._data.loc[mask, "polarity"].to_numpy()[:, None]
599600
)
600601
self._data.drop(["strike", "dip"], axis=1, inplace=True)
602+
self._data[['X', 'Y', 'Z', 'val', 'nx', 'ny', 'nz', 'gx', 'gy', 'gz', 'tx', 'ty', 'tz']] = (
603+
self._data[
604+
['X', 'Y', 'Z', 'val', 'nx', 'ny', 'nz', 'gx', 'gy', 'gz', 'tx', 'ty', 'tz']
605+
].astype(float)
606+
)
601607

602608
def set_model_data(self, data):
603609
logger.warning("deprecated method. Model data can now be set using the data attribute")

0 commit comments

Comments
 (0)