From f63a7814c4acac4f88b833c81f0a54ba43d66bd2 Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Thu, 1 Aug 2024 19:14:16 -0600 Subject: [PATCH 1/7] Scrape examples for the docs --- .github/workflows/firebase-hosting-merge.yml | 2 +- .github/workflows/firebase-hosting-pull-request.yml | 2 +- Cargo.toml | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml index ee9401d0..66dd96a0 100644 --- a/.github/workflows/firebase-hosting-merge.yml +++ b/.github/workflows/firebase-hosting-merge.yml @@ -15,7 +15,7 @@ jobs: uses: dtolnay/rust-toolchain@master with: toolchain: stable - - run: cargo doc --no-deps + - run: cargo doc --no-deps -Zunstable-options -Zrustdoc-scrape-examples - uses: FirebaseExtended/action-hosting-deploy@v0 with: repoToken: '${{ secrets.GITHUB_TOKEN }}' diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml index 08990801..74fd87a7 100644 --- a/.github/workflows/firebase-hosting-pull-request.yml +++ b/.github/workflows/firebase-hosting-pull-request.yml @@ -13,7 +13,7 @@ jobs: uses: dtolnay/rust-toolchain@master with: toolchain: stable - - run: cargo doc --no-deps + - run: cargo doc --no-deps -Zunstable-options -Zrustdoc-scrape-examples - uses: FirebaseExtended/action-hosting-deploy@v0 with: repoToken: '${{ secrets.GITHUB_TOKEN }}' diff --git a/Cargo.toml b/Cargo.toml index 199f0cd7..341a43a6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -98,6 +98,9 @@ name = "nyx_space" linker = "/usr/bin/clang" rustflags = ["-Clink-arg=-fuse-ld=lld", "-Clink-arg=-Wl,--no-rosegment"] +[package.metadata.docs.rs] +cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] + [[example]] name = "01_orbit_prop" path = "examples/01_orbit_prop/main.rs" From 9f22bc4424407321320ab8c6e59d063597c151b1 Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Thu, 1 Aug 2024 19:14:56 -0600 Subject: [PATCH 2/7] Examples are now built in CI but not run Building ensures that nothing broke. No need to run them because we don't check the outputs in CI. --- .github/workflows/rust.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/rust.yaml b/.github/workflows/rust.yaml index ae945ff4..8434d6ee 100644 --- a/.github/workflows/rust.yaml +++ b/.github/workflows/rust.yaml @@ -83,11 +83,11 @@ jobs: - name: Run examples run: | - cargo run --example 01_orbit_prop --release - cargo run --example 02_jwst --release - cargo run --example 03_geo_drift --release - cargo run --example 03_geo_raise --release - cargo run --example 03_geo_sk --release + cargo build --example 01_orbit_prop --release + cargo build --example 02_jwst --release + cargo build --example 03_geo_drift --release + cargo build --example 03_geo_raise --release + cargo build --example 03_geo_sk --release lints: name: Lints From c3d31297c1f46534ecace4c33846974393b53c3e Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Thu, 1 Aug 2024 19:22:35 -0600 Subject: [PATCH 3/7] Switch to nightly for cargo doc --- .github/workflows/firebase-hosting-merge.yml | 2 +- .github/workflows/firebase-hosting-pull-request.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml index 66dd96a0..56954d89 100644 --- a/.github/workflows/firebase-hosting-merge.yml +++ b/.github/workflows/firebase-hosting-merge.yml @@ -14,7 +14,7 @@ jobs: - name: Install Rust toolchain uses: dtolnay/rust-toolchain@master with: - toolchain: stable + toolchain: nightly - run: cargo doc --no-deps -Zunstable-options -Zrustdoc-scrape-examples - uses: FirebaseExtended/action-hosting-deploy@v0 with: diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml index 74fd87a7..11c9b655 100644 --- a/.github/workflows/firebase-hosting-pull-request.yml +++ b/.github/workflows/firebase-hosting-pull-request.yml @@ -12,7 +12,7 @@ jobs: - name: Install Rust toolchain uses: dtolnay/rust-toolchain@master with: - toolchain: stable + toolchain: nightly - run: cargo doc --no-deps -Zunstable-options -Zrustdoc-scrape-examples - uses: FirebaseExtended/action-hosting-deploy@v0 with: From f917080c02aed886c81abd33393a33daca3614ec Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Fri, 2 Aug 2024 16:07:23 -0600 Subject: [PATCH 4/7] Update docs to include examples, plots, and scrape examples --- ...ebase-hosting-merge.yml => deploy-live-docs.yml} | 11 ++++++++++- ...ing-pull-request.yml => deploy-staging-docs.yml} | 11 ++++++++++- Cargo.toml | 5 +++++ examples/01_orbit_prop/README.md | 6 +++--- examples/01_orbit_prop/main.rs | 1 + .../{ => plots}/cubesat-angles-v-time.png | Bin .../{ => plots}/cubesat-ecc-v-time.png | Bin .../{ => plots}/cubesat-sma-v-time.png | Bin examples/02_jwst_covar_monte_carlo/main.rs | 1 + examples/03_geo_analysis/drift.rs | 1 + examples/03_geo_analysis/raise.rs | 1 + examples/03_geo_analysis/stationkeeping.rs | 1 + src/dynamics/orbital.rs | 6 +++--- 13 files changed, 36 insertions(+), 8 deletions(-) rename .github/workflows/{firebase-hosting-merge.yml => deploy-live-docs.yml} (61%) rename .github/workflows/{firebase-hosting-pull-request.yml => deploy-staging-docs.yml} (62%) rename examples/01_orbit_prop/{ => plots}/cubesat-angles-v-time.png (100%) rename examples/01_orbit_prop/{ => plots}/cubesat-ecc-v-time.png (100%) rename examples/01_orbit_prop/{ => plots}/cubesat-sma-v-time.png (100%) diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/deploy-live-docs.yml similarity index 61% rename from .github/workflows/firebase-hosting-merge.yml rename to .github/workflows/deploy-live-docs.yml index 56954d89..d2724222 100644 --- a/.github/workflows/firebase-hosting-merge.yml +++ b/.github/workflows/deploy-live-docs.yml @@ -15,7 +15,16 @@ jobs: uses: dtolnay/rust-toolchain@master with: toolchain: nightly - - run: cargo doc --no-deps -Zunstable-options -Zrustdoc-scrape-examples + - run: cargo doc --no-deps --examples -Z rustdoc-scrape-examples + - name: Copy plots directories + run: | + for example_dir in examples/*; do + if [ -d "$example_dir/plots" ]; then + example_name=$(basename $example_dir) + mkdir -p target/doc/$example_name/plots + cp -r $example_dir/plots/* target/doc/$example_name/plots/ + fi + done - uses: FirebaseExtended/action-hosting-deploy@v0 with: repoToken: '${{ secrets.GITHUB_TOKEN }}' diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/deploy-staging-docs.yml similarity index 62% rename from .github/workflows/firebase-hosting-pull-request.yml rename to .github/workflows/deploy-staging-docs.yml index 11c9b655..2463cf10 100644 --- a/.github/workflows/firebase-hosting-pull-request.yml +++ b/.github/workflows/deploy-staging-docs.yml @@ -13,7 +13,16 @@ jobs: uses: dtolnay/rust-toolchain@master with: toolchain: nightly - - run: cargo doc --no-deps -Zunstable-options -Zrustdoc-scrape-examples + - run: cargo doc --no-deps --examples -Z rustdoc-scrape-examples + - name: Copy plots directories + run: | + for example_dir in examples/*; do + if [ -d "$example_dir/plots" ]; then + example_name=$(basename $example_dir) + mkdir -p target/doc/$example_name/plots + cp -r $example_dir/plots/* target/doc/$example_name/plots/ + fi + done - uses: FirebaseExtended/action-hosting-deploy@v0 with: repoToken: '${{ secrets.GITHUB_TOKEN }}' diff --git a/Cargo.toml b/Cargo.toml index 341a43a6..7fc9b2b6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -104,19 +104,24 @@ cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] [[example]] name = "01_orbit_prop" path = "examples/01_orbit_prop/main.rs" +doc-scrape-examples = true [[example]] name = "02_jwst" path = "examples/02_jwst_covar_monte_carlo/main.rs" +doc-scrape-examples = true [[example]] name = "03_geo_drift" path = "examples/03_geo_analysis/drift.rs" +doc-scrape-examples = true [[example]] name = "03_geo_raise" path = "examples/03_geo_analysis/raise.rs" +doc-scrape-examples = true [[example]] name = "03_geo_sk" path = "examples/03_geo_analysis/stationkeeping.rs" +doc-scrape-examples = true diff --git a/examples/01_orbit_prop/README.md b/examples/01_orbit_prop/README.md index 3ff583e2..4901f067 100644 --- a/examples/01_orbit_prop/README.md +++ b/examples/01_orbit_prop/README.md @@ -28,10 +28,10 @@ The force models used here are akin to STK's "HPOP" propagator. Specifically, th In two body propagation, all orbital elements remain constant apart from the true anomaly. In real life, the oblateness of the Earth causes the right ascension of the ascending node to drift with time (red line below). The other force models also affect the overall orbit. -![RAAN, AOP, INC over time](./cubesat-angles-v-time.png) +![RAAN, AOP, INC over time](./plots/cubesat-angles-v-time.png) -![SMA (km) over time](./cubesat-sma-v-time.png) +![SMA (km) over time](./plots/cubesat-sma-v-time.png) -![ECC over time](./cubesat-ecc-v-time.png) +![ECC over time](./plots/cubesat-ecc-v-time.png) _Note_: These plots were generated with an SRP area of that was ten times larger than the correct value, hence you may notice slightly different Keplerian orbital elements, notably for the change in the shape of the orbit. diff --git a/examples/01_orbit_prop/main.rs b/examples/01_orbit_prop/main.rs index 0667f3e2..c2f46b0b 100644 --- a/examples/01_orbit_prop/main.rs +++ b/examples/01_orbit_prop/main.rs @@ -1,3 +1,4 @@ +#![doc = include_str!("./README.md")] extern crate log; extern crate nyx_space as nyx; extern crate pretty_env_logger as pel; diff --git a/examples/01_orbit_prop/cubesat-angles-v-time.png b/examples/01_orbit_prop/plots/cubesat-angles-v-time.png similarity index 100% rename from examples/01_orbit_prop/cubesat-angles-v-time.png rename to examples/01_orbit_prop/plots/cubesat-angles-v-time.png diff --git a/examples/01_orbit_prop/cubesat-ecc-v-time.png b/examples/01_orbit_prop/plots/cubesat-ecc-v-time.png similarity index 100% rename from examples/01_orbit_prop/cubesat-ecc-v-time.png rename to examples/01_orbit_prop/plots/cubesat-ecc-v-time.png diff --git a/examples/01_orbit_prop/cubesat-sma-v-time.png b/examples/01_orbit_prop/plots/cubesat-sma-v-time.png similarity index 100% rename from examples/01_orbit_prop/cubesat-sma-v-time.png rename to examples/01_orbit_prop/plots/cubesat-sma-v-time.png diff --git a/examples/02_jwst_covar_monte_carlo/main.rs b/examples/02_jwst_covar_monte_carlo/main.rs index 117d2ba3..e6b33a36 100644 --- a/examples/02_jwst_covar_monte_carlo/main.rs +++ b/examples/02_jwst_covar_monte_carlo/main.rs @@ -1,3 +1,4 @@ +#![doc = include_str!("./README.md")] extern crate log; extern crate nyx_space as nyx; extern crate pretty_env_logger as pel; diff --git a/examples/03_geo_analysis/drift.rs b/examples/03_geo_analysis/drift.rs index 41d6503a..ca590a62 100644 --- a/examples/03_geo_analysis/drift.rs +++ b/examples/03_geo_analysis/drift.rs @@ -1,3 +1,4 @@ +#![doc = include_str!("./README.md")] extern crate log; extern crate nyx_space as nyx; extern crate pretty_env_logger as pel; diff --git a/examples/03_geo_analysis/raise.rs b/examples/03_geo_analysis/raise.rs index 063db4a7..6d7750f7 100644 --- a/examples/03_geo_analysis/raise.rs +++ b/examples/03_geo_analysis/raise.rs @@ -1,3 +1,4 @@ +#![doc = include_str!("./README.md")] extern crate log; extern crate nyx_space as nyx; extern crate pretty_env_logger as pel; diff --git a/examples/03_geo_analysis/stationkeeping.rs b/examples/03_geo_analysis/stationkeeping.rs index 442b5667..ed8ecef1 100644 --- a/examples/03_geo_analysis/stationkeeping.rs +++ b/examples/03_geo_analysis/stationkeeping.rs @@ -1,3 +1,4 @@ +#![doc = include_str!("./README.md")] extern crate log; extern crate nyx_space as nyx; extern crate pretty_env_logger as pel; diff --git a/src/dynamics/orbital.rs b/src/dynamics/orbital.rs index 994abd5a..1358f7b0 100644 --- a/src/dynamics/orbital.rs +++ b/src/dynamics/orbital.rs @@ -41,7 +41,7 @@ pub struct OrbitalDynamics { } impl OrbitalDynamics { - /// Initialize point mass dynamics given the EXB IDs and a Cosm + /// Initializes the point masses gravities with the provided list of bodies pub fn point_masses(celestial_objects: Vec) -> Self { // Create the point masses Self::new(vec![PointMasses::new(celestial_objects)]) @@ -176,7 +176,7 @@ pub struct PointMasses { } impl PointMasses { - /// Initializes the multibody point mass dynamics with the provided list of bodies + /// Initializes the point masses gravities with the provided list of bodies pub fn new(celestial_objects: Vec) -> Arc { Arc::new(Self { celestial_objects, @@ -184,7 +184,7 @@ impl PointMasses { }) } - /// Initializes the multibody point mass dynamics with the provided list of bodies, and accounting for some light time correction + /// Initializes the point masses gravities with the provided list of bodies, and accounting for some light time correction pub fn with_correction(celestial_objects: Vec, correction: Aberration) -> Self { Self { celestial_objects, From 130a200ea01d58019ef8a19fed2d12ee8218a5f3 Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Fri, 2 Aug 2024 16:09:30 -0600 Subject: [PATCH 5/7] Clippy --- src/mc/results.rs | 2 +- src/md/trajectory/traj.rs | 4 ++-- src/od/msr/arc.rs | 2 +- src/od/process/export.rs | 2 +- src/propagators/error_ctrl.rs | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/mc/results.rs b/src/mc/results.rs index ada9eb1d..68955795 100644 --- a/src/mc/results.rs +++ b/src/mc/results.rs @@ -358,7 +358,7 @@ where let mut utc_epoch = StringBuilder::new(); let mut idx_col = Int32Builder::new(); for (sno, s) in all_states.iter().enumerate() { - utc_epoch.append_value(&s.epoch().to_time_scale(TimeScale::UTC).to_isoformat()); + utc_epoch.append_value(s.epoch().to_time_scale(TimeScale::UTC).to_isoformat()); // Copy this a bunch of times because all columns must have the same length idx_col.append_value(run_indexes[sno]); diff --git a/src/md/trajectory/traj.rs b/src/md/trajectory/traj.rs index e841fe87..04bd5de9 100644 --- a/src/md/trajectory/traj.rs +++ b/src/md/trajectory/traj.rs @@ -235,7 +235,7 @@ where // Epochs let mut utc_epoch = StringBuilder::new(); for s in &states { - utc_epoch.append_value(&s.epoch().to_time_scale(TimeScale::UTC).to_isoformat()); + utc_epoch.append_value(s.epoch().to_time_scale(TimeScale::UTC).to_isoformat()); } record.push(Arc::new(utc_epoch.finish())); @@ -459,7 +459,7 @@ where // Epochs (both match for self and others) let mut utc_epoch = StringBuilder::new(); for s in &self_states { - utc_epoch.append_value(&s.epoch().to_time_scale(TimeScale::UTC).to_isoformat()); + utc_epoch.append_value(s.epoch().to_time_scale(TimeScale::UTC).to_isoformat()); } record.push(Arc::new(utc_epoch.finish())); diff --git a/src/od/msr/arc.rs b/src/od/msr/arc.rs index 0a700471..13eb5d75 100644 --- a/src/od/msr/arc.rs +++ b/src/od/msr/arc.rs @@ -140,7 +140,7 @@ where // Epochs let mut utc_epoch = StringBuilder::new(); for m in &measurements { - utc_epoch.append_value(&m.1.epoch().to_time_scale(TimeScale::UTC).to_isoformat()); + utc_epoch.append_value(m.1.epoch().to_time_scale(TimeScale::UTC).to_isoformat()); } record.push(Arc::new(utc_epoch.finish())); diff --git a/src/od/process/export.rs b/src/od/process/export.rs index 7520fbf4..2d373d70 100644 --- a/src/od/process/export.rs +++ b/src/od/process/export.rs @@ -287,7 +287,7 @@ where // Epochs let mut utc_epoch = StringBuilder::new(); for s in &estimates { - utc_epoch.append_value(&s.epoch().to_time_scale(TimeScale::UTC).to_isoformat()); + utc_epoch.append_value(s.epoch().to_time_scale(TimeScale::UTC).to_isoformat()); } record.push(Arc::new(utc_epoch.finish())); diff --git a/src/propagators/error_ctrl.rs b/src/propagators/error_ctrl.rs index 19487bb6..13720ed4 100644 --- a/src/propagators/error_ctrl.rs +++ b/src/propagators/error_ctrl.rs @@ -171,9 +171,9 @@ impl ErrorCtrl for RSSStep { /// > This is a more stringent error control method than [`rss_step`] that is often used as the default in other software such as STK. /// > If you set [the] accuracy to a very small number, 1e-13 for example, and set the error control to [`rss_step`], integrator /// > performance will be poor, for little if any improvement in the accuracy of the orbit integration. -/// For more best practices of these integrators (which clone those in GMAT), please refer to the -/// [GMAT reference](https://github.com/ChristopherRabotin/GMAT/blob/37201a6290e7f7b941bc98ee973a527a5857104b/doc/help/src/Resource_NumericalIntegrators.xml#L1292). -/// (Source)[https://github.com/ChristopherRabotin/GMAT/blob/37201a6290e7f7b941bc98ee973a527a5857104b/src/base/forcemodel/ODEModel.cpp#L3004] +/// > For more best practices of these integrators (which clone those in GMAT), please refer to the +/// > [GMAT reference](https://github.com/ChristopherRabotin/GMAT/blob/37201a6290e7f7b941bc98ee973a527a5857104b/doc/help/src/Resource_NumericalIntegrators.xml#L1292). +/// > (Source)[https://github.com/ChristopherRabotin/GMAT/blob/37201a6290e7f7b941bc98ee973a527a5857104b/src/base/forcemodel/ODEModel.cpp#L3004] #[derive(Clone, Copy)] #[allow(clippy::upper_case_acronyms)] pub struct RSSState; From ee836249b36aa466788cef85056bf93fc04d0f58 Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Fri, 2 Aug 2024 16:30:29 -0600 Subject: [PATCH 6/7] Fix plot paths --- .github/workflows/deploy-live-docs.yml | 16 +++++++++++++--- .github/workflows/deploy-staging-docs.yml | 16 +++++++++++++--- src/od/simulator/arc.rs | 4 ++-- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy-live-docs.yml b/.github/workflows/deploy-live-docs.yml index d2724222..4b270dbd 100644 --- a/.github/workflows/deploy-live-docs.yml +++ b/.github/workflows/deploy-live-docs.yml @@ -18,11 +18,21 @@ jobs: - run: cargo doc --no-deps --examples -Z rustdoc-scrape-examples - name: Copy plots directories run: | + declare -A example_map + example_map["01_orbit_prop"]="01_orbit_prop" + example_map["02_jwst_covar_monte_carlo"]="02_jwst" + example_map["03_geo_analysis"]="03_geo_raise" + for example_dir in examples/*; do + example_name=$(basename $example_dir) if [ -d "$example_dir/plots" ]; then - example_name=$(basename $example_dir) - mkdir -p target/doc/$example_name/plots - cp -r $example_dir/plots/* target/doc/$example_name/plots/ + doc_name=${example_map[$example_name]} + if [ -n "$doc_name" ]; then + mkdir -p target/doc/$doc_name/plots + cp -r $example_dir/plots/* target/doc/$doc_name/plots/ + else + echo "No mapping found for $example_name" + fi fi done - uses: FirebaseExtended/action-hosting-deploy@v0 diff --git a/.github/workflows/deploy-staging-docs.yml b/.github/workflows/deploy-staging-docs.yml index 2463cf10..1b9ad80a 100644 --- a/.github/workflows/deploy-staging-docs.yml +++ b/.github/workflows/deploy-staging-docs.yml @@ -16,11 +16,21 @@ jobs: - run: cargo doc --no-deps --examples -Z rustdoc-scrape-examples - name: Copy plots directories run: | + declare -A example_map + example_map["01_orbit_prop"]="01_orbit_prop" + example_map["02_jwst_covar_monte_carlo"]="02_jwst" + example_map["03_geo_analysis"]="03_geo_raise" + for example_dir in examples/*; do + example_name=$(basename $example_dir) if [ -d "$example_dir/plots" ]; then - example_name=$(basename $example_dir) - mkdir -p target/doc/$example_name/plots - cp -r $example_dir/plots/* target/doc/$example_name/plots/ + doc_name=${example_map[$example_name]} + if [ -n "$doc_name" ]; then + mkdir -p target/doc/$doc_name/plots + cp -r $example_dir/plots/* target/doc/$doc_name/plots/ + else + echo "No mapping found for $example_name" + fi fi done - uses: FirebaseExtended/action-hosting-deploy@v0 diff --git a/src/od/simulator/arc.rs b/src/od/simulator/arc.rs index 6b2aac78..22ea603a 100644 --- a/src/od/simulator/arc.rs +++ b/src/od/simulator/arc.rs @@ -294,8 +294,8 @@ impl TrackingArcSim { /// 5. Build each of these as "tracking strands" for this tracking device. /// 6. Organize all of the built tracking strands chronologically. /// 7. Iterate through all of the strands: - /// 7.a. if that tracker is marked as `Greedy` and it ends after the start of the next strand, change the start date of the next strand. - /// 7.b. if that tracker is marked as `Eager` and it ends after the start of the next strand, change the end date of the current strand. + /// 7.a. if that tracker is marked as `Greedy` and it ends after the start of the next strand, change the start date of the next strand. + /// 7.b. if that tracker is marked as `Eager` and it ends after the start of the next strand, change the end date of the current strand. pub fn generate_schedule( &self, almanac: Arc, From db53187903f55ea4a75a1744477013a24056c1ad Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Fri, 2 Aug 2024 16:39:44 -0600 Subject: [PATCH 7/7] Fix plot paths for 03_geo --- .github/workflows/deploy-live-docs.yml | 15 +++++++++++---- .github/workflows/deploy-staging-docs.yml | 15 +++++++++++---- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy-live-docs.yml b/.github/workflows/deploy-live-docs.yml index 4b270dbd..9f5d038b 100644 --- a/.github/workflows/deploy-live-docs.yml +++ b/.github/workflows/deploy-live-docs.yml @@ -20,16 +20,23 @@ jobs: run: | declare -A example_map example_map["01_orbit_prop"]="01_orbit_prop" - example_map["02_jwst_covar_monte_carlo"]="02_jwst" - example_map["03_geo_analysis"]="03_geo_raise" + example_map["02_jwst"]="02_jwst_covar_monte_carlo" + + declare -A special_cases + special_cases["03_geo_analysis"]="03_geo_raise 03_geo_drift 03_geo_sk" for example_dir in examples/*; do example_name=$(basename $example_dir) if [ -d "$example_dir/plots" ]; then - doc_name=${example_map[$example_name]} - if [ -n "$doc_name" ]; then + if [ -n "${example_map[$example_name]}" ]; then + doc_name=${example_map[$example_name]} mkdir -p target/doc/$doc_name/plots cp -r $example_dir/plots/* target/doc/$doc_name/plots/ + elif [ -n "${special_cases[$example_name]}" ]; then + for target_folder in ${special_cases[$example_name]}; do + mkdir -p target/doc/$target_folder/plots + cp -r $example_dir/plots/* target/doc/$target_folder/plots/ + done else echo "No mapping found for $example_name" fi diff --git a/.github/workflows/deploy-staging-docs.yml b/.github/workflows/deploy-staging-docs.yml index 1b9ad80a..f551e641 100644 --- a/.github/workflows/deploy-staging-docs.yml +++ b/.github/workflows/deploy-staging-docs.yml @@ -18,16 +18,23 @@ jobs: run: | declare -A example_map example_map["01_orbit_prop"]="01_orbit_prop" - example_map["02_jwst_covar_monte_carlo"]="02_jwst" - example_map["03_geo_analysis"]="03_geo_raise" + example_map["02_jwst"]="02_jwst_covar_monte_carlo" + + declare -A special_cases + special_cases["03_geo_analysis"]="03_geo_raise 03_geo_drift 03_geo_sk" for example_dir in examples/*; do example_name=$(basename $example_dir) if [ -d "$example_dir/plots" ]; then - doc_name=${example_map[$example_name]} - if [ -n "$doc_name" ]; then + if [ -n "${example_map[$example_name]}" ]; then + doc_name=${example_map[$example_name]} mkdir -p target/doc/$doc_name/plots cp -r $example_dir/plots/* target/doc/$doc_name/plots/ + elif [ -n "${special_cases[$example_name]}" ]; then + for target_folder in ${special_cases[$example_name]}; do + mkdir -p target/doc/$target_folder/plots + cp -r $example_dir/plots/* target/doc/$target_folder/plots/ + done else echo "No mapping found for $example_name" fi