Skip to content

Commit 848d426

Browse files
MateusStanoclaude
andcommitted
DOC: describe what each parameter is, not what other code does with it
Several parameter and attribute descriptions explained saving and loading, post-processing or which method fills a value in, instead of what the value is. Keep them to the value itself. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 44e188f commit 848d426

4 files changed

Lines changed: 14 additions & 21 deletions

File tree

‎rocketpy/simulation/events/event.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def __init__( # pylint: disable=too-many-arguments
107107
``context["event"].memory``. Useful for counters, thresholds and
108108
data shared between trigger and callback. It is restored to the
109109
values given here when the event is reset for a new flight.
110-
Defaults to an empty dict. Not persisted to output logs or files.
110+
Defaults to an empty dict.
111111
disable_on : str or int or float or callable, optional
112112
Condition that automatically disables the event. May be a string
113113
preset (``"apogee"`` or ``"burnout"``), a simulation time in seconds

‎rocketpy/simulation/helpers/dynamics.py‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,12 @@ def __init__( # pylint: disable=too-many-arguments
8181
Parameters
8282
----------
8383
name : str
84-
Name of this kind of phase, such as ``"parachute"``. It is written
85-
out with the phase when a flight is saved.
84+
Name of this kind of phase, such as ``"parachute"``.
8685
derivative : callable or None
8786
The function ``f(flight, t, u)`` giving the time derivative of each
8887
state in ``states``, in that same order. ``u`` is the phase's own
89-
state. ``None`` for a phase read back from a saved flight: its
90-
stored states can still be read by name, but it cannot be flown or
91-
post-processed again, since a derivative is code and is not saved.
88+
state. With ``None`` the phase's states can still be read by name,
89+
but the phase cannot be flown or post-processed.
9290
9391
A phase that reports post-process variables writes
9492
``f(flight, t, u, post_processing=False)`` instead, and when the

‎rocketpy/simulation/helpers/flight_phase.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ class _FlightPhase:
335335
name : str, optional
336336
Descriptive label for logging and debug output.
337337
time_bound : float, optional
338-
Upper time boundary of this phase (managed by _FlightPhases).
338+
Upper time boundary of this phase.
339339
"""
340340

341341
def __init__(

‎rocketpy/simulation/solution.py‎

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,8 @@ class _PhaseSolution:
6666
The equations of motion this phase was flown with, describing which
6767
states it integrates and how the rest are rebuilt.
6868
bound_dynamics : _BoundDynamics or None
69-
The same dynamics tied to a live flight, which is what post-processing
70-
needs. ``None`` for a phase read back from a saved file, since binding
71-
requires a running simulation.
69+
The same dynamics bound to a flight, which lets the phase be
70+
post-processed. ``None`` if the phase was given unbound dynamics.
7271
start_canonical : tuple of float or None
7372
The 13-value canonical state at the moment the phase began. Supplies
7473
every canonical state this phase does not integrate. ``None`` only for
@@ -100,9 +99,8 @@ def __init__(self, dynamics, start_canonical, t_start=None, name=None, start=0):
10099
----------
101100
dynamics : _PhaseDynamics or _BoundDynamics
102101
The dynamics this phase was flown with, describing the states it
103-
integrates. Pass the flight-bound one during a simulation, so the
104-
phase can be post-processed afterwards; a solution loaded from a
105-
file passes the plain one, since binding requires a live flight.
102+
integrates. Dynamics bound to a flight also let the phase be
103+
post-processed.
106104
start_canonical : sequence of float or None
107105
The full 13-value canonical state at the start of the phase. It
108106
supplies every canonical state this phase does not integrate,
@@ -115,7 +113,7 @@ def __init__(self, dynamics, start_canonical, t_start=None, name=None, start=0):
115113
``None``.
116114
start : int, optional
117115
Position of this phase's first row in the solution's row list.
118-
Default is ``0``. :meth:`Solution._start_phase` fills this in.
116+
Default is ``0``.
119117
120118
Raises
121119
------
@@ -309,8 +307,7 @@ def __init__(self, phases=None, rows=None):
309307
----------
310308
phases : sequence of _PhaseSolution, optional
311309
Pre-built phases, in flight order, each with its ``start`` already
312-
set. A new flight starts empty and adds one as each of its flight
313-
phases begins. Default is ``None``, an empty solution.
310+
set. Default is ``None``, an empty solution.
314311
rows : sequence of sequence of float, optional
315312
The flight's rows, each ``[t, *state]``, in flight order. Default
316313
is ``None``, no rows.
@@ -411,9 +408,8 @@ def _start_phase(self, dynamics, start_canonical, t_start=None, name=None):
411408
----------
412409
dynamics : _PhaseDynamics or _BoundDynamics
413410
The dynamics the new phase is flown with, describing the states it
414-
integrates. Pass the flight-bound one during a simulation, so the
415-
phase can be post-processed afterwards; a solution loaded from a
416-
file passes the plain one, since binding requires a live flight.
411+
integrates. Dynamics bound to a flight also let the phase be
412+
post-processed.
417413
start_canonical : sequence of float or None
418414
The full 13-value canonical state at the start of the phase. It
419415
supplies every canonical state the phase does not integrate, which
@@ -1280,8 +1276,7 @@ def __init__(self, solution):
12801276
Parameters
12811277
----------
12821278
solution : Solution
1283-
The flight whose post-process variables this reads. A ``Solution``
1284-
builds its own, so there is rarely a reason to build one by hand.
1279+
The flight whose post-process variables this reads.
12851280
"""
12861281
self._solution = solution
12871282
self._tables = None

0 commit comments

Comments
 (0)