Skip to content

Commit 56afdb3

Browse files
authored
Reorganize gempy_probability package structure and update imports (#4)
# Reorganize code structure to follow Terranigma architecture This PR reorganizes the codebase to follow the Terranigma default structure by: - Creating a modular directory structure with `api`, `core`, `modules`, and `plugins` folders - Moving plotting utilities to `modules/plot/` directory - Moving field-related code to `modules/fields/` - Relocating deprecated code to a new `obsolete/` directory - Moving specialized tools to the `plugins/` directory - Updating import paths in all example files to reflect the new structure These changes maintain functionality while providing a more organized and maintainable codebase.
2 parents 6f93a2f + 5ea8e65 commit 56afdb3

23 files changed

+7
-8
lines changed

examples/WIP/3.2_WIP_gravity_inversion.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
# Auxiliary libraries
1818
import numpy as np
1919
import matplotlib.pyplot as plt
20-
import matplotlib.image as mpimg
2120
import pandas as pd
2221
# %% md
2322
# Packages for inversion
@@ -213,7 +212,7 @@ def pyro_model(y_obs_list, interpolation_input):
213212
# %%
214213
# Create density plots for posterior and prior distributions
215214
# These plots provide insights into the parameter distributions and their changes.
216-
from gempy_probability.plot_posterior import default_red, default_blue
215+
from gempy_probability.modules.plot.plot_posterior import default_red, default_blue
217216
az.plot_density(
218217
data=[data, data.prior],
219218
shade=.9,

examples/tutorials/1-first_example_of_inference/1-bayesian_basics/1.1_Intro_to_Bayesian_Inference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import pyro
1212
import torch
1313

14-
from gempy_probability.plot_posterior import PlotPosterior
14+
from gempy_probability.modules.plot.plot_posterior import PlotPosterior
1515
from _aux_func import infer_model
1616

1717
az.style.use("arviz-doc")

examples/tutorials/1-first_example_of_inference/1-bayesian_basics/1.2_Intro_to_Bayesian_Inference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import torch
2020
from matplotlib.ticker import StrMethodFormatter
2121

22-
from gempy_probability.plot_posterior import PlotPosterior
22+
from gempy_probability.modules.plot.plot_posterior import PlotPosterior
2323
from _aux_func import infer_model
2424
az.style.use("arviz-doc")
2525

examples/tutorials/1-first_example_of_inference/1-bayesian_basics/1.3_Intro_to_Bayesian_Inference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import pyro
1111
import torch
1212

13-
from gempy_probability.plot_posterior import PlotPosterior
13+
from gempy_probability.modules.plot.plot_posterior import PlotPosterior
1414

1515
from _aux_func import infer_model
1616

examples/tutorials/1-first_example_of_inference/1-bayesian_basics/1.4_Intro_to_Bayesian_Inference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import torch
1212
from matplotlib.ticker import StrMethodFormatter
1313

14-
from gempy_probability.plot_posterior import PlotPosterior
14+
from gempy_probability.modules.plot.plot_posterior import PlotPosterior
1515

1616
from _aux_func import infer_model
1717

examples/tutorials/2-basic_geology/1-thickness_problem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
import torch
4242
from pyro.infer import MCMC, NUTS, Predictive
4343
from pyro.infer.inspect import get_dependencies
44-
from gempy_probability.plot_posterior import PlotPosterior, default_red, default_blue
44+
from gempy_probability.modules.plot.plot_posterior import PlotPosterior, default_red, default_blue
4545
import arviz as az
4646

4747
az.style.use("arviz-doc")

examples/tutorials/2-basic_geology/2-thickness_problem_gempy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import arviz as az
2323

2424
from gempy_engine.core.data.interpolation_input import InterpolationInput
25-
from gempy_probability.plot_posterior import default_red, default_blue
25+
from gempy_probability.modules.plot.plot_posterior import default_red, default_blue
2626

2727
# sphinx_gallery_thumbnail_number = -1
2828

gempy_probability/api/__init__.py

Whitespace-only changes.

gempy_probability/core/__init__.py

Whitespace-only changes.

gempy_probability/modules/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)