Skip to content

Commit 0df092d

Browse files
MateusStanophmbressanGui-FernandesBRCopilot
authored
ENH: Improve multi-variable drag compatibility, regular-grid handling, and related tests/docs (#927)
* MNT: simplify function grid interpolation structure. * DOC: add regular grid to function docs * ENH: improve multi dim drag implementation to avoid breaking changes * TST: fix tests for new drag implementation * ENH: Let the user solve the csv file error instead of muting the error Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> * MNT: move create_grid function to tools * ENH: copilot suggestion Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * ENH: copilot suggestion Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * ENH: move load_csv to tools * ENH: remove unecessary dicretization * MNT: ruff and pylint * MNT: ruff update * MNT: pylint * ENH: Avoid circular imports * MNT: fix pylint and cyclic imports again * DEV: changelog --------- Co-authored-by: Pedro Bressan <87212571+phmbressan@users.noreply.github.com> Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 8cdb69f commit 0df092d

File tree

22 files changed

+1366
-1310
lines changed

22 files changed

+1366
-1310
lines changed

.pylintrc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,6 @@ recursive=no
9999
# source root.
100100
source-roots=
101101

102-
# When enabled, pylint would attempt to guess common misconfiguration and emit
103-
# user-friendly hints instead of false-positive error messages.
104-
suggestion-mode=yes
105-
106102
# Allow loading of arbitrary C extensions. Extensions are imported into the
107103
# active Python interpreter and may run arbitrary code.
108104
unsafe-load-any-extension=no

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Attention: The newest changes should be on top -->
5050

5151
### Changed
5252

53+
- ENH: Improve multi-variable drag compatibility, regular-grid handling, and related tests/docs [#927](https://github.com/RocketPy-Team/RocketPy/pull/927/changes)
5354
- ENH: replace if elif else chains with match statement [#921](https://github.com/RocketPy-Team/RocketPy/pull/921/changes)
5455
- ENH: Refactor Flight class to improve time node handling and sensor/controllers [#843](https://github.com/RocketPy-Team/RocketPy/pull/843)
5556

docs/user/function.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,13 @@ plotted as follows:
9090

9191
.. important::
9292

93-
The ``Function`` class only supports interpolation ``shepard`` and \
94-
extrapolation ``natural`` for datasets higher than one dimension (more than \
95-
one input).
93+
For datasets higher than one dimension (more than one input), the
94+
``Function`` class supports interpolation ``linear``, ``shepard``, ``rbf``
95+
and ``regular_grid``.
96+
97+
The ``regular_grid`` interpolation requires a complete Cartesian grid and
98+
must be provided as ``(axes, grid_data)``. See the ``Function`` API
99+
documentation for details.
96100

97101
CSV File
98102
^^^^^^^^
@@ -183,7 +187,7 @@ In this section we are going to delve deeper on ``Function`` creation and its pa
183187
- source: the ``Function`` data source. We have explored this parameter in the section above;
184188
- inputs: a list of strings containing each input variable name. If the source only has one input, may be abbreviated as a string (e.g. "speed (m/s)");
185189
- outputs: a list of strings containing each output variable name. If the source only has one output, may be abbreviated as a string (e.g. "total energy (J)");
186-
- interpolation: a string that is the interpolation method to be used if the source is a dataset. Defaults to ``spline``;
190+
- interpolation: a string that is the interpolation method to be used if the source is a dataset. For N-D datasets, supported options are ``linear``, ``shepard``, ``rbf`` and ``regular_grid``. Defaults to ``spline`` for 1-D and ``shepard`` for N-D datasets;
187191
- extrapolation: a string that is the extrapolation method to be used if the source is a dataset. Defaults to ``constant``;
188192
- title: the title to be shown in the plots.
189193

docs/user/rocket/generic_surface.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,16 +243,17 @@ independent variables:
243243
- ``beta``: Side slip angle.
244244
- ``mach``: Mach number.
245245
- ``reynolds``: Reynolds number.
246-
- ``q``: Pitch rate.
247-
- ``r``: Yaw rate.
248-
- ``p``: Roll rate.
246+
- ``pitch_rate``: Pitch rate.
247+
- ``yaw_rate``: Yaw rate.
248+
- ``roll_rate``: Roll rate.
249249

250250
The last column must be the coefficient value, and must contain a header,
251251
though the header name can be anything.
252252

253253
.. important::
254254
Not all columns need to be present in the file, but the columns that are
255-
present must be named, **and ordered**, as described above.
255+
present must be correctly named as described above. Independent variable
256+
columns can be in any order.
256257

257258
An example of a ``.csv`` file is shown below:
258259

0 commit comments

Comments
 (0)