Skip to content

Commit

Permalink
Merge pull request #318 from nyx-space/issue-315
Browse files Browse the repository at this point in the history
Various clean ups
  • Loading branch information
ChristopherRabotin authored Jun 24, 2024
2 parents c9dbf4e + 1122d32 commit 6e8bb5b
Show file tree
Hide file tree
Showing 19 changed files with 81 additions and 685 deletions.
18 changes: 1 addition & 17 deletions .github/ISSUE_TEMPLATE/stakeholder-need.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ How do we test that these requirements are fulfilled correctly? What are some ed

Document, discuss, and optionally upload design diagram into this section.

<!--
<!--
## Algorithm demonstration
If this issue requires a change in an algorithm, it should be described here. This algorithm should be described thoroughly enough to be used as documentation. This section may also simply refer to an algorithm in the literature or in another piece of software that has been validated. The quality of that reference will be determined case by case.
Expand All @@ -35,19 +35,3 @@ Define how the Nyx APIs will be affect by this: what are new functions available
Try to add an ASCII diagram of how this should work. If you need to draw a diagram, you can use [MermaidJS](https://mermaid-js.github.io/mermaid/#/).
-->

<!--
ChatGPT introductory prompt:
You are are now Astrodyn-GPT. You work with me on a high fidelity astrodynamics software called Nyx Space. It follows a strict quality assurance policy that I briefly describe below. The code of Nyx almost entirely in Rust, but it's usable via Python bindings created with PyO3. I would like us to work together on a new feature for Nyx. For that, I need your help to write a github issue that follows the quality assurance policy of Nyx. A new issue must include the following sections:
+ High level description: there, we describe the need you have either with use cases or examples.
+ Requirements: there, we describe what does the system need to do (but not how to do it).
+ Test plans: How do we test that these requirements are fulfilled correctly? What are some edge cases we should be aware of when developing the test code?
+ Design: a MermaidJS diagram that describes the proposed implementation.
When writing a new issue, only write the paragraph I ask. For example, if I ask to write the diagram, only provide the diagram, nothing else.
To confirm that you've understood my request, please acknowledge with a yes and a short joke about astrodynamics.
-->
40 changes: 40 additions & 0 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Daily Workflow

on:
push:
branches:
- master
workflow_dispatch:

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: Download data
run: |
wget -O data/de440s.bsp http://public-data.nyxspace.com/anise/de440s.bsp
wget -O data/de440s.bsp http://public-data.nyxspace.com/anise/de438.bsp # GMAT validation cases
wget -O data/pck08.pca http://public-data.nyxspace.com/anise/v0.4/pck08.pca
wget -O data/earth_latest_high_prec.bpc http://public-data.nyxspace.com/anise/ci/earth_latest_high_prec-2023-09-08.bpc
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate full code coverage
run: cargo llvm-cov --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: lcov.info
fail_ci_if_error: false
49 changes: 18 additions & 31 deletions .github/workflows/daily.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,24 @@ name: Daily Workflow
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # Run at midnight every day
- 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: Download data
run: |
wget -O data/de440s.bsp http://public-data.nyxspace.com/anise/de440s.bsp
wget -O data/de440s.bsp http://public-data.nyxspace.com/anise/de438.bsp # GMAT validation cases
wget -O data/pck08.pca http://public-data.nyxspace.com/anise/v0.4/pck08.pca
wget -O data/earth_latest_high_prec.bpc http://public-data.nyxspace.com/anise/ci/earth_latest_high_prec-2023-09-08.bpc
full-coverage:
name: Unit test and integration test coverage analysis
runs-on: ubuntu-latest

- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate full code coverage
run: cargo llvm-cov --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: lcov.info
fail_ci_if_error: false
steps:
- name: Checkout
uses: actions/checkout@v3

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

- name: Cargo check
run: |
cargo update
cargo check
37 changes: 2 additions & 35 deletions .github/workflows/rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust.version }}

- name: Download data
run: |
wget -O data/de440s.bsp http://public-data.nyxspace.com/anise/de440s.bsp
Expand All @@ -77,7 +77,7 @@ jobs:

- name: All integration tests (release)
run: cargo test --release --test "*"

- name: Doc Test
run: cargo test --doc

Expand All @@ -102,39 +102,6 @@ jobs:
- name: Run cargo clippy
run: cargo clippy -- -D warnings

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

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

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

- name: Download data
run: |
wget -O data/de440s.bsp http://public-data.nyxspace.com/anise/de440s.bsp
wget -O data/de440s.bsp http://public-data.nyxspace.com/anise/de438.bsp # GMAT validation cases
wget -O data/pck08.pca http://public-data.nyxspace.com/anise/v0.4/pck08.pca
wget -O data/earth_latest_high_prec.bpc http://public-data.nyxspace.com/anise/ci/earth_latest_high_prec-2023-09-08.bpc
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate unit tests code coverage
run: cargo llvm-cov --lib --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: lcov.info
fail_ci_if_error: false

release:
name: Release
runs-on: ubuntu-latest
Expand Down
10 changes: 1 addition & 9 deletions src/cosmic/eclipse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,15 +299,7 @@ pub fn eclipse_state(
// If the light source's radius is zero, just call the line of sight algorithm

if ls_mean_eq_radius_km < f64::EPSILON {
// TODO(ANISE): I think I need the opposite data here! Hence the neg!
let observed = almanac.transform_to(observer, light_source, None)?;

// let observed = almanac.celestial_state(
// &light_source.ephem_path(),
// observer.epoch,
// observer.frame,
// LightTimeCalc::None,
// );
let observed = -almanac.transform_to(observer, light_source, None)?;
return line_of_sight(observer, observed, eclipsing_body, almanac);
}

Expand Down
Loading

0 comments on commit 6e8bb5b

Please sign in to comment.