diff --git a/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_extent.npy b/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_extent.npy deleted file mode 100644 index 8576d321..00000000 Binary files a/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_extent.npy and /dev/null differ diff --git a/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_faults.csv b/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_faults.csv deleted file mode 100644 index ec34024f..00000000 --- a/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_faults.csv +++ /dev/null @@ -1,2 +0,0 @@ -,order_series,BottomRelation,isActive,isFault,isFinite -Default series,1,Erosion,True,False,False diff --git a/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_faults_relations.csv b/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_faults_relations.csv deleted file mode 100644 index 92d8c1e0..00000000 --- a/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_faults_relations.csv +++ /dev/null @@ -1,2 +0,0 @@ -,Default series -Default series,False diff --git a/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_kriging_data.csv b/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_kriging_data.csv deleted file mode 100644 index 0490ea6d..00000000 --- a/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_kriging_data.csv +++ /dev/null @@ -1,2 +0,0 @@ -,range,$C_o$,drift equations -values,13266.4991614216,4190476.1904761903,[3] diff --git a/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_options.csv b/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_options.csv deleted file mode 100644 index d52fa617..00000000 --- a/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_options.csv +++ /dev/null @@ -1,2 +0,0 @@ -,dtype,output,aesara_optimizer,device,verbosity -values,float64,geology,fast_compile,cpu, diff --git a/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_orientations.csv b/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_orientations.csv deleted file mode 100644 index d4f35fd6..00000000 --- a/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_orientations.csv +++ /dev/null @@ -1,2 +0,0 @@ -,X,Y,Z,X_r,Y_r,Z_r,G_x,G_y,G_z,dip,azimuth,polarity,surface,series,id,order_series,smooth -0,6000.0,0.0,4000.0,0.5001,0.5001,0.6280578910245871,0.0,0.0,1.0,0.0,0.0,1.0,surface 1,Default series,1,1,0.01 diff --git a/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_rescaling_data.csv b/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_rescaling_data.csv deleted file mode 100644 index 3c1afaf9..00000000 --- a/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_rescaling_data.csv +++ /dev/null @@ -1,2 +0,0 @@ -,rescaling factor,centers -values,12000.0,[6000. 0. 2464.5053077] diff --git a/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_resolution.npy b/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_resolution.npy deleted file mode 100644 index 0c82eadc..00000000 Binary files a/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_resolution.npy and /dev/null differ diff --git a/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_series.csv b/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_series.csv deleted file mode 100644 index ec34024f..00000000 --- a/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_series.csv +++ /dev/null @@ -1,2 +0,0 @@ -,order_series,BottomRelation,isActive,isFault,isFinite -Default series,1,Erosion,True,False,False diff --git a/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_surface_points.csv b/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_surface_points.csv deleted file mode 100644 index 06e5b5ec..00000000 --- a/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_surface_points.csv +++ /dev/null @@ -1,5 +0,0 @@ -,X,Y,Z,X_r,Y_r,Z_r,surface,series,id,order_series,smooth -0,3000.0,0.0,3050.0,0.2501,0.5001,0.5488912243579204,surface 1,Default series,1,1,1e-06 -1,9000.0,0.0,3050.0,0.7501,0.5001,0.5488912243579204,surface 1,Default series,1,1,1e-06 -2,3000.0,0.0,929.0106154099107,0.2501,0.5001,0.37214210897541294,surface 2,Default series,2,1,1e-06 -3,9000.0,0.0,1341.253368518041,0.7501,0.5001,0.4064956717344238,surface 2,Default series,2,1,1e-06 diff --git a/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_surfaces.csv b/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_surfaces.csv deleted file mode 100644 index b9cb1795..00000000 --- a/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_surfaces.csv +++ /dev/null @@ -1,28 +0,0 @@ -,surface,series,order_surfaces,isBasement,isFault,isActive,hasData,color,vertices,edges,sfai,id,dz,density -0,surface 1,Default series,1,False,False,True,True,#015482,"[[ 60. -1800. 2925.69030762] - [ 60. -1454.38158512 2930. ] - [ 164.88566637 -1800. 2930. ] - ... - [11940. 1000. 3091.03546143] - [11940. 1400. 3092.91748047] - [11940. 1800. 3095.22369385]]","[[ 2 1 0] - [ 3 1 2] - [ 4 3 2] - ... - [1224 1210 1223] - [1224 1211 1210] - [1225 1211 1224]]",1.0246132128495493,1,20.0,2.6 -1,surface 2,Default series,2,False,False,True,True,#9f0052,"[[ 60. -1800. 853.98826599] - [ 60. -1400. 850.20553589] - [ 180. -1800. 856.0219574 ] - ... - [11940. 1400. 1351.88659668] - [11940. 1800. 1348.5546875 ] - [11940. 1626.81503296 1350. ]]","[[ 2 1 0] - [ 3 1 2] - [ 6 5 4] - ... - [1401 1412 1400] - [1401 1399 1411] - [1401 1411 1413]]",0.7205143470475385,2,0.0,2.4 -2,basement,Default series,3,True,False,True,True,#ffbe00,,,,3,0.0,3.2 diff --git a/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_topography.npy b/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_topography.npy deleted file mode 100644 index 2dd49fb6..00000000 Binary files a/examples/tutorials/ch5_probabilistic_modeling_DEP/2-layers/2-layers_topography.npy and /dev/null differ diff --git a/examples/tutorials/ch5_probabilistic_modeling_DEP/_README.rst b/examples/tutorials/ch5_probabilistic_modeling_DEP/_README.rst deleted file mode 100644 index 70843dfb..00000000 --- a/examples/tutorials/ch5_probabilistic_modeling_DEP/_README.rst +++ /dev/null @@ -1,15 +0,0 @@ -IMPORTANT NOTE --------------- - -At the moment pymc3 is being ported to a new backend and it is making complicated -to keep the tutorials updated and running. For now we will leave the files -for reference but we are not actively supporting compatibility with pymc3 after -further notice. - - -Chapter 5: Probabilistic Modeling ---------------------------------- - -These examples introduce shortly some Bayesian statistics concepts and -show how to build with GemPy stochastic structural models. This functionality -is currently under active development and research. Much more to come soon. \ No newline at end of file diff --git a/examples/tutorials/ch5_probabilistic_modeling_DEP/_aux/ch5_4a_joint_inversion.py b/examples/tutorials/ch5_probabilistic_modeling_DEP/_aux/ch5_4a_joint_inversion.py deleted file mode 100644 index 8dd55dfb..00000000 --- a/examples/tutorials/ch5_probabilistic_modeling_DEP/_aux/ch5_4a_joint_inversion.py +++ /dev/null @@ -1,302 +0,0 @@ -""" -6.3 - Joint inversion (preview). -================================ -""" - - # These two lines are necessary only if GemPy is not installed -import sys, os -sys.path.append("../../gempy") -os.environ["aesara_FLAGS"] = "mode=FAST_RUN,device=cuda" - -# Importing GemPy -import gempy_legacy as gp -from examples.tutorials.ch5_probabilistic_modeling_DEP.aux_functions.DEP_aux_funct import plot_geo_setting - -# Embedding matplotlib figures in the notebooks -# %matplotlib inline - -# Importing auxiliary libraries -import numpy as np -import matplotlib.pyplot as plt -import pymc as pm -import arviz as az - - -# %% -# Model definition -# ---------------- -# -# In the previous example we assume constant thickness to be able to -# reduce the problem to one dimension. This keeps the probabilistic model -# fairly simple since we do not need to deel with complex geometric -# structures. Unfortunaly, geology is all about dealing with complex three -# dimensional structures. In the moment data spread across the physical -# space, the probabilistic model will have to expand to relate data from -# different locations. In other words, the model will need to include -# either interpolations, regressions or some other sort of spatial -# functions. In this paper, we use an advance universal co-kriging -# interpolator. Further implications of using this method will be discuss -# below but for this lets treat is a simple spatial interpolation in order -# to keep the focus on the constraction of the probabilistic model. -# - -# %% -# This is to make it work in sphinx gallery -cwd = os.getcwd() -if not 'examples' in cwd: - path_dir = os.getcwd() + '/examples/tutorials/ch5_probabilistic_modeling' -else: - path_dir = cwd - -# %% -geo_model = gp.load_model(r'2-layers', path=path_dir, recompile=True) - -# %% -gp.compute_model(geo_model) -plot_geo_setting(geo_model) - - -# %% -# geo_model = gp.create_model('2-layers') -# gp.init_data(geo_model, extent=[0, 12e3, -2e3, 2e3, 0, 4e3], resolution=[500, 1, 500]) -# -# # %% -# geo_model.add_surfaces('surface 1') -# geo_model.add_surfaces('surface 2') -# geo_model.add_surfaces('basement') -# dz = geo_model.grid.regular_grid.dz -# geo_model.surfaces.add_surfaces_values([dz, 0, 0], ['dz']) -# geo_model.surfaces.add_surfaces_values(np.array([2.6, 2.4, 3.2]), ['density']) -# -# # %% -# geo_model.add_surface_points(3e3, 0, 3.05e3, 'surface 1') -# geo_model.add_surface_points(9e3, 0, 3.05e3, 'surface 1') -# -# geo_model.add_surface_points(3e3, 0, 1.02e3, 'surface 2') -# geo_model.add_surface_points(9e3, 0, 1.02e3, 'surface 2') -# -# geo_model.add_orientations( 6e3, 0, 4e3, 'surface 1', [0,0,1]) -# -# # %% -# gp.plot.plot_data(geo_model) - -# %% -device_loc = np.array([[6e3, 0, 3700]]) - -# %% -geo_model.set_centered_grid(device_loc, resolution = [10, 10, 60], radius=4000) - -# %% -gp.set_interpolator(geo_model, output=['gravity'], pos_density=2, gradient=True, - aesara_optimizer='fast_run') - -# %% -gp.compute_model(geo_model, set_solutions=True, compute_mesh=False) - -# %% -geo_model.solutions.fw_gravity - - -# %% -# -------------- -# -# Bayesian Interence -# ~~~~~~~~~~~~~~~~~~ -# - - -# %% -# Setting gempy into a pymc function -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# - -# %% -geo_model._interpolator.aesara_graph.sig_slope.set_value(150) - -# %% -geo_model._interpolator.aesara_graph.input_parameters_loop[4] - -# %% -geo_model._interpolator.aesara_graph.compute_type - - -# %% -# Test fw model gradient -# ^^^^^^^^^^^^^^^^^^^^^^ -# - -# %% -import aesara -import aesara.tensor as tt -aesara.config.compute_test_value = 'ignore' -geo_model_T = aesara.OpFromGraph(geo_model.interpolator.aesara_graph.input_parameters_loop, - [aesara.grad(geo_model.interpolator.aesara_graph.aesara_output()[12][0], - geo_model.interpolator.aesara_graph.input_parameters_loop[4])], - inline=True, - on_unused_input='ignore', - name='forw_grav') - -# %% -i = geo_model.interpolator.get_python_input_block() -th_f = aesara.function([], geo_model_T(*i), on_unused_input='warn') - -# %% -geo_model.interpolator.aesara_graph.sig_slope.set_value(20) - -# %% -th_f() - - -# %% -# Setup Bayesian model -# -------------------- -# - -# %% -i = geo_model.interpolator.get_python_input_block() -aesara.config.compute_test_value = 'ignore' -geo_model_T_grav = aesara.OpFromGraph(geo_model.interpolator.aesara_graph.input_parameters_loop, - [geo_model.interpolator.aesara_graph.aesara_output()[12]], - inline=False, - on_unused_input='ignore', - name='forw_grav') - -# %% -geo_model_T_thick = aesara.OpFromGraph(geo_model.interpolator.aesara_graph.input_parameters_loop, - [geo_model.interpolator.aesara_graph.compute_series()[0][1][0:250000]], inline=True, - on_unused_input='ignore', - name='geo_model') - -# %% -# We convert a python variable to aesara.shared -input_sh = [] -i = geo_model.interpolator.get_python_input_block() -for ii in i: - input_sh.append(aesara.shared(ii)) - -# We get the rescaling parameters: -rf = geo_model.rescaling.df.loc['values', 'rescaling factor'].astype('float32') -centers = geo_model.rescaling.df.loc['values', 'centers'].astype('float32') - -# We create pandas groups by id to be able to modify several points at the same time: -g = geo_model.surface_points.df.groupby('id') -l = aesara.shared(np.array([], dtype='float64')) - -# %% -g_obs_p = 1e3 * np.array([-0.3548658 , -0.35558686, -0.3563156 , -0.35558686, -0.3548658 , - -0.3534237 , -0.35201198, -0.3534237 , -0.3548658 , -0.3563401 , - -0.3548658 , -0.35558686, -0.3548658 , -0.3541554 , -0.3534569 , - -0.3527707 , -0.35424498, -0.35575098, -0.3572901 , -0.35575098, - -0.35424498, -0.35575098, -0.35424498, -0.35575098, -0.35424498, - -0.35575098, -0.35643718, -0.35713565, -0.35643718], dtype='float32') - -y_obs_list = 1e3 * np.array([2.12, 2.06, 2.08, 2.05, 2.08, 2.09, - 2.19, 2.07, 2.16, 2.11, 2.13, 1.92]) - -# %% -# Python input variables -i = geo_model.interpolator.get_python_input_block() -i - -# %% -# C/cuda input variables -input_sh - -# %% -## aesara.config.compute_test_value = 'ignore' - -with pm.Model() as model: - - depths = pm.Normal('depths', geo_model.surface_points.df['Z'], - np.array([200, 200, 200, 200]), shape=(4), dtype='float32') - - depths_r = (depths - centers[2])/rf + 0.5001 - - input_sh[4] = tt.set_subtensor(input_sh[4][:, 2], depths_r) - # input_sh[4] = depths_r - grav = geo_model_T(*input_sh) - geo = geo_model_T_thick(*input_sh) - - grav = pm.Deterministic('gravity', grav[0]) - well_1 = geo.reshape((500,1,500))[125, 0 ,:] - well_2 = geo.reshape((500,1,500))[375, 0 ,:] - - thick_1 = pm.Deterministic('thick_1', well_1.sum()) - thick_2 = pm.Deterministic('thick_2', well_2.sum()) - - sigma_grav = pm.Normal('sigma', mu = 250, sigma = 40) - sigma_thick = pm.Gamma('sigma_thickness', mu = 300, sigma = 300) - sigma_thick2 = pm.Gamma('sigma2_thickness', mu = 300, sigma = 300) - - obs_grav = pm.Normal('y', mu=grav, sd=sigma_grav, observed=g_obs_p) - obs_thick_1 = pm.Normal('y2', mu=thick_1, sd=sigma_thick, observed=y_obs_list) - obs_thick_2 = pm.Normal('y3', mu=thick_2, sd=sigma_thick2, observed=y_obs_list) - - - -# %% -pm.model_to_graphviz(model) - - -# %% -# Bayesian inference -# ~~~~~~~~~~~~~~~~~~ -# - -# %% -with model: - trace = pm.sample(400, chains=1, tune=300, - #init='adapt_diag', - # trace= pm.backends.SQLite('Gravity1'), - discard_tuned_samples=False, - compute_convergence_checks=False, - ) - - - -# %% -# Predictive prior and posterior: -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# - -# %% -with model: - prior = pm.sample_prior_predictive(1000) - post = pm.sample_posterior_predictive(trace) - - -# %% -# Sampler stats: -# ^^^^^^^^^^^^^^ -# - -# %% -trace.get_sampler_stats('depth') - -# %% -trace.get_sampler_stats('step_size') - -# %% -trace.get_values('gravity') - - -# %% -trace.get_values('depths') - - -# %% -# Save data: -# ~~~~~~~~~~ -# - -# %% -import arviz as az - -data = az.from_pymc3(trace=trace, - prior=prior, - posterior_predictive=post) -data.to_netcdf('workshop1') - -# %% - -data.posterior \ No newline at end of file diff --git a/examples/tutorials/ch5_probabilistic_modeling_DEP/_aux/ch5_4b_posterior_analysis.py b/examples/tutorials/ch5_probabilistic_modeling_DEP/_aux/ch5_4b_posterior_analysis.py deleted file mode 100644 index 18e85d41..00000000 --- a/examples/tutorials/ch5_probabilistic_modeling_DEP/_aux/ch5_4b_posterior_analysis.py +++ /dev/null @@ -1,319 +0,0 @@ -""" -6.3b - Posterior analysis (preview). -""" - - # These two lines are necessary only if GemPy is not installed -import sys, os -sys.path.append("../../gempy") -os.environ["aesara_FLAGS"] = "mode=FAST_RUN,device=cuda" - -# Importing GemPy -import gempy_legacy as gp -from examples.tutorials.ch5_probabilistic_modeling_DEP.aux_functions.DEP_aux_funct import plot_geo_setting - -# Embedding matplotlib figures in the notebooks -# %matplotlib inline - -# Importing auxiliary libraries -import numpy as np -import matplotlib.pyplot as plt -import pymc as pm -import arviz as az - - -# %% -# Model definition -# ---------------- -# -# In the previous example we assume constant thickness to be able to -# reduce the problem to one dimension. This keeps the probabilistic model -# fairly simple since we do not need to deel with complex geometric -# structures. Unfortunaly, geology is all about dealing with complex three -# dimensional structures. In the moment data spread across the physical -# space, the probabilistic model will have to expand to relate data from -# different locations. In other words, the model will need to include -# either interpolations, regressions or some other sort of spatial -# functions. In this paper, we use an advance universal co-kriging -# interpolator. Further implications of using this method will be discuss -# below but for this lets treat is a simple spatial interpolation in order -# to keep the focus on the constraction of the probabilistic model. -# - - -# %% -path_dir = os.getcwd()+'/examples/tutorials/ch5_probabilistic_modeling' - -# %% -geo_model = gp.load_model(r'2-layers', path=path_dir, recompile=True) - -# %% - - -# %% -geo_model = gp.create_model('2-layers') -gp.init_data(geo_model, extent=[0, 12e3, -2e3, 2e3, 0, 4e3], resolution=[500,1,500]) - -# %% -geo_model.add_surfaces('surface 1') -geo_model.add_surfaces('surface 2') -geo_model.add_surfaces('basement') -dz = geo_model.grid.regular_grid.dz -geo_model.surfaces.add_surfaces_values([dz, 0, 0], ['dz']) -geo_model.surfaces.add_surfaces_values(np.array([2.6, 2.4, 3.2]), ['density']) - -# %% -geo_model.add_surface_points(3e3, 0, 3.05e3, 'surface 1') -geo_model.add_surface_points(9e3, 0, 3.05e3, 'surface 1') - -geo_model.add_surface_points(3e3, 0, 1.02e3, 'surface 2') -geo_model.add_surface_points(9e3, 0, 1.02e3, 'surface 2') - -geo_model.add_orientations( 6e3, 0, 4e3, 'surface 1', [0,0,1]) - -# %% -gp.plot.plot_data(geo_model) - - -# %% -# Plots: -# ~~~~~~ -# - -# %% -import arviz as az - - -# %% -# Load data -# ^^^^^^^^^ -# - -# %% -data = az.from_netcdf('australia') - -# %% -data.prior['depth_0'] = data.prior['depths'][0 ,:, 0] -data.prior['depth_1'] = data.prior['depths'][0 ,:, 1] -data.prior['depth_2'] = data.prior['depths'][0 ,:, 2] -data.prior['depth_3'] = data.prior['depths'][0 ,:, 3] - -# %% -data.posterior['depth_0'] = data.posterior['depths'][0 ,:, 0] -data.posterior['depth_1'] = data.posterior['depths'][0 ,:, 1] -data.posterior['depth_2'] = data.posterior['depths'][0 ,:, 2] -data.posterior['depth_3'] = data.posterior['depths'][0 ,:, 3] - -# %% -az.plot_trace(data, var_names=['depth_0', 'depth_1', 'depth_2', 'depth_3', 'gravity']); - -# %% -az.plot_joint(data, var_names=['depth_1', 'depth_2']) - -# %% -# !git pull -from gempy_legacy.bayesian import plot_posterior as pp - -import seaborn as sns -from ipywidgets import interact, interactive, fixed, interact_manual -import ipywidgets as widgets - - - -# %% -# %matplotlib notebook -from importlib import reload -reload(pp) -p = pp.PlotPosterior(data) -p.create_figure(figsize=(9,3), joyplot=True) -def change_iteration(iteration): - p.plot_posterior(['depth_1', 'depth_3'], ['gravity', 'sigma'], 'y', iteration) -interact(change_iteration, iteration=(0, 700, 30)) - - -# %% -# -------------- -# -# Gif 2D -# ------ -# - -# %% -# %matplotlib inline -import matplotlib -import matplotlib.pyplot as plt -import numpy as np -import imageio - -# !git pull -from gempy_legacy.bayesian import plot_posterior as pp - -import seaborn as sns - - -# %% -p = pp.PlotPosterior(data) -p.create_figure(figsize=(9,6), joyplot=True) - - -# %% -image_list2 = [] -for i in range(0, 700, 1): - p.plot_posterior(['depth_1', 'depth_3'], ['gravity', 'sigma'], 'y', i) - # Used to return the plot as an image rray - fig = p.fig # draw the canvas, cache the renderer - fig.canvas.draw() - image = np.frombuffer(fig.canvas.tostring_rgb(), dtype='uint8') - image = image.reshape(fig.canvas.get_width_height()[::-1] + (3,)) - image_list2.append(image) - -# %% -kwargs_write = {'fps':1.0, 'quantizer':'nq'} -imageio.mimsave('./hard1_slow_mo.mov', image_list2, fps=3) - -# %% -imageio.mimsave('./hard1.mov', image_list2, fps=9) - - -# %% -# Plot 3D -# ------- -# - -# %% -geo_model.set_regular_grid(geo_model.grid.regular_grid.extent, [40,20,40]) - -# %% -geo_model.set_active_grid('regular', reset=True) - -# %% -gp.set_interpolator(geo_model, output=['geology'], gradient=False, - aesara_optimizer='fast_run') - -# %% -gp.compute_model(geo_model) - -# %% -import pyvista -pyvista.set_plot_theme('doc') - -# %% -pv = gp._plot.plot_3d(geo_model, plotter_type='background', - render_surfaces=False) - -# %% -grid = pv.plot_structured_grid('lith') - -# %% -iteration = 200 -geo_model.modify_surface_points([0,1,2,3], - Z=data.posterior['depths'][0][iteration]) -gp.compute_model(geo_model) - -# %% -pv.set_scalar_data(grid[0]) - - -# %% -pv.p.open_movie('3D.mov', framerate=9) - -for i in range(0, 700, 1): - geo_model.modify_surface_points([0,1,2,3], - Z=data.posterior['depths'][0][i]) - gp.compute_model(geo_model) - pv.set_scalar_data(grid[0]) - pv.p.ren_win.Render() - pv.p.write_frame() - -# Close movie and delete object -pv.p.close() - - -# %% -# -------------- -# - - -# %% -# Alternative code: -# ~~~~~~~~~~~~~~~~~ -# -# Plot models: -# ^^^^^^^^^^^^ -# - -# %% -geo_model.set_active_grid('regular') - -# %% - -geo_model.set_regular_grid(extent=[0, 10000, 0, 10000, 0, 10000], resolution=[100,2,100]) -iteration=300 - -geo_model.modify_surface_points([0,1,2,3], Z=data.posterior['depths'][0, iteration])#data.get_values('depths')[iteration]) -gp.compute_model(geo_model, output='gravity') -gp.plot.plot_section(geo_model, 0) - -# %% -geo_model.surfaces.df - -# %% -gp.plot.plot_section(geo_model, 0) - - -# %% -# Making gif -# ~~~~~~~~~~ -# - -# %% -import imageio - -# %% -pictures = [] - -for iteration in range(700): - p.plot_posterior(['depth_2', 'depth_3'], ['gravity', 'sigma'], 'y', iteration) - p.axjoin.set_xlim(2000, 14000) - p.axjoin.set_ylim(2000, 14000) - p.fig.canvas.draw() - image = np.frombuffer(p.fig.canvas.tostring_rgb(), dtype='uint8') - pictures.append(image.reshape(p.fig.canvas.get_width_height()[::-1] + (3,))) - -# %% -kwargs_write = {'fps':1.0, 'quantizer':'nq'} -imageio.mimsave('./learning_cheap.gif', pictures[:500:3], fps=24) - - -# %% -# Pyvista -# ~~~~~~~ -# - -# %% -from gempy_legacy.plot import vista -import pyvista as pv -from importlib import reload -reload(vista) -pv.set_plot_theme('document') - -gv = vista.Vista(geo_model, plotter_type='basic', notebook=False, real_time=True) - -a = gv.set_structured_grid() -gv.p.open_gif('learning_3D-block.gif') - - -# %% -gv.p.show(auto_close=False, cpos='xz') - - -# %% -for iteration in range(0,500,1): - geo_model.modify_surface_points([0,1,2,3], Z=data.posterior['depths'][0, iteration])#data.get_values('depths')[iteration]) - gp.compute_model(geo_model, output='gravity'); - gv.p.remove_actor(a) - a = gv.set_structured_grid() - gv.p.write_frame() - - -# %% -gv.p.close() \ No newline at end of file diff --git a/examples/tutorials/ch5_probabilistic_modeling_DEP/aux_functions/DEP_aux_funct.py b/examples/tutorials/ch5_probabilistic_modeling_DEP/aux_functions/DEP_aux_funct.py deleted file mode 100644 index 8b137891..00000000 --- a/examples/tutorials/ch5_probabilistic_modeling_DEP/aux_functions/DEP_aux_funct.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/examples/tutorials/ch5_probabilistic_modeling_DEP/aux_functions/__init__.py b/examples/tutorials/ch5_probabilistic_modeling_DEP/aux_functions/__init__.py deleted file mode 100644 index 4a906e49..00000000 --- a/examples/tutorials/ch5_probabilistic_modeling_DEP/aux_functions/__init__.py +++ /dev/null @@ -1,40 +0,0 @@ -import gempy_legacy as gp -import numpy as np -import matplotlib.pyplot as plt - - -def plot_geo_setting(geo_model): - device_loc = np.array([[6e3, 0, 3700]]) - p2d = gp.plot_2d(geo_model, show_topography=True) - - well_1 = 3.5e3 - well_2 = 3.6e3 - p2d.axes[0].scatter([3e3], [well_1], marker='^', s=400, c='#71a4b3', zorder=10) - p2d.axes[0].scatter([9e3], [well_2], marker='^', s=400, c='#71a4b3', zorder=10) - p2d.axes[0].scatter(device_loc[:, 0], device_loc[:, 2], marker='x', s=400, c='#DA8886', zorder=10) - - p2d.axes[0].vlines(3e3, .5e3, well_1, linewidth=4, color='gray') - p2d.axes[0].vlines(9e3, .5e3, well_2, linewidth=4, color='gray') - p2d.axes[0].vlines(3e3, .5e3, well_1) - p2d.axes[0].vlines(9e3, .5e3, well_2) - - plt.show() - - -def plot_geo_setting_well(geo_model): - device_loc = np.array([[6e3, 0, 3700]]) - p2d = gp.plot_2d(geo_model, show_topography=True, legend=False) - - well_1 = 3.41e3 - well_2 = 3.6e3 - p2d.axes[0].scatter([3e3], [well_1], marker='^', s=400, c='#71a4b3', zorder=10) - p2d.axes[0].scatter([9e3], [well_2], marker='^', s=400, c='#71a4b3', zorder=10) - p2d.axes[0].scatter(device_loc[:, 0], device_loc[:, 2], marker='x', s=400, c='#DA8886', zorder=10) - - p2d.axes[0].vlines(3e3, .5e3, well_1, linewidth=4, color='gray') - p2d.axes[0].vlines(9e3, .5e3, well_2, linewidth=4, color='gray') - p2d.axes[0].vlines(3e3, .5e3, well_1) - p2d.axes[0].vlines(9e3, .5e3, well_2) - p2d.axes[0].set_xlim(2900, 3100) - - plt.show() \ No newline at end of file diff --git a/examples/tutorials/ch5_probabilistic_modeling_DEP/ch5_1.py b/examples/tutorials/ch5_probabilistic_modeling_DEP/ch5_1.py deleted file mode 100644 index a0761d20..00000000 --- a/examples/tutorials/ch5_probabilistic_modeling_DEP/ch5_1.py +++ /dev/null @@ -1,176 +0,0 @@ -""" -5.1 - Probabilistic Modeling: Error Propagation -================================================ - -In this example we will show how easy we can propagate uncertainty from -GemPy parameters to final structural models. - -""" - -# %% -import sys, os -sys.path.append("../../gempy") -os.environ["aesara_FLAGS"] = "mode=FAST_RUN,device=cuda" - - -import gempy_legacy as gp -from gempy_legacy.bayesian.fields import compute_prob, calculate_ie_masked -import numpy as np -import matplotlib.pyplot as plt - -np.random.seed(1234) - -# %% -# Model definition -# ---------------- -# -# In the previous example we assume constant thickness to be able to -# reduce the problem to one dimension. This keeps the probabilistic model -# fairly simple since we do not need to deel with complex geometric -# structures. Unfortunaly, geology is all about dealing with complex three -# dimensional structures. In the moment data spread across the physical -# space, the probabilistic model will have to expand to relate data from -# different locations. In other words, the model will need to include -# either interpolations, regressions or some other sort of spatial -# functions. In this paper, we use an advance universal co-kriging -# interpolator. Further implications of using this method will be discuss -# below but for this lets treat is a simple spatial interpolation in order -# to keep the focus on the constraction of the probabilistic model. -# - -# %% -geo_model = gp.create_model('2-layers') -gp.init_data(geo_model, extent=[0, 12e3, -2e3, 2e3, 0, 4e3], resolution=[100, 10, 200]) - -# %% -geo_model.add_surfaces('surface 1') -geo_model.add_surfaces('surface 2') -geo_model.add_surfaces('basement') -dz = geo_model._grid.regular_grid.dz -geo_model.add_surface_values([dz, 0, 0], ['dz']) -geo_model.add_surface_values(np.array([2.6, 2.4, 3.2]), ['density']) - -# %% -geo_model.add_surface_points(3e3, 0, 3.05e3, 'surface 1') -geo_model.add_surface_points(9e3, 0, 3.05e3, 'surface 1') - -geo_model.add_surface_points(3e3, 0, 1.02e3, 'surface 2') -geo_model.add_surface_points(9e3, 0, 1.02e3, 'surface 2') - -geo_model.add_orientations(6e3, 0, 4e3, 'surface 1', [0, 0, 1]) - -# %% -gp.plot_2d(geo_model) -plt.show() - -# %% -# Adding topography -# ----------------- - -# %% -geo_model.set_topography() - - -# %% -# Setting up our area -# ------------------- -# Lets imagine we have two boreholes and 1 gravity device. From the boreholes -# we can estimate the location of the interfaces of our layers. That will be -# enough to create the first model. - -# %% -def plot_geo_setting(): - device_loc = np.array([[6e3, 0, 3700]]) - p2d = gp.plot_2d(geo_model, show_topography=True) - - well_1 = 3.5e3 - well_2 = 3.62e3 - p2d.axes[0].scatter([3e3], [well_1], marker='^', s=400, c='#71a4b3', zorder=10) - p2d.axes[0].scatter([9e3], [well_2], marker='^', s=400, c='#71a4b3', zorder=10) - p2d.axes[0].scatter(device_loc[:, 0], device_loc[:, 2], marker='x', s=400, c='#DA8886', zorder=10) - - p2d.axes[0].vlines(3e3, .5e3, well_1, linewidth=4, color='gray') - p2d.axes[0].vlines(9e3, .5e3, well_2, linewidth=4, color='gray') - p2d.axes[0].vlines(3e3, .5e3, well_1) - p2d.axes[0].vlines(9e3, .5e3, well_2) - plt.savefig('model.svg') - plt.show() - -# %% - -plot_geo_setting() - - -# %% -# Computing model -# --------------- - -# %% -gp.set_interpolator(geo_model) - -# %% -gp.compute_model(geo_model) -plot_geo_setting() - - - -# %% -# Adding Random variables -# ----------------------- -# Although that can work as a good approximation, the truth is that modelling -# hundreds of meters underground is not specially precise. That's why in many -# cases we would like to model our input data as probability distributions -# instead deterministic values. GemPy is specially efficiency for these type of -# tasks: - -# %% -geo_model.modify_surface_points(2, Z=500) -gp.compute_model(geo_model) -plot_geo_setting() - -Z = np.random.normal(1000, 500, size=2) -geo_model.modify_surface_points([2, 3], Z=Z) -gp.compute_model(geo_model) -plot_geo_setting() - -# %% -# Now we just sample from a random variable and loop it as much as we want: -lith_blocks = np.array([]) -n_iterations = 50 -for i in range(n_iterations): - Z = np.random.normal(1000, 500, size=2) - geo_model.modify_surface_points([2, 3], Z=Z) - gp.compute_model(geo_model) - lith_blocks = np.append(lith_blocks, geo_model.solutions.lith_block) - -lith_blocks = lith_blocks.reshape(n_iterations, -1) - -# %% -prob_block = compute_prob(lith_blocks) - -# %% -p2dp = gp.plot_2d(geo_model, - show_lith=False, show_boundaries=False, show_data=False, - regular_grid=prob_block[2], - kwargs_regular_grid={'cmap': 'viridis', - 'norm': None} - ) -plt.show() - -# %% -entropy_block = calculate_ie_masked(prob_block) - -# %% -# sphinx_gallery_thumbnail_number = 6 -p2dp = gp.plot_2d(geo_model, - show_lith=False, show_boundaries=False, show_data=False, - regular_grid=entropy_block, - kwargs_regular_grid={'cmap': 'viridis', - 'norm': None} - ) - - - - - - diff --git a/examples/tutorials/ch5_probabilistic_modeling_DEP/ch5_2_introduction_pymc3.py b/examples/tutorials/ch5_probabilistic_modeling_DEP/ch5_2_introduction_pymc3.py deleted file mode 100644 index 0a06f235..00000000 --- a/examples/tutorials/ch5_probabilistic_modeling_DEP/ch5_2_introduction_pymc3.py +++ /dev/null @@ -1,198 +0,0 @@ -""" -5 2 - Introduction PyMC3. -========================= - -""" -# %% - -# Importing GemPy -import gempy_legacy as gp - -# Importing auxiliary libraries -import os -import numpy as np -import matplotlib.pyplot as plt -import pymc as pm -import arviz as az - -from gempy_legacy.bayesian import plot_posterior as pp -from importlib import reload -from matplotlib.ticker import StrMethodFormatter - -# %% -# Model definition -# ---------------- -# - -# %% -# This is to make it work in sphinx gallery -cwd = os.getcwd() -if not 'examples' in cwd: - path_dir = os.getcwd()+'/examples/tutorials/ch5_probabilistic_modeling' -else: - path_dir = cwd - -# %% -geo_model = gp.load_model(r'/2-layers', path=path_dir+'/2-layers', recompile=True) - -# %% -geo_model.modify_surface_points(2, Z=1000) -gp.compute_model(geo_model) - - -# %% - -def plot_geo_setting_well(): - device_loc = np.array([[6e3, 0, 3700]]) - p2d = gp.plot_2d(geo_model, show_topography=True, legend=False) - - well_1 = 3.41e3 - well_2 = 3.6e3 - p2d.axes[0].scatter([3e3], [well_1], marker='^', s=400, c='#71a4b3', zorder=10) - p2d.axes[0].scatter([9e3], [well_2], marker='^', s=400, c='#71a4b3', zorder=10) - p2d.axes[0].scatter(device_loc[:, 0], device_loc[:, 2], marker='x', s=400, c='#DA8886', zorder=10) - - p2d.axes[0].vlines(3e3, .5e3, well_1, linewidth=4, color='gray') - p2d.axes[0].vlines(9e3, .5e3, well_2, linewidth=4, color='gray') - p2d.axes[0].vlines(3e3, .5e3, well_1) - p2d.axes[0].vlines(9e3, .5e3, well_2) - p2d.axes[0].set_xlim(2900, 3100) - plt.savefig('well.svg') - plt.show() - - -# %% -plot_geo_setting_well() - -# Thickness measurements -# ---------------------- - -# %% -y_obs = [2.12] -y_obs_list = [2.12, 2.06, 2.08, 2.05, 2.08, 2.09, - 2.19, 2.07, 2.16, 2.11, 2.13, 1.92] -np.random.seed(4003) - -# %% -# Normal-several points -# ~~~~~~~~~~~~~~~~~~~~~ -# .. image:: /../../_static/computational_graph1.png -# - -# %% -with pm.Model() as model: - mu = pm.Normal('$\mu$', 2.08, .07) - sigma = pm.Gamma('$\sigma$', 0.3, 3) - y = pm.Normal('$y$', mu, sigma, observed=y_obs_list) - -# %% -mu - -# %% -sigma - -# %% -y - - -# %% -# Sampling -# -------- -# - -# %% -with model: - prior = pm.sample_prior_predictive(1000) - trace = pm.sample(1000, discard_tuned_samples=False, cores=1) - post = pm.sample_posterior_predictive(trace) - -# %% - -data = az.from_pymc3(trace=trace, - prior=prior, - posterior_predictive=post) - -# %% -az.plot_trace(data) -plt.show() - -# %% -# Raw observations: -# ^^^^^^^^^^^^^^^^^ -# - -# %% - -reload(pp) -p = pp.PlotPosterior(data) -p.create_figure(figsize=(9, 3), joyplot=False, marginal=False) -p.plot_normal_likelihood('$\mu$', '$\sigma$', '$y$', iteration=-1, hide_bell=True) -p.likelihood_axes.set_xlim(1.90, 2.2) -p.likelihood_axes.xaxis.set_major_formatter(StrMethodFormatter('{x:,.2f}')) -for tick in p.likelihood_axes.get_xticklabels(): - tick.set_rotation(45) -plt.show() - -# %% -# Final inference -# ^^^^^^^^^^^^^^^ -# - -# %% - -reload(pp) -p = pp.PlotPosterior(data) -p.create_figure(figsize=(9, 3), joyplot=False, marginal=False) -p.plot_normal_likelihood('$\mu$', '$\sigma$', '$y$', iteration=-1, hide_lines=True) -p.likelihood_axes.set_xlim(1.70, 2.40) -p.likelihood_axes.xaxis.set_major_formatter(StrMethodFormatter('{x:,.2f}')) -for tick in p.likelihood_axes.get_xticklabels(): - tick.set_rotation(45) -plt.show() - -# %% -# Joyplot -# ~~~~~~~ -# - -# %% -# %matplotlib inline -reload(pp) -p = pp.PlotPosterior(data) - -p.create_figure(figsize=(9, 9), joyplot=True, marginal=False, likelihood=False, n_samples=31) -p.plot_joy(('$\mu$', '$\sigma$'), '$y$', iteration=14) -plt.show() - -# %% -# Join probability -# ~~~~~~~~~~~~~~~~ -# - -# %% -# sphinx_gallery_thumbnail_number = 6 -reload(pp) -p = pp.PlotPosterior(data) - -p.create_figure(figsize=(9, 5), joyplot=False, marginal=True, likelihood=True) -p.plot_marginal(var_names=['$\mu$', '$\sigma$'], - plot_trace=False, credible_interval=.93, kind='kde') - -p.plot_normal_likelihood('$\mu$', '$\sigma$', '$y$', iteration=-1, hide_lines=True) -p.likelihood_axes.set_xlim(1.70, 2.40) -plt.show() - -# %% -# Full plot -# ~~~~~~~~~ -# - -# %% -reload(pp) -p = pp.PlotPosterior(data) - -p.create_figure(figsize=(9, 5), joyplot=True, marginal=True, likelihood=True, n_samples=11) - -p.plot_posterior(['$\mu$', '$\sigma$'], ['$\mu$', '$\sigma$'], '$y$', - marginal_kwargs={'plot_trace': False, 'credible_interval': .93, 'kind': 'kde'}) -plt.show() \ No newline at end of file diff --git a/examples/tutorials/ch5_probabilistic_modeling_DEP/ch5_3_probability_density_transformation.py b/examples/tutorials/ch5_probabilistic_modeling_DEP/ch5_3_probability_density_transformation.py deleted file mode 100644 index a2b60fd2..00000000 --- a/examples/tutorials/ch5_probabilistic_modeling_DEP/ch5_3_probability_density_transformation.py +++ /dev/null @@ -1,167 +0,0 @@ -""" -5.3 - Probability Density Transformation. -========================================= - -""" - -# Importing GemPy -import gempy_legacy as gp -from gempy_legacy.bayesian import plot_posterior as pp -from gempy_legacy.bayesian.plot_posterior import default_red, default_blue - -# Importing auxiliary libraries -import numpy as np -import matplotlib.pyplot as plt -import pymc as pm -import arviz as az -import os - -# %% -# Model definition -# ---------------- -# -# Same problem as before, letā€™s assume the observations are layer -# thickness measurements taken on an outcrop. Now, in the previous example -# we chose a prior for the mean arbitrarily: -# :math:`šœ‡āˆ¼Normal(mu=10.0, sigma=5.0)`ā€“something that made sense for these -# specific data set. If we do not have any further information, keeping -# an uninformative prior and let the data to dictate the final value of -# the inference is the sensible way forward. However, this also enable to -# add information to the system by setting informative priors. -# -# Imagine we get a borehole with the tops of the two interfaces of -# interest. Each of this data point will be a random variable itself since -# the accuracy of the exact 3D location will be always limited. Notice -# that this two data points refer to depth not to thicknessā€“the unit of -# the rest of the observations. Therefore, the first step would be to -# perform a transformation of the parameters into the observations space. -# Naturally in this example a simple subtraction will suffice. -# -# Now we can define the probabilistic models: -# - -# %% -# This is to make it work in sphinx gallery -cwd = os.getcwd() -if not 'examples' in cwd: - path_dir = os.getcwd() + '/examples/tutorials/ch5_probabilistic_modeling' -else: - path_dir = cwd - - -# %% -# Define plotting function -def plot_geo_setting_well(geo_model): - device_loc = np.array([[6e3, 0, 3700]]) - p2d = gp.plot_2d(geo_model, show_topography=True, legend=False) - - well_1 = 3.41e3 - well_2 = 3.6e3 - p2d.axes[0].scatter([3e3], [well_1], marker='^', s=400, c='#71a4b3', zorder=10) - p2d.axes[0].scatter([9e3], [well_2], marker='^', s=400, c='#71a4b3', zorder=10) - p2d.axes[0].scatter(device_loc[:, 0], device_loc[:, 2], marker='x', s=400, - c='#DA8886', zorder=10) - - p2d.axes[0].vlines(3e3, .5e3, well_1, linewidth=4, color='gray') - p2d.axes[0].vlines(9e3, .5e3, well_2, linewidth=4, color='gray') - p2d.axes[0].vlines(3e3, .5e3, well_1) - p2d.axes[0].vlines(9e3, .5e3, well_2) - p2d.axes[0].set_xlim(2900, 3100) - - plt.show() - - -# %% -geo_model = gp.load_model(r'2-layers', path=path_dir + r'/2-layers', recompile=True) -plot_geo_setting_well(geo_model=geo_model) - -# %% -y_obs = [2.12] -y_obs_list = [2.12, 2.06, 2.08, 2.05, 2.08, 2.09, - 2.19, 2.07, 2.16, 2.11, 2.13, 1.92] - -np.random.seed(4003) - -# %% -# -# # .. image:: /../../_static/computational_graph1.png -# - -# %% -with pm.Model() as model: - mu_top = pm.Normal('$\mu_{top}$', 3.05, .2) - sigma_top = pm.Gamma('$\sigma_{top}$', 0.3, 3) - y_top = pm.Normal('y_{top}', mu=mu_top, sd=sigma_top, observed=[3.02]) - - mu_bottom = pm.Normal('$\mu_{bottom}$', 1.02, .2) - sigma_bottom = pm.Gamma('$\sigma_{bottom}$', 0.3, 3) - y_bottom = pm.Normal('y_{bottom}', mu=mu_bottom, sd=sigma_bottom, - observed=[1.02]) - - mu_t = pm.Deterministic('$\mu_{thickness}$', mu_top - mu_bottom) - sigma_thick = pm.Gamma('$\sigma_{thickness}$', 0.3, 3) - y = pm.Normal('y_{thickness}', mu=mu_t, sd=sigma_thick, observed=y_obs_list) - -# %% -# Sampling -# -------- -# - -# %% -with model: - prior = pm.sample_prior_predictive(1000) - trace = pm.sample(1000, discard_tuned_samples=False, cores=1) - post = pm.sample_posterior_predictive(trace) - -# %% -data = az.from_pymc3(trace=trace, - prior=prior, - posterior_predictive=post) -data - -# %% - -az.plot_trace(data) -plt.show() - -# %% -# sphinx_gallery_thumbnail_number = 3 -az.plot_density([data, data.prior], shade=.9, data_labels=["Posterior", "Prior"], - var_names=[ - '$\\mu_{top}$', - '$\\mu_{bottom}$', - '$\\mu_{thickness}$', - '$\\sigma_{top}$', - '$\\sigma_{bottom}$', - '$\\sigma_{thickness}$' - ], - colors=[default_red, default_blue], bw=5); -plt.show() - -# %% - -p = pp.PlotPosterior(data) - -p.create_figure(figsize=(9, 5), joyplot=False, marginal=True, likelihood=False) -p.plot_marginal(var_names=['$\\mu_{top}$', '$\\mu_{bottom}$'], - plot_trace=False, credible_interval=.70, kind='kde', - marginal_kwargs={"bw": 1} - ) -plt.show() -# %% - -p = pp.PlotPosterior(data) -p.create_figure(figsize=(9, 6), joyplot=True) - -iteration = 500 -p.plot_posterior(['$\\mu_{top}$', '$\\mu_{bottom}$'], - ['$\mu_{thickness}$', '$\sigma_{thickness}$'], - 'y_{thickness}', iteration, - marginal_kwargs={"credible_interval": 0.94, - 'marginal_kwargs': {"bw": 1}, - 'joint_kwargs': {"bw": 1}}) -plt.show() - -# %% -az.plot_pair(data, divergences=False, var_names=['$\\mu_{top}$', '$\\mu_{bottom}$']) -plt.show() diff --git a/gempy_legacy/__init__.py b/gempy_legacy/__init__.py index 9abd7252..4a331a48 100644 --- a/gempy_legacy/__init__.py +++ b/gempy_legacy/__init__.py @@ -50,7 +50,7 @@ # Assert at least pyton 3.10 assert sys.version_info[0] >= 3 and sys.version_info[1] >= 10, "GemPy requires Python 3.10 or higher" -__version__ = '2.3.1' +__version__ = '2.3.2' if __name__ == '__main__': pass diff --git a/setup.py b/setup.py index 5b0909e4..f82b5206 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages, Extension -version = '2.3.1' +version = '2.3.2' with open("README.md", "r") as fh: long_description = fh.read()