Skip to content

Commit c78033e

Browse files
committed
[BUG] Warn instead of raising error when computation timestamp is missing to prevent unnecessary failures.
1 parent a1615b5 commit c78033e

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

gempy_engine/API/interp_single/_interp_scalar_field.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import warnings
2+
13
from typing import Tuple, Optional
24

35
import numpy as np
@@ -31,14 +33,15 @@ def interpolate_scalar_field(solver_input: SolverInput, options: InterpolationOp
3133
)
3234
ts = options.temp_interpolation_values.start_computation_ts
3335
if ts == -1:
34-
raise ValueError("ts not set")
35-
36-
weights_hash = generate_cache_key(
37-
name="",
38-
parameters={
39-
"ts": ts
40-
}
41-
)
36+
warnings.warn("No start computation timestamp found. No caching.")
37+
weights_cached = None
38+
else:
39+
weights_hash = generate_cache_key(
40+
name="",
41+
parameters={
42+
"ts": ts
43+
}
44+
)
4245
case InterpolationOptions.CacheMode.CLEAR_CACHE:
4346
WeightCache.initialize_cache_dir()
4447
weights_cached = None

0 commit comments

Comments
 (0)