diff --git a/.github/workflows/publish-documentation.yml b/.github/workflows/publish-documentation.yml new file mode 100644 index 0000000000..e9edee39f5 --- /dev/null +++ b/.github/workflows/publish-documentation.yml @@ -0,0 +1,111 @@ +# Simple workflow for deploying static content to GitHub Pages +name: Deploy Latest Basilisk Documentation to Pages + +on: + # Runs on pushes targeting the default branch: + pull_request: + branches: + - 'ci/publish-docs-to-pages-on-pr' + push: + branches: + - 'develop' + - 'ci/publish-docs-to-pages-on-pr' + tags: + - v* + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Single deploy job since we're just deploying + deploy: + name: Deploy Documentation + # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages + permissions: + contents: read + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-20.04 + strategy: + matrix: + python-version: ["3.9"] + steps: +# - name: Checkout +# uses: actions/checkout@v4 + - name: Checkout code + uses: nschloe/action-checkout-with-lfs-cache@v1 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Cache conan packages + id: cache-conan + uses: actions/cache@v3 + env: + cache-name: cache-conan-packages + with: + # conan cache files are stored in `~/.conan` on Linux/macOS + path: ~/.conan + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('conanfile.py') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + + - name: Cache pip modules + id: cache-pip + uses: actions/cache@v3 + env: + cache-name: cache-pip-modules + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: "Install swig and cmake" + run: sudo apt-get update && sudo apt-get install build-essential cmake gtk2.0 libgtk2.0-dev ninja-build swig -y + + - name: "Install python packages" + run: sudo apt-get install python3-setuptools python3-tk + + - name: "Install wheel and conan package" + run: pip3 install wheel conan==1.61.0 pytest datashader holoviews pytest-xdist + + - name: "Build basilisk" + run: python3 conanfile.py --opNav False --vizInterface False + + - name: "Run Python Tests" + run: cd src && pytest -n auto -m "not scenarioTest" --junitxml=../junit/test-results-${{ matrix.python-version }}.xml + + - id: deployment + uses: sphinx-notes/pages@v3 + with: + python_version: 3.9 + checkout: false + documentation_path: ./docs/source + requirements_path: ./docs/source/bskPkgOptions.txt + sphinx_version: 4.5.0 +# sphinx_build_options: -c docs/source/conf.py + +# - name: Setup Pages +# uses: actions/configure-pages@v5 + +# - name: Upload artifact +# uses: actions/upload-pages-artifact@v3 +# with: +# # Upload documentation HTML +# path: "docs/build/html" + +# - name: Deploy to GitHub Pages +# id: deployment +# uses: actions/deploy-pages@v4 diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 2e08c569b7..6562fb7d24 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -1,153 +1,153 @@ name: "Pull Request Test" -on: - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - build-linux: - name: Build Linux - runs-on: ubuntu-20.04 - strategy: - matrix: - python-version: ["3.9"] - permissions: - actions: read - contents: read - security-events: write - steps: - - name: Checkout code - uses: nschloe/action-checkout-with-lfs-cache@v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Cache conan packages - id: cache-conan - uses: actions/cache@v3 - env: - cache-name: cache-conan-packages - with: - # conan cache files are stored in `~/.conan` on Linux/macOS - path: ~/.conan - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('conanfile.py') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - - name: Cache pip modules - id: cache-pip - uses: actions/cache@v3 - env: - cache-name: cache-pip-modules - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - name: "Install swig and cmake" - run: sudo apt-get update && sudo apt-get install build-essential cmake gtk2.0 libgtk2.0-dev ninja-build swig -y - - name: "Install python packages" - run: sudo apt-get install python3-setuptools python3-tk - - name: "Create virtual Environment" - run: | - python${{ matrix.python-version }} -m venv .venv - source .venv/bin/activate - echo "VIRTUAL ENV:" $VIRTUAL_ENV - - name: "Install wheel and conan package" - run: source .venv/bin/activate && pip3 install wheel conan==1.61.0 pytest datashader holoviews pytest-xdist - - name: "Build basilisk" - run: source .venv/bin/activate && python3 conanfile.py --opNav True - - name: "Run Python Tests" - run: | - source .venv/bin/activate - cd src && pytest -n 2 -m "not scenarioTest" --junitxml=../junit/test-results-${{ matrix.python-version }}.xml - - name: "Upload pytest test results" - uses: actions/upload-artifact@v3 - with: - name: pytest-results-${{ matrix.python-version }} - path: junit/test-results-${{ matrix.python-version }}.xml - # Use always() to always run this step to publish test results when there are test failures - if: ${{ always() }} - - name: "Run C/C++ Tests" - working-directory: ./dist3 - run: ctest --gtest_output "json:../ctest/ctest-results-linux-${{ matrix.python-version }}.json" - - name: "Upload Google Test CTest results" - uses: actions/upload-artifact@v3 - with: - name: ctest-results-${{ matrix.python-version }} - path: ctest/ctest-results-${{ matrix.python-version }}.json - if: ${{ always() }} - - build-windows: - name: Build Windows - runs-on: windows-2019 - strategy: - matrix: - python-version: ["3.9"] - permissions: - actions: read - contents: read - security-events: write - env: - MPLBACKEND: agg - steps: - - name: Checkout code - uses: nschloe/action-checkout-with-lfs-cache@v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - cache: 'pip' - cache-dependency-path: '**/bskPkgRequired.txt' - - name: Choco help - uses: crazy-max/ghaction-chocolatey@v2 - with: - args: -h - - name: "Install swig and cmake" - shell: pwsh - run: choco install swig cmake -y - - name: "Create python virtual env" - shell: pwsh - run: python -m venv venv - - name: "Install wheel and conan package" - shell: pwsh - run: | - venv\Scripts\activate - pip install wheel conan==1.61.0 parse six pytest-xdist - - name: "Add basilisk and cmake path to env path" - shell: pwsh - run: | - $oldpath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).path - $newpath = “$oldpath;${{ env.GITHUB_WORKSPACE }}\dist3\Basilisk;C:\Program Files\CMake\bin” - Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $newPath - - name: "Build basilisk" - shell: pwsh - run: | - venv\Scripts\activate - python conanfile.py --opNav True - - name: "Test Simulation Python" - shell: pwsh - run: | - Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name MPLBACKEND -Value ${MPLBACKEND} - venv\Scripts\activate - cd src\simulation - (Get-ChildItem -Directory).FullName | ForEach-Object { cd $_; pytest -n 2 -m "not scenarioTest"; if(($LastExitCode -ne 0) -and ($LastExitCode -ne 5)) {exit 1}} - - name: "Python Architecture Tests" - shell: pwsh - run: | - venv\Scripts\activate - cd src\architecture - (Get-ChildItem -Directory).FullName | ForEach-Object { cd $_; pytest -n 2; if(($LastExitCode -ne 0) -and ($LastExitCode -ne 5)) {exit 1}} - - name: "Python FswAlgorithms Tests" - shell: pwsh - run: | - venv\Scripts\activate - cd src\fswAlgorithms - (Get-ChildItem -Directory).FullName | ForEach-Object { cd $_; pytest -n 2; if(($LastExitCode -ne 0) -and ($LastExitCode -ne 5)) {exit 1}} - - name: "C/C++ Tests" - shell: pwsh - run: | - cd dist3 - ctest --gtest_output "json:../ctest/ctest-results-windows-${{ matrix.python-version }}.json"; if(($LastExitCode -ne 0) -and ($LastExitCode -ne 5)) {exit 1} +#on: +# pull_request: +# +#concurrency: +# group: ${{ github.workflow }}-${{ github.ref }} +# cancel-in-progress: true +# +#jobs: +# build-linux: +# name: Build Linux +# runs-on: ubuntu-20.04 +# strategy: +# matrix: +# python-version: ["3.9"] +# permissions: +# actions: read +# contents: read +# security-events: write +# steps: +# - name: Checkout code +# uses: nschloe/action-checkout-with-lfs-cache@v1 +# - name: Set up Python ${{ matrix.python-version }} +# uses: actions/setup-python@v4 +# with: +# python-version: ${{ matrix.python-version }} +# - name: Cache conan packages +# id: cache-conan +# uses: actions/cache@v3 +# env: +# cache-name: cache-conan-packages +# with: +# # conan cache files are stored in `~/.conan` on Linux/macOS +# path: ~/.conan +# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('conanfile.py') }} +# restore-keys: | +# ${{ runner.os }}-build-${{ env.cache-name }}- +# - name: Cache pip modules +# id: cache-pip +# uses: actions/cache@v3 +# env: +# cache-name: cache-pip-modules +# with: +# path: ~/.cache/pip +# key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} +# restore-keys: | +# ${{ runner.os }}-pip- +# - name: "Install swig and cmake" +# run: sudo apt-get update && sudo apt-get install build-essential cmake gtk2.0 libgtk2.0-dev ninja-build swig -y +# - name: "Install python packages" +# run: sudo apt-get install python3-setuptools python3-tk +# - name: "Create virtual Environment" +# run: | +# python${{ matrix.python-version }} -m venv .venv +# source .venv/bin/activate +# echo "VIRTUAL ENV:" $VIRTUAL_ENV +# - name: "Install wheel and conan package" +# run: source .venv/bin/activate && pip3 install wheel conan==1.61.0 pytest datashader holoviews pytest-xdist +# - name: "Build basilisk" +# run: source .venv/bin/activate && python3 conanfile.py --opNav True +# - name: "Run Python Tests" +# run: | +# source .venv/bin/activate +# cd src && pytest -n 2 -m "not scenarioTest" --junitxml=../junit/test-results-${{ matrix.python-version }}.xml +# - name: "Upload pytest test results" +# uses: actions/upload-artifact@v3 +# with: +# name: pytest-results-${{ matrix.python-version }} +# path: junit/test-results-${{ matrix.python-version }}.xml +# # Use always() to always run this step to publish test results when there are test failures +# if: ${{ always() }} +# - name: "Run C/C++ Tests" +# working-directory: ./dist3 +# run: ctest --gtest_output "json:../ctest/ctest-results-linux-${{ matrix.python-version }}.json" +# - name: "Upload Google Test CTest results" +# uses: actions/upload-artifact@v3 +# with: +# name: ctest-results-${{ matrix.python-version }} +# path: ctest/ctest-results-${{ matrix.python-version }}.json +# if: ${{ always() }} +# +# build-windows: +# name: Build Windows +# runs-on: windows-2019 +# strategy: +# matrix: +# python-version: ["3.9"] +# permissions: +# actions: read +# contents: read +# security-events: write +# env: +# MPLBACKEND: agg +# steps: +# - name: Checkout code +# uses: nschloe/action-checkout-with-lfs-cache@v1 +# - name: Set up Python ${{ matrix.python-version }} +# uses: actions/setup-python@v4 +# with: +# python-version: ${{ matrix.python-version }} +# cache: 'pip' +# cache-dependency-path: '**/bskPkgRequired.txt' +# - name: Choco help +# uses: crazy-max/ghaction-chocolatey@v2 +# with: +# args: -h +# - name: "Install swig and cmake" +# shell: pwsh +# run: choco install swig cmake -y +# - name: "Create python virtual env" +# shell: pwsh +# run: python -m venv venv +# - name: "Install wheel and conan package" +# shell: pwsh +# run: | +# venv\Scripts\activate +# pip install wheel conan==1.61.0 parse six pytest-xdist +# - name: "Add basilisk and cmake path to env path" +# shell: pwsh +# run: | +# $oldpath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).path +# $newpath = “$oldpath;${{ env.GITHUB_WORKSPACE }}\dist3\Basilisk;C:\Program Files\CMake\bin” +# Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $newPath +# - name: "Build basilisk" +# shell: pwsh +# run: | +# venv\Scripts\activate +# python conanfile.py --opNav True +# - name: "Test Simulation Python" +# shell: pwsh +# run: | +# Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name MPLBACKEND -Value ${MPLBACKEND} +# venv\Scripts\activate +# cd src\simulation +# (Get-ChildItem -Directory).FullName | ForEach-Object { cd $_; pytest -n 2 -m "not scenarioTest"; if(($LastExitCode -ne 0) -and ($LastExitCode -ne 5)) {exit 1}} +# - name: "Python Architecture Tests" +# shell: pwsh +# run: | +# venv\Scripts\activate +# cd src\architecture +# (Get-ChildItem -Directory).FullName | ForEach-Object { cd $_; pytest -n 2; if(($LastExitCode -ne 0) -and ($LastExitCode -ne 5)) {exit 1}} +# - name: "Python FswAlgorithms Tests" +# shell: pwsh +# run: | +# venv\Scripts\activate +# cd src\fswAlgorithms +# (Get-ChildItem -Directory).FullName | ForEach-Object { cd $_; pytest -n 2; if(($LastExitCode -ne 0) -and ($LastExitCode -ne 5)) {exit 1}} +# - name: "C/C++ Tests" +# shell: pwsh +# run: | +# cd dist3 +# ctest --gtest_output "json:../ctest/ctest-results-windows-${{ matrix.python-version }}.json"; if(($LastExitCode -ne 0) -and ($LastExitCode -ne 5)) {exit 1} diff --git a/docs/source/bskPkgOptions.txt b/docs/source/bskPkgOptions.txt index 2ce2792b63..3fda0958fe 100644 --- a/docs/source/bskPkgOptions.txt +++ b/docs/source/bskPkgOptions.txt @@ -1,8 +1,10 @@ -``sphinx<5.0`` -``breathe`` -``sphinx_rtd_theme==0.5.1`` -``recommonmark`` -``pytest-xdist`` -``pytest-html`` -``pytest-html`` -``docutils`` \ No newline at end of file +sphinx<5.0 +breathe +sphinx_rtd_theme==0.5.1 +recommonmark +pytest-xdist +pytest-html +pytest-html +docutils +numpy +matplotlib \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index ff0d7da97d..49c63d419d 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -95,11 +95,11 @@ # further. For a list of options available for each theme, see the # documentation. html_theme_options = { - 'style_nav_header_background': '#CFB87C' + # 'style_nav_header_background': '#CFB87C' } html_context = { - 'css_files': ['_static/css/custom.css'] + # 'css_files': ['_static/css/custom.css'] } html_logo = "./_images/static/Basilisk-Logo.png" diff --git a/examples/scenarioFlybyPoint.py b/examples/scenarioFlybyPoint.py index 591de07448..941bd50e58 100755 --- a/examples/scenarioFlybyPoint.py +++ b/examples/scenarioFlybyPoint.py @@ -189,12 +189,12 @@ def run(show_plots, zeroEarthGravity, dtFilterData): # se tup flybyPoint guidance module flybyGuid = flybyPoint.FlybyPoint() flybyGuid.ModelTag = "flybyPoint" - flybyGuid.dtFilterData = dtFilterData - flybyGuid.signOfOrbitNormalFrameVector = -1 + flybyGuid.setTimeBetweenFilterData(dtFilterData) + flybyGuid.setSignOfOrbitNormalFrameVector(-1) scSim.AddModelToTask(simTaskName, flybyGuid) cameraAxis_B = np.array([0, 1, 0]) - outOfPlaneAxis_B = np.array([flybyGuid.signOfOrbitNormalFrameVector, 0, 0]) + outOfPlaneAxis_B = np.array([flybyGuid.getSignOfOrbitNormalFrameVector(), 0, 0]) crossProductAxis_B = np.cross(cameraAxis_B, outOfPlaneAxis_B) R0R = np.array([-cameraAxis_B, crossProductAxis_B, @@ -302,7 +302,7 @@ def run(show_plots, zeroEarthGravity, dtFilterData): ur = dataPos[i] / np.linalg.norm(dataPos[i]) uh = np.cross(dataPos[i], dataVel[i]) / np.linalg.norm(np.cross(dataPos[i], dataVel[i])) ut = np.cross(uh, ur) - if flybyGuid.signOfOrbitNormalFrameVector == -1: + if flybyGuid.getSignOfOrbitNormalFrameVector() == -1: uh = np.cross(ut, ur) BN = rbk.MRP2C(att[i]) NB = BN.transpose()