Skip to content

Commit 9ee6a90

Browse files
committed
MNT: correction of docstring function.py
- MNT: rearranged the docstring of from_grid in function.py to match the expected output of doctest
1 parent 0a416b5 commit 9ee6a90

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

rocketpy/mathutils/function.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4093,7 +4093,16 @@ def from_grid(
40934093
-------
40944094
Function
40954095
A Function object using RegularGridInterpolator for evaluation.
4096-
4096+
4097+
Notes
4098+
-----
4099+
- Grid data must be on a regular (structured) grid.
4100+
- For unstructured data, use the regular Function constructor with
4101+
scattered points.
4102+
- Extrapolation with 'constant' mode uses the nearest edge values,
4103+
which is appropriate for aerodynamic coefficients where extrapolation
4104+
beyond the data range should be avoided.
4105+
40974106
Examples
40984107
--------
40994108
>>> import numpy as np
@@ -4113,15 +4122,8 @@ def from_grid(
41134122
... )
41144123
>>> # Evaluate at a point
41154124
>>> cd_func(1.2, 3e5, 3.0)
4125+
0.48000000000000004
41164126
4117-
Notes
4118-
-----
4119-
- Grid data must be on a regular (structured) grid.
4120-
- For unstructured data, use the regular Function constructor with
4121-
scattered points.
4122-
- Extrapolation with 'constant' mode uses the nearest edge values,
4123-
which is appropriate for aerodynamic coefficients where extrapolation
4124-
beyond the data range should be avoided.
41254127
"""
41264128
# Validate inputs
41274129
if not isinstance(grid_data, np.ndarray):

0 commit comments

Comments
 (0)