Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
[CLN/TEST] Cleaning the nugget effect test
  • Loading branch information
Leguark committed May 26, 2025
commit 6b27207f0a136037a5140770911ccfae2ce9cf0d
Original file line number Diff line number Diff line change
Expand Up @@ -46,39 +46,26 @@ def test_optimize_nugget_effect():
topography=(xr.open_dataset(os.path.join(path, "Topography.nc")))
)

if False:
gpv.plot_3d(geo_model, show_data=True, image=True)

geo_model.interpolation_options.cache_mode = gp.data.InterpolationOptions.CacheMode.NO_CACHE
geo_model.interpolation_options.kernel_options.range = 0.5

if True:
gp.API.compute_API.optimize_nuggets(
geo_model=geo_model,
engine_config=gp.data.GemPyEngineConfig(
backend=gp.data.AvailableBackends.PYTORCH,
),
max_epochs=100,
convergence_criteria=1e5,
only_groups=[geo_model.structural_frame.get_group_by_name("Red")]
)
gp.API.compute_API.optimize_nuggets(
geo_model=geo_model,
engine_config=gp.data.GemPyEngineConfig(
backend=gp.data.AvailableBackends.PYTORCH,
),
max_epochs=100,
convergence_criteria=1e5,
only_groups=[geo_model.structural_frame.get_group_by_name("Red")]
)

gp.compute_model(
gempy_model=geo_model,
engine_config=gp.data.GemPyEngineConfig(
backend=gp.data.AvailableBackends.PYTORCH,
),
validate_serialization=False
)
else:
gp.API.compute_API.optimize_and_compute(
geo_model=geo_model,
engine_config=gp.data.GemPyEngineConfig(
backend=gp.data.AvailableBackends.PYTORCH,
),
max_epochs=100,
convergence_criteria=1e5
)
gp.compute_model(
gempy_model=geo_model,
engine_config=gp.data.GemPyEngineConfig(
backend=gp.data.AvailableBackends.PYTORCH,
),
validate_serialization=False
)

print(f"Final cond number: {geo_model.interpolation_options.kernel_options.condition_number}")
nugget_effect = geo_model.taped_interpolation_input.surface_points.nugget_effect_scalar.detach().numpy()
Expand All @@ -96,7 +83,7 @@ def test_optimize_nugget_effect():
import gempy_viewer as gpv
import pyvista as pv

image = False
image = True
gempy_vista = gpv.plot_3d(
model=geo_model,
show=False,
Expand Down