Skip to content
Merged
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
9 changes: 6 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: Documentation

on:
# Only PRs targeting master (base branch = master) and pushes to master.
# develop as well as master. Work lands on develop first, so a base of master
# alone meant the only run was the release pull request: a docstring that does
# not build sat on develop until then and failed the merge that was supposed
# to ship it, which is how the four warnings this fixes went unnoticed.
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches: [master]
branches: [master, develop]
paths:
- "docs/**"
- "rocketpy/**" # docstrings feed the autodoc API reference
Expand All @@ -13,7 +16,7 @@ on:
- ".readthedocs.yaml"
- ".github/workflows/docs.yml"
push:
branches: [master]
branches: [master, develop]
paths:
- "docs/**"
- "rocketpy/**"
Expand Down
29 changes: 22 additions & 7 deletions .github/workflows/test_pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,26 +61,41 @@ jobs:
run: pytest tests/integration --cov=rocketpy --cov-append

- name: Run Acceptance Tests
run: pytest tests/acceptance --cov=rocketpy --cov-append --cov-report=xml
run: pytest tests/acceptance --cov=rocketpy --cov-append --cov-report=xml:coverage-${{ matrix.os }}-${{ matrix.python-version }}.xml

- name: Upload coverage to artifacts
uses: actions/upload-artifact@main
with:
name: coverage
path: coverage.xml
overwrite: true
# One name per leg. Six legs sharing a name with overwrite deleted each
# other's artifact rather than merging, so five reports were discarded
# and the surviving one was whichever leg happened to finish last.
name: coverage-${{ matrix.os }}-${{ matrix.python-version }}
path: coverage-${{ matrix.os }}-${{ matrix.python-version }}.xml
if-no-files-found: error

CodecovUpload:
needs: Pytest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Download latest coverage report
- name: Download every coverage report
uses: actions/download-artifact@main
with:
pattern: coverage-*
merge-multiple: true
path: coverage-reports
- name: Refuse to upload nothing
# `ls` exits non-zero on no match. Without this the upload has nothing to
# send and still reports success, which is the failure being fixed here.
run: ls coverage-reports/*.xml
- name: Upload to Codecov
uses: codecov/codecov-action@main
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: |
coverage.xml
# A directory rather than a filename: there is one report per matrix
# leg now. The previous block literal passed "coverage.xml\n", which was
# not found, and only the fallback search made the upload work at all.
directory: coverage-reports
# Only fail when a token was there to use. Pull requests from forks get
# no secrets, and a contributor should not see red for that.
fail_ci_if_error: ${{ secrets.CODECOV_TOKEN != '' }}
1 change: 1 addition & 0 deletions docs/examples/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ In the next sections you will find the simulations of the rockets listed above.
prometheus_2022_flight_sim.ipynb
erebus_flight_sim.ipynb
halcyon_flight_sim.ipynb
halcyon_flight_sim_active_control.ipynb
cavour_flight_sim.ipynb
genesis_flight_sim.ipynb
camoes_flight_sim.ipynb
Expand Down
3 changes: 0 additions & 3 deletions rocketpy/rocket/rocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -2004,7 +2004,6 @@ def add_thrust_vector_control(
rocket. The most recent measurements of the sensors are provided
with the ``sensor.measurement`` attribute. The sensors are
listed in the same order as they are added to the rocket
``interactive_objects``

This function will be called during the simulation at the specified
sampling rate. The function should evaluate and change the observed
Expand Down Expand Up @@ -2164,7 +2163,6 @@ def add_roll_control(
rocket. The most recent measurements of the sensors are provided
with the ``sensor.measurement`` attribute. The sensors are
listed in the same order as they are added to the rocket
`interactive_objects`

This function will be called during the simulation at the specified
sampling rate. The function should evaluate and change the observed
Expand Down Expand Up @@ -2300,7 +2298,6 @@ def add_throttle_control(
rocket. The most recent measurements of the sensors are provided
with the ``sensor.measurement`` attribute. The sensors are
listed in the same order as they are added to the rocket
``interactive_objects``

This function will be called during the simulation at the specified
sampling rate. The function should evaluate and change the observed
Expand Down
2 changes: 1 addition & 1 deletion rocketpy/sensors/accelerometer.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def measure(self, time, **kwargs):
gravity = (
Vector([0, 0, -gravity]) if self.consider_gravity else Vector([0, 0, 0])
)
inertial_acceleration = Vector(u_dot[3:6]) + gravity
inertial_acceleration = Vector(u_dot[3:6]) - gravity

# Vector from rocket cdm to sensor in rocket frame
r = relative_position
Expand Down
Loading
Loading