Skip to content

Commit e3c85db

Browse files
committed
Merge remote-tracking branch 'origin/develop' into enh/individual-fins
2 parents 45cebc4 + df52c15 commit e3c85db

186 files changed

Lines changed: 116772 additions & 2790 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
description: "Physics-safe RocketPy code review agent. Use for pull request review, unit consistency checks, coordinate-frame validation, cached-property risk detection, and regression-focused test-gap analysis."
3+
name: "RocketPy Reviewer"
4+
tools: [read, search, execute]
5+
argument-hint: "Review these changes for physics correctness and regression risk: <scope or files>"
6+
user-invocable: true
7+
---
8+
You are a RocketPy-focused reviewer for physics safety and regression risk.
9+
10+
## Goals
11+
12+
- Detect behavioral regressions and numerical/physics risks before merge.
13+
- Validate unit consistency and coordinate/reference-frame correctness.
14+
- Identify stale-cache risks when `@cached_property` interacts with mutable state.
15+
- Check test coverage quality for changed behavior.
16+
- Verify alignment with RocketPy workflow and contributor conventions.
17+
18+
## Review Priorities
19+
20+
1. Correctness and safety issues (highest severity).
21+
2. Behavioral regressions and API compatibility.
22+
3. Numerical stability and tolerance correctness.
23+
4. Missing tests or weak assertions.
24+
5. Documentation mismatches affecting users.
25+
6. Workflow violations (test placement, branch/PR conventions, or missing validation evidence).
26+
27+
## RocketPy-Specific Checks
28+
29+
- SI units are explicit and consistent.
30+
- Orientation conventions are unambiguous (`tail_to_nose`, `nozzle_to_combustion_chamber`, etc.).
31+
- New/changed simulation logic does not silently invalidate cached values.
32+
- Floating-point assertions use `pytest.approx` where needed.
33+
- New fixtures are wired through `tests/conftest.py` when applicable.
34+
- Test type is appropriate for scope (`unit`, `integration`, `acceptance`) and `all_info()`-style tests
35+
are not misclassified.
36+
- New behavior includes at least one regression-oriented test and relevant edge-case checks.
37+
- For docs-affecting changes, references and paths remain valid and build warnings are addressed.
38+
- Tooling recommendations match current repository setup (prefer Makefile plus `pyproject.toml`
39+
settings when docs are outdated).
40+
41+
## Validation Expectations
42+
43+
- Prefer focused test runs first, then broader relevant suites.
44+
- Recommend `make format` and `make lint` when style/lint risks are present.
45+
- Recommend `make build-docs` when `.rst` files or API docs are changed.
46+
47+
## Output Format
48+
49+
Provide findings first, ordered by severity.
50+
For each finding include:
51+
- Severity: Critical, High, Medium, or Low
52+
- Location: file path and line
53+
- Why it matters: behavioral or physics risk
54+
- Suggested fix: concrete, minimal change
55+
56+
After findings, include:
57+
- Open questions or assumptions
58+
- Residual risks or testing gaps
59+
- Brief change summary
60+
- Suggested validation commands (only when useful)
61+
62+
If no findings are identified, state that explicitly and still report residual risks/testing gaps.

.github/copilot-instructions.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# RocketPy Workspace Instructions
2+
3+
## Code Style
4+
- Use snake_case for variables, functions, methods, and modules. Use descriptive names.
5+
- Use PascalCase for classes and UPPER_SNAKE_CASE for constants.
6+
- Keep lines at 88 characters and follow PEP 8 unless existing code in the target file differs.
7+
- Run Ruff as the source of truth for formatting/import organization:
8+
- `make format`
9+
- `make lint`
10+
- Use NumPy-style docstrings for public classes, methods, and functions, including units.
11+
- In case of tooling drift between docs and config, prefer current repository tooling in `Makefile`
12+
and `pyproject.toml`.
13+
14+
## Architecture
15+
- RocketPy is a modular Python library; keep feature logic in the correct package boundary:
16+
- `rocketpy/simulation`: flight simulation and Monte Carlo orchestration.
17+
- `rocketpy/rocket`, `rocketpy/motors`, `rocketpy/environment`: domain models.
18+
- `rocketpy/mathutils`: numerical primitives and interpolation utilities.
19+
- `rocketpy/plots`, `rocketpy/prints`: output and visualization layers.
20+
- Prefer extending existing classes/patterns over introducing new top-level abstractions.
21+
- Preserve public API stability in `rocketpy/__init__.py` exports.
22+
23+
## Build and Test
24+
- Use Makefile targets for OS-agnostic workflows:
25+
- `make install`
26+
- `make pytest`
27+
- `make pytest-slow`
28+
- `make coverage`
29+
- `make coverage-report`
30+
- `make build-docs`
31+
- Before finishing code changes, run focused tests first, then broader relevant suites.
32+
- When running Python directly in this workspace, prefer `.venv/Scripts/python.exe`.
33+
- Slow tests are explicitly marked with `@pytest.mark.slow` and are run with `make pytest-slow`.
34+
- For docs changes, check `make build-docs` output and resolve warnings/errors when practical.
35+
36+
## Development Workflow
37+
- Target pull requests to `develop` by default; `master` is the stable branch.
38+
- Use branch names in `type/description` format, such as:
39+
- `bug/<description>`
40+
- `doc/<description>`
41+
- `enh/<description>`
42+
- `mnt/<description>`
43+
- `tst/<description>`
44+
- Prefer rebasing feature branches on top of `develop` to keep history linear.
45+
- Keep commit and PR titles explicit and prefixed with project acronyms when possible:
46+
- `BUG`, `DOC`, `ENH`, `MNT`, `TST`, `BLD`, `REL`, `REV`, `STY`, `DEV`.
47+
48+
## Conventions
49+
- SI units are the default. Document units and coordinate-system references explicitly.
50+
- Position/reference-frame arguments are critical in this codebase. Be explicit about orientation
51+
(for example, `tail_to_nose`, `nozzle_to_combustion_chamber`).
52+
- Include unit tests for new behavior. Follow AAA structure and clear test names.
53+
- Use fixtures from `tests/fixtures`; if adding a new fixture module, update `tests/conftest.py`.
54+
- Use `pytest.approx` for floating-point checks where appropriate.
55+
- Use `@cached_property` for expensive computations when helpful, and be careful with stale-cache
56+
behavior when underlying mutable state changes.
57+
- Keep behavior backward compatible across the public API exported via `rocketpy/__init__.py`.
58+
- Prefer extending existing module patterns over creating new top-level package structure.
59+
60+
## Testing Taxonomy
61+
- Unit tests are mandatory for new behavior.
62+
- Unit tests in RocketPy can be sociable (real collaborators allowed) but should still be fast and
63+
method-focused.
64+
- Treat tests as integration tests when they are strongly I/O-oriented or broad across many methods,
65+
including `all_info()` convention cases.
66+
- Acceptance tests represent realistic user/flight scenarios and may compare simulation thresholds to
67+
known flight data.
68+
69+
## Documentation Links
70+
- Contributor workflow and setup: `docs/development/setting_up.rst`
71+
- Style and naming details: `docs/development/style_guide.rst`
72+
- Testing philosophy and structure: `docs/development/testing.rst`
73+
- API reference conventions: `docs/reference/index.rst`
74+
- Domain/physics background: `docs/technical/index.rst`
75+
76+
## Scoped Customizations
77+
- Simulation-specific rules: `.github/instructions/simulation-safety.instructions.md`
78+
- Test-authoring rules: `.github/instructions/tests-python.instructions.md`
79+
- RST/Sphinx documentation rules: `.github/instructions/sphinx-docs.instructions.md`
80+
- Specialized review persona: `.github/agents/rocketpy-reviewer.agent.md`
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
description: "Use when editing rocketpy/simulation code, including Flight state updates, Monte Carlo orchestration, post-processing, or cached computations. Covers simulation state safety, unit/reference-frame clarity, and regression checks."
3+
name: "Simulation Safety"
4+
applyTo: "rocketpy/simulation/**/*.py"
5+
---
6+
# Simulation Safety Guidelines
7+
8+
- Keep simulation logic inside `rocketpy/simulation` and avoid leaking domain behavior that belongs in
9+
`rocketpy/rocket`, `rocketpy/motors`, or `rocketpy/environment`.
10+
- Preserve public API behavior and exported names used by `rocketpy/__init__.py`.
11+
- Prefer extending existing simulation components before creating new abstractions:
12+
- `flight.py`: simulation state, integration flow, and post-processing.
13+
- `monte_carlo.py`: orchestration and statistical execution workflows.
14+
- `flight_data_exporter.py` and `flight_data_importer.py`: persistence and interchange.
15+
- `flight_comparator.py`: comparative analysis outputs.
16+
- Be explicit with physical units and reference frames in new parameters, attributes, and docstrings.
17+
- For position/orientation-sensitive behavior, use explicit conventions (for example
18+
`tail_to_nose`, `nozzle_to_combustion_chamber`) and avoid implicit assumptions.
19+
- Treat state mutation carefully when cached values exist.
20+
- If changes can invalidate `@cached_property` values, either avoid post-computation mutation or
21+
explicitly invalidate affected caches in a controlled, documented way.
22+
- Keep numerical behavior deterministic unless stochastic behavior is intentional and documented.
23+
- For Monte Carlo and stochastic code paths, make randomness controllable and reproducible when tests
24+
rely on it.
25+
- Prefer vectorized NumPy operations for hot paths and avoid introducing Python loops in
26+
performance-critical sections without justification.
27+
- Guard against numerical edge cases (zero/near-zero denominators, interpolation limits, and boundary
28+
conditions).
29+
- Do not change default numerical tolerances or integration behavior without documenting motivation and
30+
validating regression impact.
31+
- Add focused regression tests for changed behavior, including edge cases and orientation-dependent
32+
behavior.
33+
- For floating-point expectations, use `pytest.approx` with meaningful tolerances.
34+
- Run focused tests first, then broader relevant tests (`make pytest` and `make pytest-slow` when
35+
applicable).
36+
37+
See:
38+
- `docs/development/testing.rst`
39+
- `docs/development/style_guide.rst`
40+
- `docs/development/setting_up.rst`
41+
- `docs/technical/index.rst`
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
description: "Use when writing or editing docs/**/*.rst. Covers Sphinx/reStructuredText conventions, cross-references, toctree hygiene, and RocketPy unit/reference-frame documentation requirements."
3+
name: "Sphinx RST Conventions"
4+
applyTo: "docs/**/*.rst"
5+
---
6+
# Sphinx and RST Guidelines
7+
8+
- Follow existing heading hierarchy and style in the target document.
9+
- Prefer linking to existing documentation pages instead of duplicating content.
10+
- Use Sphinx cross-references where appropriate (`:class:`, `:func:`, `:mod:`, `:doc:`, `:ref:`).
11+
- Keep API names and module paths consistent with current code exports.
12+
- Document physical units and coordinate/reference-frame conventions explicitly.
13+
- Include concise, practical examples when introducing new user-facing behavior.
14+
- Keep prose clear and technical; avoid marketing language in development/reference docs.
15+
- When adding a new page, update the relevant `toctree` so it appears in navigation.
16+
- Use RocketPy docs build workflow:
17+
- `make build-docs` from repository root for normal validation.
18+
- If stale artifacts appear, clean docs build outputs via `cd docs && make clean`, then rebuild.
19+
- Treat new Sphinx warnings/errors as issues to fix or explicitly call out in review notes.
20+
- Keep `docs/index.rst` section structure coherent with user, development, reference, technical, and
21+
examples navigation.
22+
- Do not edit Sphinx-generated scaffolding files unless explicitly requested:
23+
- `docs/Makefile`
24+
- `docs/make.bat`
25+
- For API docs, ensure references remain aligned with exported/public objects and current module paths.
26+
27+
See:
28+
- `docs/index.rst`
29+
- `docs/development/build_docs.rst`
30+
- `docs/development/style_guide.rst`
31+
- `docs/reference/index.rst`
32+
- `docs/technical/index.rst`
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
description: "Use when creating or editing pytest files in tests/. Enforces AAA structure, naming conventions, fixture usage, parameterization, slow-test marking, and numerical assertion practices for RocketPy."
3+
name: "RocketPy Pytest Standards"
4+
applyTo: "tests/**/*.py"
5+
---
6+
# RocketPy Test Authoring Guidelines
7+
8+
- Unit tests are mandatory for new behavior.
9+
- Follow AAA structure in each test: Arrange, Act, Assert.
10+
- Use descriptive test names matching project convention:
11+
- `test_methodname`
12+
- `test_methodname_stateundertest`
13+
- `test_methodname_expectedbehaviour`
14+
- Include docstrings that clearly state expected behavior and context.
15+
- Prefer parameterization for scenario matrices instead of duplicated tests.
16+
- Classify tests correctly:
17+
- `tests/unit`: fast, method-focused tests (sociable unit tests are acceptable in RocketPy).
18+
- `tests/integration`: broad multi-method/component interactions and strongly I/O-oriented cases.
19+
- `tests/acceptance`: realistic end-user/flight scenarios with threshold-based expectations.
20+
- By RocketPy convention, tests centered on `all_info()` behavior are integration tests.
21+
- Reuse fixtures from `tests/fixtures` whenever possible.
22+
- Keep fixture organization aligned with existing categories under `tests/fixtures`
23+
(environment, flight, motor, rockets, surfaces, units, etc.).
24+
- If you add a new fixture module, update `tests/conftest.py` so fixtures are discoverable.
25+
- Keep tests deterministic: set seeds when randomness is involved and avoid unstable external
26+
dependencies unless integration behavior explicitly requires them.
27+
- Use `pytest.approx` for floating-point comparisons with realistic tolerances.
28+
- Mark expensive tests with `@pytest.mark.slow` and ensure they can run under the project slow-test
29+
workflow.
30+
- Include at least one negative or edge-case assertion for new behaviors.
31+
- When adding a bug fix, include a regression test that fails before the fix and passes after it.
32+
33+
See:
34+
- `docs/development/testing.rst`
35+
- `docs/development/style_guide.rst`
36+
- `docs/development/setting_up.rst`

.github/workflows/linters.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
19-
python-version: ["3.9"]
19+
python-version: ["3.10"]
2020
steps:
2121
- uses: actions/checkout@main
2222
- name: Set up Python ${{ matrix.python-version }}

.github/workflows/publish-to-pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Set up Python
2020
uses: actions/setup-python@main
2121
with:
22-
python-version: "3.9"
22+
python-version: "3.10"
2323
- name: Install dependencies
2424
run: |
2525
python -m pip install --upgrade pip

.github/workflows/test-pytest-slow.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
- cron: "0 17 * * 5" # at 05:00 PM, only on Friday
66
push:
77
branches:
8-
- main
8+
- master
99
paths:
1010
- "**.py"
1111
- ".github/**"
@@ -21,9 +21,10 @@ jobs:
2121
runs-on: ubuntu-latest
2222
strategy:
2323
matrix:
24-
python-version: [3.9, 3.13]
24+
python-version: ["3.10", "3.14"]
2525
env:
2626
PYTHON: ${{ matrix.python-version }}
27+
MPLBACKEND: Agg
2728
steps:
2829
- uses: actions/checkout@main
2930
- name: Set up Python

.github/workflows/test_pytest.yaml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,22 @@ jobs:
1919
strategy:
2020
matrix:
2121
os: [ubuntu-latest, macos-latest, windows-latest]
22-
python-version: [3.9, 3.13]
22+
python-version: ["3.10", "3.14"]
2323
env:
2424
OS: ${{ matrix.os }}
2525
PYTHON: ${{ matrix.python-version }}
26+
MPLBACKEND: Agg
2627
steps:
2728
- uses: actions/checkout@main
2829
- name: Set up Python
2930
uses: actions/setup-python@main
3031
with:
3132
python-version: ${{ matrix.python-version }}
32-
33-
- name: Cache Python dependencies
34-
uses: actions/cache@main
35-
with:
36-
path: ~/.cache/pip
37-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-tests.txt') }}
38-
restore-keys: |
39-
${{ runner.os }}-pip-
33+
cache: 'pip'
34+
cache-dependency-path: |
35+
requirements.txt
36+
requirements-tests.txt
37+
requirements-optional.txt
4038
4139
- name: Install rocketpy
4240
run: pip install .

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ cython_debug/
162162
# Docs
163163
*.docx
164164
*.pdf
165+
docs/*.gif
165166

166167
# PyCharm
167168
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can

0 commit comments

Comments
 (0)