VerticalWell¶
- class petres.models.VerticalWell[source]¶
Bases:
objectStore a vertical well with tops and property samples.
A well holds horizon tops and arbitrary property samples. Property samples are tracked per property name in one of two mutually exclusive modes: scalar mode (depth is
None) or depth-indexed mode (depth provided). Mixing these modes for the same property is not allowed.- Parameters:
name (str) – Well identifier.
x (float) – Well-head x coordinate.
y (float) – Well-head y coordinate.
tops (dict[str, float], optional) – Mapping of horizon name to measured top depth.
samples (dict[str, dict[float | None, float]], optional) – Property samples; keys are property names, values are depth→value maps.
_sample_modes (dict[str, Literal['scalar', 'depth']], optional) – Internal map tracking whether samples for a property are scalar or depth-indexed.
- add_top(horizon, depth)[source]¶
Add a new horizon top depth.
- Parameters:
- Raises:
ValueError – If the horizon name/depth is invalid or the horizon already exists.
- add_sample(name, value, depth=None)[source]¶
Add a property sample in scalar or depth-indexed mode.
For one property name, all samples must use the same storage mode: scalar (
depth=None) or depth-indexed (depthprovided).- Parameters:
- Raises:
ValueError – If values are invalid, a mode conflict occurs, or a duplicate sample key exists.
Examples
>>> well = VerticalWell(name="W1", x=100.0, y=200.0) >>> well.add_sample(name="poro", value=0.18) >>> well.add_sample(name="perm", value=120.0, depth=2500.0)
- get_sampling_mode(name)[source]¶
Return the storage mode for samples of a property.
- Parameters:
name (str) – Property name.
- Returns:
Storage mode for samples of this property.
- Return type:
‘scalar’ or ‘depth’
- Raises:
ValueError – If
nameis not a non-empty string.KeyError – If no samples exist for
name.
- get_sample(name, depth=None)[source]¶
Return one sample or all samples for a property.
- Parameters:
- Returns:
For depth-indexed properties: -
depthprovided: sample value at that depth. -depthomitted: shallow copy of depth→value mapping. For scalar properties: scalar sample value.- Return type:
- Raises:
ValueError – If
nameis not a non-empty string,depthis non-finite, or a depth is provided for a scalar property.KeyError – If no samples exist for
nameor no sample exists atdepth.
- remove_sample(name, depth=None)[source]¶
Remove a stored sample and clean empty internal state.
- Parameters:
- Raises:
ValueError – If
nameis not a non-empty string ordepthis non-finite when provided.KeyError – If no sample exists for
(name, depth).
- __init__(name, x, y, tops=<factory>, samples=<factory>, _sample_modes=<factory>)¶