Skip to content

Commit 7e7a3b0

Browse files
committed
[WIP] Getting the first example of InterpolationOptions serializable
1 parent 61b804b commit 7e7a3b0

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

docs/developers_notes/dev_log/2025_05.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,20 @@
77
-[ ] Saving and loading models
88
-[ ] Better api for nugget effect optimization
99

10+
## Saving models
11+
- From gempy
12+
- StructuralFrame
13+
- OrientationsTable
14+
- SurfacePointsTable
15+
- From Engine
16+
- Input
17+
- EngineGrid
18+
- GeophysicsInput
19+
- InterpolationOptions
20+
- InputDataDescriptor
21+
- InterpolatorInput
22+
- Solutions (Not sure if I want to save them)
23+
- RawArraysSolutions
24+
- Solutions
25+
26+
## What do I have in the engine server logic?
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import pprint
2+
3+
import gempy as gp
4+
from gempy.core.data.enumerators import ExampleModel
5+
from gempy_engine.core.data import InterpolationOptions
6+
7+
8+
def test_generate_horizontal_stratigraphic_model():
9+
model: gp.data.GeoModel = gp.generate_example_model(ExampleModel.HORIZONTAL_STRAT, compute_model=False)
10+
print(model.structural_frame)
11+
options: InterpolationOptions = model.interpolation_options
12+
pass
13+
14+
def test_interpolation_options():
15+
options = InterpolationOptions.from_args(
16+
range=1.7,
17+
c_o=10.
18+
)
19+
json = options.model_dump()
20+
# Pretty print json
21+
pprint.pp(json)
22+
23+
# Deserialize with pydantic
24+
options2 = InterpolationOptions.model_validate(json)
25+
assert options.__str__() == options2.__str__()

0 commit comments

Comments
 (0)