Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Refactoring Data #1

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions gempy_lite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@
from gempy_lite.api_modules.getters import *
from gempy_lite.api_modules.setters import *
from gempy_lite.api_modules.io import *
from gempy_lite.core.model import Project, ImplicitCoKriging, AdditionalData, Faults, Grid, \
Orientations, RescaledData, Series, SurfacePoints, \
Surfaces, Options, Structure, KrigingParameters
from gempy_lite.core.model import Project, ImplicitCoKriging, Faults, Grid, \
Orientations, Series, SurfacePoints
from gempy_lite.core.kernel_data import Surfaces, Structure, KrigingParameters
from gempy_lite.core.model_data import Options, RescaledData, AdditionalData

from gempy_lite.core.solution import Solution
from gempy_lite.core.predictor.solution import Solution
from gempy_lite.addons.gempy_to_rexfile import geomodel_to_rex


Expand Down
12 changes: 6 additions & 6 deletions gempy_lite/api_modules/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def load_model(name=None, path=None, recompile=False):
# do series properly - this needs proper check

# Load series
s = pn.read_csv(f'{path}/{name}_series.csv', index_col=0, dtype={'order_series': 'int32',
s = pn.read_csv(f'{path}/{name}_series.csv', index_col=0, dtype={'OrderFeature': 'int32',
'BottomRelation': 'category'})

f = pn.read_csv(f'{path}/{name}_faults.csv', index_col=0,
Expand Down Expand Up @@ -174,7 +174,7 @@ def load_model(name=None, path=None, recompile=False):
'X_r': 'float64', 'Y_r': 'float64', 'Z_r': 'float64',
'dip': 'float64', 'azimuth': 'float64', 'polarity': 'float64',
'surface': 'category', 'series': 'category',
'id': 'int64', 'order_series': 'int64'})
'id': 'int64', 'OrderFeature': 'int64'})
geo_model._orientations.df['surface'].cat.set_categories(cat_surfaces, inplace=True)
geo_model._orientations.df['series'].cat.set_categories(cat_series, inplace=True)

Expand All @@ -183,7 +183,7 @@ def load_model(name=None, path=None, recompile=False):
dtype={'X': 'float64', 'Y': 'float64', 'Z': 'float64',
'X_r': 'float64', 'Y_r': 'float64', 'Z_r': 'float64',
'surface': 'category', 'series': 'category',
'id': 'int64', 'order_series': 'int64'})
'id': 'int64', 'OrderFeature': 'int64'})
geo_model._surface_points.df['surface'].cat.set_categories(cat_surfaces, inplace=True)
geo_model._surface_points.df['series'].cat.set_categories(cat_series, inplace=True)

Expand Down Expand Up @@ -247,7 +247,7 @@ def load_model(name=None, path=None, recompile=False):
# def load_series(geo_model, path, name):
# # do series properly - this needs proper check
# geo_model._stack.df = pn.read_csv(f'{path}/{name}_series.csv', index_col=0,
# dtype={'order_series': 'int32', 'BottomRelation': 'category'})
# dtype={'OrderFeature': 'int32', 'BottomRelation': 'category'})
# series_index = pn.CategoricalIndex(geo_model._stack.df.index.values)
# # geo_model.series.df.index = pn.CategoricalIndex(series_index)
# geo_model._stack.df.index = series_index
Expand Down Expand Up @@ -289,7 +289,7 @@ def load_model(name=None, path=None, recompile=False):
# 'X_r': 'float64', 'Y_r': 'float64', 'Z_r': 'float64',
# 'dip': 'float64', 'azimuth': 'float64', 'polarity': 'float64',
# 'surface': 'category', 'series': 'category',
# 'id': 'int64', 'order_series': 'int64'})
# 'id': 'int64', 'OrderFeature': 'int64'})
# geo_model._orientations.df['surface'].cat.set_categories(cat_surfaces, inplace=True)
# geo_model._orientations.df['series'].cat.set_categories(cat_series, inplace=True)
#
Expand All @@ -300,7 +300,7 @@ def load_model(name=None, path=None, recompile=False):
# dtype={'X': 'float64', 'Y': 'float64', 'Z': 'float64',
# 'X_r': 'float64', 'Y_r': 'float64', 'Z_r': 'float64',
# 'surface': 'category', 'series': 'category',
# 'id': 'int64', 'order_series': 'int64'})
# 'id': 'int64', 'OrderFeature': 'int64'})
# geo_model._surface_points.df['surface'].cat.set_categories(cat_surfaces, inplace=True)
# geo_model._surface_points.df['series'].cat.set_categories(cat_series, inplace=True)
#
Expand Down
2 changes: 1 addition & 1 deletion gempy_lite/api_modules/setters.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def set_orientation_from_surface_points(geo_model, indices_array):
if np.ndim(indices_array) == 1:
indices = indices_array
form = geo_model._surface_points.df['surface'].loc[indices].unique()
assert form.shape[0] is 1, 'The interface points must belong to the same surface'
assert form.shape[0] == 1, 'The interface points must belong to the same surface'
form = form[0]

ori_parameters = geo_model._orientations.create_orientation_from_surface_points(
Expand Down
4 changes: 1 addition & 3 deletions gempy_lite/assets/geophysics.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
"""

import numpy as np
import theano
import theano.tensor as T
from gempy_lite.core.grid_modules.grid_types import CenteredGrid
from gempy_lite.core.predictor.grid_modules.grid_types import CenteredGrid


class GravityPreprocessing(CenteredGrid):
Expand Down
Loading