Skip to content

Commit

Permalink
Merge pull request #191 from nyx-space/189-mean-motion-based-propagat…
Browse files Browse the repository at this point in the history
…ion-for-n-objects-in-parallel

Mean motion based propagation from Python
  • Loading branch information
ChristopherRabotin authored Jun 26, 2023
2 parents 657eb6e + 174d0a6 commit 2c4facb
Show file tree
Hide file tree
Showing 17 changed files with 570 additions and 68 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/daily.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Daily Workflow

on:
schedule:
- cron: '0 0 * * *' # Run at midnight every day

jobs:
full-coverage:
name: Unit test and integration test coverage analysis
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install stable toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt, clippy

- name: Install cargo-grcov
run: |
rustup component add llvm-tools-preview
cargo install grcov
- name: Generate coverage report for unit tests
env:
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "target/coverage/nyx_space-%p-%m.profraw"
run: |
cargo test --lib
grcov . --binary-path ./target/debug/ -t lcov -s . --keep-only 'src/*' > lcov-lib.txt
- name: Generate coverage report for doc tests
env:
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "target/coverage/nyx_space-%p-%m.profraw"
run: |
cargo test --doc
grcov . --binary-path ./target/debug/ -t lcov -s . --keep-only 'src/*' > lcov-lib.txt
- name: Generate coverage report for cosmic integr. tests
env:
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "target/coverage/nyx_space-%p-%m.profraw"
run: |
cargo test -- cosmic mission_design orbit_determination propulsion test_monte_carlo_epoch
grcov . --binary-path ./target/debug/ -t lcov -s . --keep-only 'src/*' > lcov-cosmic.txt
- name: Generate coverage report for mission_design integr. tests
env:
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "target/coverage/nyx_space-%p-%m.profraw"
run: |
cargo test -- cosmic mission_design orbit_determination propulsion test_monte_carlo_epoch
grcov . --binary-path ./target/debug/ -t lcov -s . --keep-only 'src/*' > lcov-mission_design.txt
- name: Generate coverage report for OD integr. tests
env:
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "target/coverage/nyx_space-%p-%m.profraw"
run: |
cargo test -- orbit_determination
grcov . --binary-path ./target/debug/ -t lcov -s . --keep-only 'src/*' > lcov-od.txt
- name: Generate coverage report for propulsion integr. tests
env:
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "target/coverage/nyx_space-%p-%m.profraw"
run: |
cargo test -- propulsion
grcov . --binary-path ./target/debug/ -t lcov -s . --keep-only 'src/*' > lcov-prop.txt
- name: Generate coverage report for monte carlo integr. tests
env:
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "target/coverage/nyx_space-%p-%m.profraw"
run: |
cargo test -- test_monte_carlo_epoch
grcov . --binary-path ./target/debug/ -t lcov -s . --keep-only 'src/*' > lcov-mc.txt
- name: Upload coverage report
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./lcov-*.txt
43 changes: 13 additions & 30 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# This file is autogenerated by maturin v0.14.16
# To update, run
#
# maturin generate-ci --pytest -o .github/workflows/python.yml github
#
name: Python
on:
push:
Expand All @@ -22,12 +17,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64, x86, aarch64]
target: [x86_64]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"

- name: Build wheels
uses: PyO3/maturin-action@v1
Expand All @@ -45,29 +40,13 @@ jobs:

- name: pytest x86_64
if: ${{ matrix.target == 'x86_64' }}
shell: bash
run: |
set -e
pip install nyx_space --find-links dist --force-reinstall
ls -lh dist
pip install nyx_space --find-links dist --force-reinstall -v --no-cache-dir
pip install pytest numpy pandas plotly pyarrow scipy
pytest
- name: pytest
if: ${{ !startsWith(matrix.target, 'x86') && matrix.target != 'ppc64' && matrix.target != 'aarch64' }}
uses: uraimo/[email protected]
with:
arch: ${{ matrix.target }}
distro: ubuntu22.04
githubToken: ${{ github.token }}
install: |
apt-get update
apt-get install -y --no-install-recommends python3 python3-pip python3-numpy python3-dev python3-pandas python-pyarrow python3-scipy
pip3 install -U pip pytest plotly
run: |
set -e
pip3 install nyx_space --find-links dist --force-reinstall
pytest
- name: Upload python tests HTMLs
uses: actions/upload-artifact@v3
with:
Expand All @@ -83,7 +62,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
architecture: ${{ matrix.target }}
- name: Build wheels
uses: PyO3/maturin-action@v1
Expand All @@ -96,12 +75,13 @@ jobs:
with:
name: wheels
path: dist

- name: pytest
if: ${{ !startsWith(matrix.target, 'aarch64') }}
shell: bash
run: |
set -e
pip install nyx_space --find-links dist --force-reinstall
ls -lh dist
pip install --find-links dist --force-reinstall nyx_space
pip install pytest numpy pandas plotly pyarrow
pytest
Expand All @@ -114,24 +94,27 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter -F python
sccache: 'true'

- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

- name: pytest
if: ${{ !startsWith(matrix.target, 'aarch64') }}
shell: bash
run: |
set -e
pip install nyx_space --find-links dist --force-reinstall
ls -lh dist
pip install --find-links dist --force-reinstall nyx_space
pip install pytest numpy pandas plotly pyarrow
pytest
Expand Down
17 changes: 7 additions & 10 deletions .github/workflows/tests.yaml → .github/workflows/rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
rust:
- { version: "1.67", name: MSRV }
- { version: "1.70", name: MSRV }
- { version: stable, name: stable }

runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -112,8 +112,8 @@ jobs:
- name: Audit code
run: cargo audit

coverage:
name: Coverage
ut-coverage:
name: Coverage (unit tests only)
runs-on: ubuntu-latest
needs: [tests]

Expand All @@ -132,22 +132,19 @@ jobs:
rustup component add llvm-tools-preview
cargo install grcov
- name: Generate coverage report
- name: Generate coverage report for unit tests
env:
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "nyx_space-%p-%m.profraw"
# grcov . -s . --binary-path ./target/debug/ -t html --branch --ignore-not-existing -o ./target/debug/coverage/ # Export as HTML
LLVM_PROFILE_FILE: "target/coverage/nyx_space-%p-%m.profraw"
run: |
cargo test --lib
grcov . --binary-path ./target/debug/ -t lcov -s . > lcov-lib.txt
cargo test -- cosmic mission_design orbit_determination propulsion test_monte_carlo_epoch
grcov . --binary-path ./target/debug/ -t lcov -s . > lcov-integ.txt
grcov . --binary-path ./target/debug/ -t lcov -s . --keep-only 'src/*' > lcov-lib.txt
- name: Upload coverage report
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./lcov-lib.txt, ./lcov-integ.txt
files: ./lcov-*.txt

release:
name: Release
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "nyx-space"
build = "build.rs"
version = "2.0.0-alpha.2"
version = "2.0.0-beta-dev"
edition = "2021"
authors = ["Christopher Rabotin <[email protected]>"]
description = "A high-fidelity space mission toolkit, with orbit propagation, estimation and some systems engineering"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["maturin>=0.14,<0.15"]
requires = ["maturin>=1.1,<1.2"]
build-backend = "maturin"

[project]
Expand Down
Loading

0 comments on commit 2c4facb

Please sign in to comment.