Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -973,13 +973,7 @@
"- `\"terrain\"` - uses Esri.WorldTopoMap for terrain maps\n",
"- Any contextily provider name (e.g., `\"CartoDB.Positron\"`)\n",
"\n",
"Note that if both `image` and `background` parameters are provided, the `image` parameter takes precedence. The background map is automatically downloaded based on the environment's latitude and longitude coordinates.\n",
"\n",
"> **Note on Python 3.14 Support:**\n",
"> Currently, the `background` feature is automatically enabled only for **Python 3.13 and lower**.\n",
"> This is due to the lack of pre-built binary wheels for `rasterio` (a core dependency) on Python 3.14 (see [rasterio issue #3419](https://github.com/rasterio/rasterio/issues/3419)).\n",
">\n",
"> **Advanced Users:** If you are using Python 3.14 and are comfortable compiling C-extensions from source (e.g., setting up a GDAL environment), you can manually install `contextily`. Once installed, this feature will become available."
"Note that if both `image` and `background` parameters are provided, the `image` parameter takes precedence. The background map is automatically downloaded based on the environment's latitude and longitude coordinates."
]
},
{
Expand Down
3 changes: 1 addition & 2 deletions docs/technical/tip_off.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ instantaneous center of mass gives
- \mathbf{r}_{CM}\mathbf{r}_{CM}^{\mathsf T}\right).

The rail is a line fixed in the inertial frame, set by the launch inclination
and heading. Its unit vector is the ``attitude_unit`` attribute of
:class:`rocketpy.Flight`. The constrained body point is the lower rail button,
and heading. The constrained body point is the lower rail button,
at the fixed body position :math:`\mathbf{r}_{B}` relative to the CDM.

The constraint
Expand Down
22 changes: 11 additions & 11 deletions docs/user/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,15 @@ Required Packages

The following packages are needed in order to run RocketPy:

- requests
- Numpy >= 1.13
- Scipy >= 1.0
- Matplotlib >= 3.0
- Numpy >= 1.23
- Scipy >= 1.8
- Matplotlib >= 3.9
- netCDF4 >= 1.6.4
- windrose >= 1.6.8
- requests
- pytz
- simplekml
- platformdirs
- simplekml
- dill

All of these packages, are automatically installed when RocketPy is installed using either ``pip`` or ``conda``.
However, in case the user wants to install these packages manually, they can do so by following the instructions bellow.
Expand All @@ -115,14 +114,15 @@ The packages needed can be installed via ``pip`` by running the following lines

.. code-block:: shell

pip install "numpy>=1.13"
pip install "scipy>=1.0"
pip install "matplotlib>=3.0"
pip install "numpy>=1.23"
pip install "scipy>=1.8"
pip install "matplotlib>=3.9"
pip install "netCDF4>=1.6.4"
pip install requests
pip install pytz
pip install simplekml
pip install platformdirs
pip install simplekml
pip install dill

Installing Required Packages Using ``conda``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -133,7 +133,7 @@ To update Scipy and install netCDF4 using Conda, the following code is used:

.. code-block:: shell

conda install "scipy>=1.0"
conda install "scipy>=1.8"
conda install -c anaconda "netcdf4>=1.6.4"


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ monte-carlo = [
"multiprocess>=0.70",
"statsmodels",
"prettytable",
"contextily>=1.0.0; python_version < '3.14'",
"contextily>=1.0.0",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit (optional): Dropping the python_version < '3.14' marker turns the background map on for Python 3.14, but CHANGELOG.md has no entry for it. I checked that rasterio ships cp314 wheels and that CI already runs 3.14, so no packaging change is needed. Fix: add a changelog line for the 3.14 support of contextily.

Scenario: users on 3.14 who read the old notebook note (now removed) or the changelog have no record of when the feature became available.

]

animation = [
Expand Down
2 changes: 1 addition & 1 deletion requirements-optional.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ imageio
multiprocess>=0.70
statsmodels
prettytable
contextily>=1.0.0; python_version < '3.14'
contextily>=1.0.0
pyvista>=0.45
imageio-ffmpeg>=0.5
folium>=0.14
33 changes: 4 additions & 29 deletions rocketpy/rocket/parachute.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,6 @@
from ..prints.parachute_prints import _ParachutePrints


def _is_a_height_trigger(trigger):
"""Whether ``trigger`` is a number this class will read as a height.

``numbers.Real`` rather than ``(int, float)`` so that NumPy scalars are
accepted: ``numpy.float64`` happens to subclass ``float``, but
``numpy.int64`` and ``numpy.float32`` subclass neither and were refused
even though every arithmetic use of them here works.

What that spelling leaves out is what should be left out. ``numpy.bool_``
and the complex types are not ``Real``, so they still fall through to the
error. ``bool`` is excluded by hand because it *is* an ``int``, and ``True``
would otherwise be taken as a height of one metre.

This is the single definition of the numeric boundary. The height form and
the delay of a ``("time", t_deploy)`` trigger both use it, and
``StochasticParachute`` validates the same triggers before a ``Parachute``
is ever built and calls this rather than restating it, because the two
spellings drifted apart once already.
"""
return isinstance(trigger, Real) and not isinstance(trigger, bool)


class Parachute:
"""Keeps information of the parachute, which is modeled as a hemispheroid.

Expand Down Expand Up @@ -409,8 +387,8 @@ def wrapper(p, h, y, sensors, u_dot):
self.triggerfunc = _make_wrapper(trigger)
return

# Numeric altitude trigger
if _is_a_height_trigger(trigger):
# Numeric altitude trigger. Real accepts NumPy numbers, bool is an int
if isinstance(trigger, Real) and not isinstance(trigger, bool):
self._trigger_falling_only = True

def triggerfunc(p, h, y, sensors, u_dot): # pylint: disable=unused-argument
Expand Down Expand Up @@ -442,11 +420,8 @@ def triggerfunc(p, h, y, sensors, u_dot): # pylint: disable=unused-argument
and isinstance(trigger[0], str)
and trigger[0].lower() == "time"
):
# Same numeric boundary as a height, so the two forms cannot
# disagree about what counts as a number. Notably this refuses a
# string delay rather than quietly coercing it: float("3.0") would
# otherwise make ("time", "3.0") work by accident.
if not _is_a_height_trigger(trigger[1]):
# A number, as for a height. A string delay is refused, not converted.
if not isinstance(trigger[1], Real) or isinstance(trigger[1], bool):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit (optional): The numeric test is now written twice with opposite polarity (isinstance(x, Real) and not isinstance(x, bool) for the height, its negation here for the delay) after the shared helper was removed; the helper's docstring said the two forms had already drifted apart once. Fix: keep a one-line private helper, or reuse one expression for both branches.

Scenario: someone widens one site (for example to accept another numeric type) and ("time", x) and a bare height disagree again.

raise ValueError(
f"Unable to set the trigger function for parachute '{self.name}'. "
+ "Time trigger delay must be a positive number of seconds, "
Expand Down
18 changes: 0 additions & 18 deletions rocketpy/rocket/rocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,19 +763,6 @@ def static_margin(self):
self.evaluate_static_margin()
return self._static_margin

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important: Removing the static_margin setter makes rocket.static_margin = ... raise AttributeError in 1.14.0, although it worked as a plain attribute in 1.13.0 and #1225 restored it (with a DeprecationWarning) for exactly that reason. CHANGELOG.md line 87 still says the assignment is accepted again, and no entry announces the removal. Fix: keep the deprecated setter for one more release, or, if the removal is intended, drop the #1225 line and add a breaking "Removed" entry.

Scenario: a script that does rocket.static_margin = Function(...) runs on 1.13.0 and fails on 1.14.0 with property 'static_margin' of 'Rocket' object has no setter, with no deprecation period.


@static_margin.setter
@deprecated(
reason=(
"Assigning `static_margin` is deprecated and will be removed in a "
"future version, because the static margin is computed from the "
"rocket's geometry"
)
)
def static_margin(self, value):
# Kept until the next geometry/mass/surface change marks it dirty.
self._static_margin = value
self._static_margin_dirty = False

def evaluate_static_margin(self):
"""Calculates the static margin of the rocket as a function of time.

Expand All @@ -786,11 +773,6 @@ def evaluate_static_margin(self):
Static margin is defined as the distance between the center of
pressure and the center of mass, divided by the rocket's diameter.
"""
# An assigned non-Function value (e.g. a float) cannot be updated in place.
if not isinstance(self._static_margin, Function):
self._static_margin = Function(
lambda time: 0, inputs="Time (s)", outputs="Static Margin (c)"
)
# Calculate static margin; fold _csys into the source so we do not
# rebind a property when multiplying.
self._static_margin.set_source(
Expand Down
16 changes: 7 additions & 9 deletions rocketpy/sensors/accelerometer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from ..mathutils.vector_matrix import Matrix, Vector
from ..prints.sensors_prints import _InertialSensorPrints
from ..sensors.sensor import InertialSensor, SeedLike
from ..sensors.sensor import InertialSensor

# pylint: disable=too-many-arguments

Expand Down Expand Up @@ -79,7 +79,7 @@ def __init__(
cross_axis_sensitivity=0,
consider_gravity=False,
name="Accelerometer",
seed: SeedLike | None = None,
seed=None,
):
"""
Initialize the accelerometer sensor
Expand Down Expand Up @@ -174,14 +174,12 @@ def __init__(
which is zero at rest. Default is False.
name : str, optional
The name of the sensor. Default is "Accelerometer".
seed : int, array_like of ints, numpy.random.SeedSequence, optional
seed : int, list of ints or numpy.random.SeedSequence, optional
Seed for the random number generator that draws the measurement
noise. If given, the noise becomes reproducible and independent of
the process-global NumPy RNG. Only seeds that describe a stream are
taken: live ``Generator``, ``BitGenerator`` and ``RandomState``
objects are rejected, because their state advances as noise is
drawn and so cannot be represented in ``to_dict()``. Default is
None, meaning the noise is seeded from fresh entropy per instance.
noise. If given, the noise is reproducible. Random generator
objects (``numpy.random.Generator``, ``BitGenerator`` or
``RandomState``) are not accepted, because they cannot be saved.
Default is None, meaning the noise is drawn from a new random seed.

Returns
-------
Expand Down
16 changes: 7 additions & 9 deletions rocketpy/sensors/barometer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from ..mathutils.vector_matrix import Matrix
from ..prints.sensors_prints import _SensorPrints
from ..sensors.sensor import ScalarSensor, SeedLike
from ..sensors.sensor import ScalarSensor


class Barometer(ScalarSensor):
Expand Down Expand Up @@ -62,7 +62,7 @@ def __init__(
temperature_bias=0,
temperature_scale_factor=0,
name="Barometer",
seed: SeedLike | None = None,
seed=None,
):
"""
Initialize the barometer sensor
Expand Down Expand Up @@ -111,14 +111,12 @@ def __init__(
meaning no temperature scale factor is applied.
name : str, optional
The name of the sensor. Default is "Barometer".
seed : int, array_like of ints, numpy.random.SeedSequence, optional
seed : int, list of ints or numpy.random.SeedSequence, optional
Seed for the random number generator that draws the measurement
noise. If given, the noise becomes reproducible and independent of
the process-global NumPy RNG. Only seeds that describe a stream are
taken: live ``Generator``, ``BitGenerator`` and ``RandomState``
objects are rejected, because their state advances as noise is
drawn and so cannot be represented in ``to_dict()``. Default is
None, meaning the noise is seeded from fresh entropy per instance.
noise. If given, the noise is reproducible. Random generator
objects (``numpy.random.Generator``, ``BitGenerator`` or
``RandomState``) are not accepted, because they cannot be saved.
Default is None, meaning the noise is drawn from a new random seed.

Returns
-------
Expand Down
16 changes: 7 additions & 9 deletions rocketpy/sensors/gnss_receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from ..mathutils.vector_matrix import Matrix, Vector
from ..prints.sensors_prints import _GnssReceiverPrints
from .sensor import ScalarSensor, SeedLike
from .sensor import ScalarSensor


class GnssReceiver(ScalarSensor):
Expand Down Expand Up @@ -38,7 +38,7 @@ def __init__(
position_accuracy=0,
altitude_accuracy=0,
name="GnssReceiver",
seed: SeedLike | None = None,
seed=None,
):
"""Initialize the Gnss Receiver sensor.

Expand All @@ -54,14 +54,12 @@ def __init__(
position in meters. Default is 0.
name : str
The name of the sensor. Default is "GnssReceiver".
seed : int, array_like of ints, numpy.random.SeedSequence, optional
seed : int, list of ints or numpy.random.SeedSequence, optional
Seed for the random number generator that draws the measurement
noise. If given, the noise becomes reproducible and independent of
the process-global NumPy RNG. Only seeds that describe a stream are
taken: live ``Generator``, ``BitGenerator`` and ``RandomState``
objects are rejected, because their state advances as noise is
drawn and so cannot be represented in ``to_dict()``. Default is
None, meaning the noise is seeded from fresh entropy per instance.
noise. If given, the noise is reproducible. Random generator
objects (``numpy.random.Generator``, ``BitGenerator`` or
``RandomState``) are not accepted, because they cannot be saved.
Default is None, meaning the noise is drawn from a new random seed.
"""
super().__init__(sampling_rate=sampling_rate, name=name, seed=seed)
self.position_accuracy = position_accuracy
Expand Down
16 changes: 7 additions & 9 deletions rocketpy/sensors/gyroscope.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from ..mathutils.vector_matrix import Vector
from ..prints.sensors_prints import _GyroscopePrints
from ..sensors.sensor import InertialSensor, SeedLike
from ..sensors.sensor import InertialSensor

# pylint: disable=too-many-arguments

Expand Down Expand Up @@ -78,7 +78,7 @@ def __init__(
cross_axis_sensitivity=0,
acceleration_sensitivity=0,
name="Gyroscope",
seed: SeedLike | None = None,
seed=None,
):
"""
Initialize the gyroscope sensor
Expand Down Expand Up @@ -172,14 +172,12 @@ def __init__(
length 3.
name : str, optional
The name of the sensor. Default is "Gyroscope".
seed : int, array_like of ints, numpy.random.SeedSequence, optional
seed : int, list of ints or numpy.random.SeedSequence, optional
Seed for the random number generator that draws the measurement
noise. If given, the noise becomes reproducible and independent of
the process-global NumPy RNG. Only seeds that describe a stream are
taken: live ``Generator``, ``BitGenerator`` and ``RandomState``
objects are rejected, because their state advances as noise is
drawn and so cannot be represented in ``to_dict()``. Default is
None, meaning the noise is seeded from fresh entropy per instance.
noise. If given, the noise is reproducible. Random generator
objects (``numpy.random.Generator``, ``BitGenerator`` or
``RandomState``) are not accepted, because they cannot be saved.
Default is None, meaning the noise is drawn from a new random seed.

Returns
-------
Expand Down
Loading
Loading