Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5b625a8
MNT: update develop to release v1.10.0 (#822)
Lucas-Prates May 16, 2025
71ed18c
ENH: _MotorPrints inheritance - issue #460 (#828)
Gui-FernandesBR Jun 19, 2025
0f6c701
MNT: fix deprecations and warnings (#829)
Gui-FernandesBR Jun 20, 2025
36190d2
DEV: streamline caching of Python dependencies in GitHub Actions
Gui-FernandesBR Jun 20, 2025
780f724
Merge pull request #832 from RocketPy-Team/dev/fix-pip-cache
Gui-FernandesBR Jun 20, 2025
e428604
ENH: Add the Coriolis Force to the Flight class (#799)
kevin-alcaniz Jul 4, 2025
71e2b3a
MNT: deprecated decorator (#830)
Gui-FernandesBR Jul 4, 2025
2940eaa
DEV: GitHub copilot instructions (#831)
Gui-FernandesBR Jul 16, 2025
75b8e5f
BUG: Fixes StochasticNoseCone powerseries issue #838 (#839)
cazzopardi Jul 25, 2025
2a3e846
ENH: Discretized and No-Pickle Encoding Options (#827)
phmbressan Jul 26, 2025
6648899
Merge branch 'master' into develop
Gui-FernandesBR Jul 26, 2025
80d3d5c
DOC: Add Flight class usage documentation and update index (#841)
Gui-FernandesBR Aug 12, 2025
b0aacdc
ENH: Add Crop and Clip Methods to Function (#817)
Rickisterr Aug 13, 2025
b822b1a
BUG: Fix no time initialization when passing initial_solution as arra…
chasgior214 Sep 2, 2025
fdc547a
DEV: update changelog
MateusStano Sep 2, 2025
7846e5a
EHN: Addition of ensemble variable to ECMWF dictionaries (#842)
LUCKIN13 Sep 3, 2025
0dbc808
ENH: Improve parachute geometric parametrization (#835)
ArthurJWH Sep 15, 2025
f89834b
DOC: Update docs dependencies and sub dependencies (#851)
phmbressan Sep 22, 2025
8c82c3a
ENH: Controller (AirBrakes) and Sensors Encoding (#849)
phmbressan Sep 22, 2025
976617c
ENH: Tank Fluids with Variable Density from Temperature and Pressure …
phmbressan Oct 2, 2025
973398c
mnt/extract flight data exporters (#845)
CameronBrooks11 Oct 8, 2025
34c0273
ENH: Changing ellipses plot axis label (#855)
ArthurJWH Oct 15, 2025
af7bbff
MNT: bumps min python version to 3.10 (#857)
Gui-FernandesBR Oct 19, 2025
1ea18e7
TST: reorganize test files using different folders (#856)
Gui-FernandesBR Oct 24, 2025
20dc3be
Apply suggestion from @Gui-FernandesBR
MateusStano Oct 25, 2025
3313e08
BUG: correct encoding for trapezoidal sweep length and angle. (#861)
phmbressan Oct 27, 2025
8797068
TST: remove remaining files after test session. (#862)
phmbressan Oct 27, 2025
857c4f4
MNT: allow for exporting of non apogee flights. (#863)
phmbressan Oct 28, 2025
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
221 changes: 221 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
# GitHub Copilot Instructions for RocketPy

This file provides instructions for GitHub Copilot when working on the RocketPy codebase.
These guidelines help ensure consistency with the project's coding standards and development practices.

## Project Overview

RocketPy is a Python library for 6-DOF rocket trajectory simulation.
It's designed for high-power rocketry applications with focus on accuracy, performance, and ease of use.

## Coding Standards

### Naming Conventions
- **Use `snake_case` for all new code** - variables, functions, methods, and modules
- **Use descriptive names** - prefer `angle_of_attack` over `a` or `alpha`
- **Class names use PascalCase** - e.g., `SolidMotor`, `Environment`, `Flight`
- **Constants use UPPER_SNAKE_CASE** - e.g., `DEFAULT_GRAVITY`, `EARTH_RADIUS`

### Code Style
- Follow **PEP 8** guidelines
- Line length: **88 characters** (Black's default)
- Organize imports with **isort**
- Our official formatter is the **ruff frmat**

### Documentation
- **All public classes, methods, and functions must have docstrings**
- Use **NumPy style docstrings**
- Include **Parameters**, **Returns**, and **Examples** sections
- Document **units** for physical quantities (e.g., "in meters", "in radians")

### Testing
- Write **unit tests** for all new features using pytest
- Follow **AAA pattern** (Arrange, Act, Assert)
- Use descriptive test names following: `test_methodname_expectedbehaviour`
- Include test docstrings explaining expected behavior
- Use **parameterization** for testing multiple scenarios
- Create pytest fixtures to avoid code repetition

## Domain-Specific Guidelines

### Physical Units and Conventions
- **SI units by default** - meters, kilograms, seconds, radians
- **Document coordinate systems** clearly (e.g., "tail_to_nose", "nozzle_to_combustion_chamber")
- **Position parameters** are critical - always document reference points
- Use **descriptive variable names** for physical quantities

### Rocket Components
- **Motors**: SolidMotor, HybridMotor and LiquidMotor classes are children classes of the Motor class
- **Aerodynamic Surfaces**: They have Drag curves and lift coefficients
- **Parachutes**: Trigger functions, deployment conditions
- **Environment**: Atmospheric models, weather data, wind profiles

### Mathematical Operations
- Use **numpy arrays** for vectorized operations (this improves performance)
- Prefer **scipy functions** for numerical integration and optimization
- **Handle edge cases** in calculations (division by zero, sqrt of negative numbers)
- **Validate input ranges** for physical parameters
- Monte Carlo simulations: sample from `numpy.random` for random number generation and creates several iterations to assess uncertainty in simulations.

## File Structure and Organization

### Source Code Organization

Reminds that `rocketpy` is a Python package served as a library, and its source code is organized into several modules to facilitate maintainability and clarity. The following structure is recommended:

```
rocketpy/
├── core/ # Core simulation classes
├── motors/ # Motor implementations
├── environment/ # Atmospheric and environmental models
├── plots/ # Plotting and visualization
├── tools/ # Utility functions
└── mathutils/ # Mathematical utilities
```

Please refer to popular Python packages like `scipy`, `numpy`, and `matplotlib` for inspiration on module organization.

### Test Organization
```
tests/
├── unit/ # Unit tests
├── integration/ # Integration tests
├── acceptance/ # Acceptance tests
└── fixtures/ # Test fixtures organized by component
```

### Documentation Structure
```
docs/
├── user/ # User guides and tutorials
├── development/ # Development documentation
├── reference/ # API reference
├── examples/ # Flight examples and notebooks
└── technical/ # Technical documentation
```

## Common Patterns and Practices

### Error Handling
- Use **descriptive error messages** with context
- **Validate inputs** at class initialization and method entry
- Raise **appropriate exception types** (ValueError, TypeError, etc.)
- Include **suggestions for fixes** in error messages

### Performance Considerations
- Use **vectorized operations** where possible
- **Cache expensive computations** when appropriate (we frequently use `cached_property`)
- Keep in mind that RocketPy must be fast!

### Backward Compatibility
- **Avoid breaking changes** in public APIs
- Use **deprecation warnings** before removing features
- **Document code changes** in docstrings and CHANGELOG

## AI Assistant Guidelines

### Code Generation
- **Always include docstrings** for new functions and classes
- **Follow existing patterns** in the codebase
- **Consider edge cases** and error conditions

### Code Review and Suggestions
- **Check for consistency** with existing code style
- **Verify physical units** and coordinate systems
- **Ensure proper error handling** and input validation
- **Suggest performance improvements** when applicable
- **Recommend additional tests** for new functionality

### Documentation Assistance
- **Use NumPy docstring format** consistently
- **Include practical examples** in docstrings
- **Document physical meanings** of parameters
- **Cross-reference related functions** and classes

## Testing Guidelines

### Unit Tests
- **Test individual methods** in isolation
- **Use fixtures** from the appropriate test fixture modules
- **Mock external dependencies** when necessary
- **Test both happy path and error conditions**

### Integration Tests
- **Test interactions** between components
- **Verify end-to-end workflows** (Environment → Motor → Rocket → Flight)

### Test Data
- **Use realistic parameters** for rocket simulations
- **Include edge cases** (very small/large rockets, extreme conditions)
- **Test with different coordinate systems** and orientations

## Project-Specific Considerations

### User Experience
- **Provide helpful error messages** with context and suggestions
- **Include examples** in docstrings and documentation
- **Support common use cases** with reasonable defaults

## Examples of Good Practices

### Function Definition
```python
def calculate_drag_force(
velocity,
air_density,
drag_coefficient,
reference_area
):
"""Calculate drag force using the standard drag equation.

Parameters
----------
velocity : float
Velocity magnitude in m/s.
air_density : float
Air density in kg/m³.
drag_coefficient : float
Dimensionless drag coefficient.
reference_area : float
Reference area in m².

Returns
-------
float
Drag force in N.

Examples
--------
>>> drag_force = calculate_drag_force(100, 1.225, 0.5, 0.01)
>>> print(f"Drag force: {drag_force:.2f} N")
"""
if velocity < 0:
raise ValueError("Velocity must be non-negative")
if air_density <= 0:
raise ValueError("Air density must be positive")
if reference_area <= 0:
raise ValueError("Reference area must be positive")

return 0.5 * air_density * velocity**2 * drag_coefficient * reference_area
```

### Test Example
```python
def test_calculate_drag_force_returns_correct_value():
"""Test drag force calculation with known inputs."""
# Arrange
velocity = 100.0 # m/s
air_density = 1.225 # kg/m³
drag_coefficient = 0.5
reference_area = 0.01 # m²
expected_force = 30.625 # N

# Act
result = calculate_drag_force(velocity, air_density, drag_coefficient, reference_area)

# Assert
assert abs(result - expected_force) < 1e-6
```


Remember: RocketPy prioritizes accuracy, performance, and usability. Always consider the physical meaning of calculations and provide clear, well-documented interfaces for users.
2 changes: 1 addition & 1 deletion .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9"]
python-version: ["3.10"]
steps:
- uses: actions/checkout@main
- name: Set up Python ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@main
with:
python-version: "3.9"
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/test-pytest-slow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- cron: "0 17 * * 5" # at 05:00 PM, only on Friday
push:
branches:
- main
- master
paths:
- "**.py"
- ".github/**"
Expand All @@ -21,9 +21,10 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9, 3.13]
python-version: ["3.10", "3.14"]
env:
PYTHON: ${{ matrix.python-version }}
MPLBACKEND: Agg
steps:
- uses: actions/checkout@main
- name: Set up Python
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/test_pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,22 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.9, 3.13]
python-version: ["3.10", "3.14"]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
MPLBACKEND: Agg
steps:
- uses: actions/checkout@main
- name: Set up Python
uses: actions/setup-python@main
with:
python-version: ${{ matrix.python-version }}

- name: Cache Python dependencies
uses: actions/cache@main
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-tests.txt') }}
restore-keys: |
${{ runner.os }}-pip-
cache: 'pip'
cache-dependency-path: |
requirements.txt
requirements-tests.txt
requirements-optional.txt

- name: Install rocketpy
run: pip install .
Expand Down
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ persistent=yes

# Minimum Python version to use for version dependent checks. Will default to
# the version used to run pylint.
py-version=3.9
py-version=3.10

# Discover python modules and packages in the file system subtree.
recursive=no
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
"filt",
"firstsimulation",
"flightcsys",
"flightusage",
"Fluxogram",
"fmax",
"fmin",
Expand Down Expand Up @@ -181,6 +182,7 @@
"Kaleb",
"Karman",
"Krasser",
"Kutta",
"labelrotation",
"linalg",
"Lince",
Expand Down Expand Up @@ -273,6 +275,7 @@
"rtol",
"rtype",
"rucsoundings",
"Runge",
"runslow",
"rwork",
"savetxt",
Expand Down
22 changes: 21 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,38 @@ Attention: The newest changes should be on top -->

### Added

- ENH: Tank Fluids with Variable Density from Temperature and Pressure [#852](https://github.com/RocketPy-Team/RocketPy/pull/852)
- ENH: Controller (AirBrakes) and Sensors Encoding [#849](https://github.com/RocketPy-Team/RocketPy/pull/849)
- EHN: Addition of ensemble variable to ECMWF dictionaries [#842](https://github.com/RocketPy-Team/RocketPy/pull/842)
- ENH: Added Crop and Clip Methods to Function Class [#817](https://github.com/RocketPy-Team/RocketPy/pull/817)
- DOC: Add Flight class usage documentation and update index [#841](https://github.com/RocketPy-Team/RocketPy/pull/841)
- ENH: Discretized and No-Pickle Encoding Options [#827](https://github.com/RocketPy-Team/RocketPy/pull/827)
- ENH: Add the Coriolis Force to the Flight class [#799](https://github.com/RocketPy-Team/RocketPy/pull/799)
- ENH: Improve parachute geometric parametrization [#835](https://github.com/RocketPy-Team/RocketPy/pull/835)
- ENH: Changing ellipses plot axis label [#855](https://github.com/RocketPy-Team/RocketPy/pull/855)

### Changed

- MNT: allow for exporting of non apogee flights. [#863](https://github.com/RocketPy-Team/RocketPy/pull/863)
- TST: remove remaining files after test session. [#862](https://github.com/RocketPy-Team/RocketPy/pull/862)
- MNT: bumps min python version to 3.10 [#857](https://github.com/RocketPy-Team/RocketPy/pull/857)
- DOC: Update docs dependencies and sub dependencies [#851](https://github.com/RocketPy-Team/RocketPy/pull/851)
- MNT: extract flight data exporters [#845](https://github.com/RocketPy-Team/RocketPy/pull/845)
- ENH: _MotorPrints inheritance - issue #460 [#828](https://github.com/RocketPy-Team/RocketPy/pull/828)
- MNT: fix deprecations and warnings [#829](https://github.com/RocketPy-Team/RocketPy/pull/829)

### Fixed

- BUG: correct encoding for trapezoidal sweep length and angle. [#861](https://github.com/RocketPy-Team/RocketPy/pull/861)
- BUG: Fix no time initialization when passing initial_solution as array to Flight object [#844](https://github.com/RocketPy-Team/RocketPy/pull/844)


## [v1.10.0] - 2025-05-16

### Added
- ENH: Support for ND arithmetic in Function class. [#810] (https://github.com/RocketPy-Team/RocketPy/pull/810)
- ENH: allow users to provide custom samplers [#803](https://github.com/RocketPy-Team/RocketPy/pull/803)
- ENH: Implement Multivariate Rejection Sampling (MRS) [#738] (https://github.com/RocketPy-Team/RocketPy/pull/738)
- ENH: Implement Multivariate Rejection Sampling (MRS) [#738] (https://github.com/RocketPy-Team/RocketPy/pull/738)
- ENH: Create a rocketpy file to store flight simulations [#800](https://github.com/RocketPy-Team/RocketPy/pull/800)
- ENH: Support for the RSE file format has been added to the library [#798](https://github.com/RocketPy-Team/RocketPy/pull/798)
- ENH: Introduce Net Thrust with pressure corrections [#789](https://github.com/RocketPy-Team/RocketPy/pull/789)
Expand Down Expand Up @@ -303,6 +322,7 @@ You can install this version by running `pip install rocketpy==1.3.0`

### Fixed

- BUG: Fixes StochasticNoseCone powerseries issue #838 [#839](https://github.com/RocketPy-Team/RocketPy/pull/839)
- MNT: Alter PYPI classifier naming. [#615](https://github.com/RocketPy-Team/RocketPy/pull/615)
- DOC: Solve Dependencies Conflicts and pyproject build [#613](https://github.com/RocketPy-Team/RocketPy/pull/613)
- BUG: Fixes nose cone bluffness issue #610 [#611](https://github.com/RocketPy-Team/RocketPy/pull/611)
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ main = calisto.add_parachute(
sampling_rate=105,
lag=1.5,
noise=(0, 8.3, 0.5),
radius=1.5,
height=1.5,
porosity=0.0432,
)

drogue = calisto.add_parachute(
Expand All @@ -271,6 +274,9 @@ drogue = calisto.add_parachute(
sampling_rate=105,
lag=1.5,
noise=(0, 8.3, 0.5),
radius=1.5,
height=1.5,
porosity=0.0432,
)
```

Expand Down
Loading
Loading