Skip to content

Commit 92e8282

Browse files
committed
ExperimentalIndicatorVariogram and TheoreticalIndicatorVariogram - updated examples in docstrings
1 parent ca230f4 commit 92e8282

File tree

3 files changed

+48
-1
lines changed

3 files changed

+48
-1
lines changed

CHANGELOG.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ Changes - from version >= 1.x
5454
* [docs] docstring example for `calculate_covariance()`, used parameters `values` and `geometries`
5555
* [docs] docstring example for `DirectionalVariogram`, used parameters `values` and `geometries`
5656
* [docs] docstring example for `VariogramCloud`, used parameters `values` and `geometries`
57+
* [docs] `ExperimentalIndicatorVariogram` and `TheoreticalIndicatorVariogram` - updated examples in docstrings
58+
5759

5860
2025-10-11
5961
----------

src/pyinterpolate/semivariogram/indicator/indicator.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,26 @@ class ExperimentalIndicatorVariogram:
246246
Goovaerts P. AUTO-IK: a 2D indicator kriging program for automated
247247
non-parametric modeling of local uncertainty
248248
in earth sciences. DOI: https://doi.org/10.1016/j.cageo.2008.08.014
249+
250+
Examples
251+
--------
252+
>>> import numpy as np
253+
>>> from pyinterpolate import ExperimentalIndicatorVariogram
254+
>>>
255+
>>>
256+
>>> dem = np.random.random(size=(1000, 3))
257+
>>> step_size = 0.1
258+
>>> max_range = 0.6
259+
>>> exp_indicator = ExperimentalIndicatorVariogram(
260+
... values=dem[:, -1],
261+
... geometries=dem[:, :-1],
262+
... number_of_thresholds=5,
263+
... step_size=step_size,
264+
... max_range=max_range
265+
... )
266+
>>> print(len(exp_indicator.experimental_models))
267+
5
268+
>>> exp_indicator.show() # plots variogram for each threshold
249269
"""
250270

251271
def __init__(self,
@@ -342,6 +362,32 @@ class TheoreticalIndicatorVariogram:
342362
show()
343363
Shows experimental and theoretical variograms for each threshold.
344364
365+
Examples
366+
--------
367+
>>> import numpy as np
368+
>>> from pyinterpolate import (
369+
... ExperimentalIndicatorVariogram,
370+
... TheoreticalIndicatorVariogram
371+
... )
372+
>>>
373+
>>>
374+
>>> dem = np.random.random(size=(1000, 3))
375+
>>> step_size = 0.1
376+
>>> max_range = 0.6
377+
>>> exp_indicator = ExperimentalIndicatorVariogram(
378+
... values=dem[:, -1],
379+
... geometries=dem[:, :-1],
380+
... number_of_thresholds=5,
381+
... step_size=step_size,
382+
... max_range=max_range
383+
... )
384+
>>> theo_indicator = TheoreticalIndicatorVariogram(
385+
... experimental_indicator_variogram=exp_indicator
386+
... )
387+
>>> theo_indicator.fit()
388+
>>> print(len(theo_indicator.theoretical_indicator_variograms))
389+
5
390+
>>> theo_indicator.show() # plots theoretical models' curves
345391
"""
346392

347393
def __init__(

tests/test_semivariogram/test_indicator.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ def test_experimental_indicator_variogram():
4747
max_range=MX_RNG)
4848

4949
# evar.show()
50-
5150
assert isinstance(evar, ExperimentalIndicatorVariogram)
5251
assert isinstance(evar.experimental_models, Dict)
5352
assert isinstance(evar.ds, IndicatorVariogramData)

0 commit comments

Comments
 (0)