Skip to content

Commit 65a0862

Browse files
committed
docstring examples for ExperimentalVariogram and build_experimental_variogram(), used parameters values and geometries
1 parent 4db4790 commit 65a0862

File tree

2 files changed

+49
-4
lines changed

2 files changed

+49
-4
lines changed

CHANGELOG.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ Changes - from version >= 1.x
5050
* [tests] `Deviation` class tests and debug (method selection)
5151
* [docs] docstring example for `Deviation`
5252
* [docs] docstring examples for `AggregatedVariogram` and `regularize()`
53-
*
53+
* [docs] docstring examples for `ExperimentalVariogram` and `build_experimental_variogram()`, used parameters `values` and `geometries`
54+
* [docs]
5455

5556
2025-10-11
5657
----------

src/pyinterpolate/semivariogram/experimental/classes/experimental_variogram.py

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ class ExperimentalVariogram:
9696
Examples
9797
--------
9898
>>> import numpy as np
99+
>>> from pyinterpolate import ExperimentalVariogram
100+
>>>
101+
>>>
99102
>>> REFERENCE_INPUT = np.array([
100103
... [0, 0, 8],
101104
... [1, 0, 6],
@@ -113,9 +116,12 @@ class ExperimentalVariogram:
113116
... ])
114117
>>> STEP_SIZE = 1
115118
>>> MAX_RANGE = 4
116-
>>> empirical_smv = ExperimentalVariogram(REFERENCE_INPUT,
117-
... step_size=STEP_SIZE,
118-
... max_range=MAX_RANGE)
119+
>>> empirical_smv = ExperimentalVariogram(
120+
... values=REFERENCE_INPUT[:, -1],
121+
... geometries=REFERENCE_INPUT[:, :-1]
122+
... step_size=STEP_SIZE,
123+
... max_range=MAX_RANGE
124+
... )
119125
>>> print(empirical_smv)
120126
+-----+--------------------+---------------------+
121127
| lag | semivariance | covariance |
@@ -491,6 +497,44 @@ def build_experimental_variogram(ds: Union[ArrayLike, VariogramPoints] = None,
491497
Returns
492498
-------
493499
: ExperimentalVariogram
500+
501+
Examples
502+
--------
503+
>>> import numpy as np
504+
>>> from pyinterpolate import build_experimental_variogram
505+
>>>
506+
>>>
507+
>>> REFERENCE_INPUT = np.array([
508+
... [0, 0, 8],
509+
... [1, 0, 6],
510+
... [2, 0, 4],
511+
... [3, 0, 3],
512+
... [4, 0, 6],
513+
... [5, 0, 5],
514+
... [6, 0, 7],
515+
... [7, 0, 2],
516+
... [8, 0, 8],
517+
... [9, 0, 9],
518+
... [10, 0, 5],
519+
... [11, 0, 6],
520+
... [12, 0, 3]
521+
... ])
522+
>>> STEP_SIZE = 1
523+
>>> MAX_RANGE = 4
524+
>>> empirical_smv = build_experimental_variogram(
525+
... values=REFERENCE_INPUT[:, -1],
526+
... geometries=REFERENCE_INPUT[:, :-1]
527+
... step_size=STEP_SIZE,
528+
... max_range=MAX_RANGE
529+
... )
530+
>>> print(empirical_smv)
531+
+-----+--------------------+---------------------+
532+
| lag | semivariance | covariance |
533+
+-----+--------------------+---------------------+
534+
| 1.0 | 4.625 | -0.5434027777777798 |
535+
| 2.0 | 5.2272727272727275 | -0.7954545454545454 |
536+
| 3.0 | 6.0 | -1.2599999999999958 |
537+
+-----+--------------------+---------------------+
494538
"""
495539

496540
exp_var = ExperimentalVariogram(

0 commit comments

Comments
 (0)