diff --git a/.github/actions/publish/action.yml b/.github/actions/publish/action.yml index d2c92014..24ad7624 100644 --- a/.github/actions/publish/action.yml +++ b/.github/actions/publish/action.yml @@ -11,7 +11,6 @@ inputs: runs: using: 'composite' steps: - - uses: actions/checkout@v3 - uses: ./.github/actions/sierra-setup - name: Build package shell: bash @@ -38,7 +37,7 @@ runs: uses: pypa/gh-action-pypi-publish@release/v1 with: - skip_existing: true + skip-existing: true user: __token__ password: ${{ inputs.testpypi-token }} repository_url: https://test.pypi.org/legacy/ diff --git a/.github/actions/sample-project-setup/action.yml b/.github/actions/sample-project-setup/action.yml index 02dbaeef..552ca96c 100644 --- a/.github/actions/sample-project-setup/action.yml +++ b/.github/actions/sample-project-setup/action.yml @@ -7,18 +7,26 @@ inputs: rosdistro: description: 'The version of ROS to test with' default: 'noetic' -# outputs: -# time: # id of output -# description: 'The time we greeted you' + runs: using: 'composite' steps: + ############################################################################ + # Common setup + ############################################################################ + - name: Setup python (all OSes) + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + - name: Clone sample project shell: bash - working-directory: ../../ + working-directory: ${{ github.workspace }} # Needed to match with scripts/argos-integration-tests.sh + run: | if [ ! -d sierra-sample-project ]; then - git clone https://github.com/swarm-robotics/sierra-sample-project.git + git clone https://github.com/jharwell/sierra-sample-project.git cd sierra-sample-project else cd sierra-sample-project @@ -30,46 +38,73 @@ runs: uses: SimenB/github-actions-cpu-cores@v1 id: cpu-cores + - uses: kenchan0130/actions-system-info@master + id: system-info + + - name: Cache build files + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: ${{ runner.os }}-${{ steps.system-info.outputs.release }}-build-objects + verbose: 0 + ############################################################################ # ARGoS setup ############################################################################ - - name: Install ARGoS dependencies - shell: bash - working-directory: ../../ - run: | - # 2023/01/16: || true needed because homebrew installation of whatever - # dependencies these packages requires manual intervention to fix, and I - # don't have a mac. - if [ "${{ runner.os }}" == "macOS" ]; then - brew install pkg-config cmake libpng freeimage lua qt \ - docbook asciidoc graphviz doxygen|| true - elif [ "${{ runner.os }}" == "Linux" ]; then - sudo apt-get update - sudo apt-get install cmake libfreeimage-dev libfreeimageplus-dev \ - qt5-default freeglut3-dev libxi-dev libxmu-dev liblua5.3-dev \ - lua5.3 doxygen graphviz libgraphviz-dev asciidoc - fi + - uses: nick-fields/retry@v2 + name: Install ARGoS deps (OSX) + if: runner.os == 'macOS' + with: + timeout_minutes: 10000 + max_attempts: 3 + shell: bash + command: | + # 2023/01/16: Caching doesn't work reliably, for reasons unknown :-(. + # + # The {xquartz, mactex, qt} deps are not required as long as the ARGoS + # integration tests for OSX don't run stage 4+ or try to do video + # capture. Installing them takes ~30 min in github actions, so cutting + # this particular corner saves a TON of time. + # + # Note that by omitting Xquartz you MUST also omit Qt, otherwise CI + # fails (I think ARGoS segfaults). + brew install pkg-config cmake libpng freeimage lua + + - name: Install and cache ARGoS dependencies (Linux) + if: runner.os == 'Linux' + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: libfreeimage-dev libfreeimageplus-dev qtbase5-dev freeglut3-dev libxi-dev libxmu-dev liblua5.3-dev lua5.3 libgraphviz-dev ccache + version: ${{ runner.os }} - name: Install ARGoS if: inputs.platform == 'argos' shell: bash - working-directory: ../../ run: | git clone https://github.com/ilpincy/argos3.git cd argos3 + mkdir -p build && cd build - cmake -DARGOS_DOCUMENTATION=OFF ../src + cmake \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DARGOS_DOCUMENTATION=OFF \ + ../src make -j ${{ steps.cpu-cores.outputs.count }} sudo make install - name: Build SIERRA project for ARGoS if: inputs.platform == 'argos' - working-directory: ../../ shell: bash + working-directory: ${{ github.workspace }} # Needed to match with scripts/argos-integration-tests.sh + run: | cd sierra-sample-project/argos mkdir -p build && cd build - cmake -DARGOS_INSTALL_DIR=/usr/local .. + cmake \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DARGOS_INSTALL_DIR=/usr/local \ + .. make -j ${{ steps.cpu-cores.outputs.count }} ############################################################################ @@ -77,43 +112,48 @@ runs: ############################################################################ - name: Install ROS1 platform dependency if: inputs.platform == 'ros1gazebo' - uses: ros-tooling/setup-ros@v0.3 + uses: ros-tooling/setup-ros@v0.7 with: required-ros-distributions: ${{ inputs.rosdistro }} - - name: Install SIERRA ROSbridge dependencies + - name: Install SIERRA ROSbridge system dependencies (Linux) + if: inputs.platform == 'ros1gazebo' + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: ros-${{ inputs.rosdistro }}-desktop-full ros-${{ inputs.rosdistro }}-turtlebot3-description ros-${{ inputs.rosdistro }}-turtlebot3-msgs ros-${{ inputs.rosdistro }}-turtlebot3-gazebo ros-${{ inputs.rosdistro }}-turtlebot3-bringup python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv python3-apt python3-cairo intltool python3-wheel python3-rospkg python3-empy + version: ${{ runner.os }} + + - name: Install SIERRA ROSbridge python dependencies (Linux) if: inputs.platform == 'ros1gazebo' - working-directory: ../.. shell: bash run: | - sudo apt-get install ros-${{ inputs.rosdistro }}-desktop-full - sudo apt-get install ros-${{ inputs.rosdistro }}-turtlebot3-description - sudo apt-get install ros-${{ inputs.rosdistro }}-turtlebot3-msgs - sudo apt-get install ros-${{ inputs.rosdistro }}-turtlebot3-gazebo - sudo apt-get install ros-${{ inputs.rosdistro }}-turtlebot3-bringup - sudo apt-get install python${{ matrix.python-version }} python${{ matrix.python-version }}-dev - sudo apt-get install python${{ matrix.python-version }}-venv python3-apt - sudo apt-get install python3-pip python3-cairo intltool python3-wheel python3-rospkg python3-empy - # 2023/1/18: You still need install these even after installing stuff # with apt AND if the sysem python matches your current python. I don't # know why. - pip3 install empy - pip3 install rospkg wheel pyparsing pyqt5 - pip3 install pyqt5 pysip numpy rospkg - pip3 install matplotlib pyyaml psutil - pip3 install pysip defusedxml pyparsing pydev - pip3 install pyopengl opencv-python + pip3 install empy \ + rospkg \ + wheel \ + pyparsing \ + pyqt5 \ + pysip \ + numpy \ + matplotlib \ + pyyaml \ + psutil \ + defusedxml \ + pyparsing \ + pydev \ + pyopengl \ + opencv-python \ + catkin_tools - name: Install SIERRA ROSBridge dependency (ubuntu) if: inputs.platform == 'ros1gazebo' - working-directory: ../.. shell: bash run: | source /opt/ros/${{ inputs.rosdistro }}/setup.bash - pip3 install catkin_tools - git clone https://github.com/swarm-robotics/sierra_rosbridge.git + git clone https://github.com/jharwell/sierra_rosbridge.git cd sierra_rosbridge git checkout devel catkin init diff --git a/.github/actions/sierra-setup/action.yml b/.github/actions/sierra-setup/action.yml index 616b178e..9db7c8dc 100644 --- a/.github/actions/sierra-setup/action.yml +++ b/.github/actions/sierra-setup/action.yml @@ -1,45 +1,53 @@ name: 'Setup SIERRA' description: 'Setup SIERRA for CI and testing' -# inputs: - # who-to-greet: # id of input - # description: 'Who to greet' - # required: true - # default: 'World' -# outputs: -# time: # id of output -# description: 'The time we greeted you' runs: using: 'composite' steps: + ############################################################################ + # Common setup + ############################################################################ + - name: Setup python (all OSes) + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + + - name: Install python packages (all OSes) + shell: bash + run: | + python3 -m pip install wheel + python3 -m pip install -r docs/requirements.txt + + - uses: kenchan0130/actions-system-info@master + id: system-info + ############################################################################ # Ubuntu setup ############################################################################ - - name: Setup python (ubuntu) - uses: actions/setup-python@v4 + - name: Install+cache system packages (ubuntu) if: runner.os == 'Linux' + uses: awalsh128/cache-apt-pkgs-action@latest with: - python-version: ${{ matrix.python-version }} + packages: parallel cm-super dvipng pssh ffmpeg xvfb + version: ${{ runner.os }} - - name: Install system deps (ubuntu) + # 2024/09/24: Needed because caching + texlive don't play well + # together. There IS an "install texlive" action, but that requires manual + # specification of all packages needed, and it seem easier to just use the + # package manager to recursively pull in everything I would need. + - name: Install system packages (redundant, ubuntu) if: runner.os == 'Linux' shell: bash run: | - sudo apt-get update - sudo apt-get install parallel cm-super texlive-fonts-recommended - sudo apt-get install texlive-latex-extra dvipng pssh ffmpeg xvfb - python3 -m pip install --upgrade pip - python3 -m pip install wheel + sudo apt-get install -y texlive-fonts-recommended texlive-latex-extra ############################################################################ # OSX setup ############################################################################ - - - name: Setup python (OSX) - uses: actions/setup-python@v4 + - name: Enable homebrew (OSX) if: runner.os == 'macOS' - with: - python-version: ${{ matrix.python-version }} + uses: Homebrew/actions/setup-homebrew@master - uses: nick-fields/retry@v2 name: Install system deps (OSX) @@ -49,14 +57,7 @@ runs: max_attempts: 3 shell: bash command: | - # 2023/01/16: || true needed because homebrew installation of whatever - # dependencies these packages requires manual intervention to fix, and I - # don't have a mac. - brew update && brew install parallel pssh ffmpeg - brew update && brew install --cask mactex - brew update && brew install --cask xquartz - python -m pip install --upgrade pip - python -m pip install wheel + brew install parallel pssh ############################################################################ # SIERRA install @@ -64,7 +65,6 @@ runs: - name: Install SIERRA shell: bash run: | - python3 -m pip install -r docs/requirements.txt cd docs && make man && cd .. python3 -m pip install . python3 -m pip install .[devel] diff --git a/.github/workflows/analysis-top.yml b/.github/workflows/analysis-top.yml new file mode 100644 index 00000000..193f560d --- /dev/null +++ b/.github/workflows/analysis-top.yml @@ -0,0 +1,37 @@ +name: Analysis Top-level + +# Run: +# +# - Every month. Scheduling helps keep drift/issues with updates +# to runners at bay. +# - On pushes. +on: + push: + paths: + - 'sierra/**' + + schedule: + - cron: '0 0 1 * *' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + analyze-ci-ubuntu-2004: + uses: ./.github/workflows/analyze-nox.yml + secrets: inherit + with: + os: ubuntu-20.04 + + analyze-ci-ubuntu-2204: + uses: ./.github/workflows/analyze-nox.yml + secrets: inherit + with: + os: ubuntu-22.04 + + analyze-ci-osx: + uses: ./.github/workflows/analyze-nox.yml + secrets: inherit + with: + os: macos-13 diff --git a/.github/workflows/analyze-nox.yml b/.github/workflows/analyze-nox.yml new file mode 100644 index 00000000..b1b13d72 --- /dev/null +++ b/.github/workflows/analyze-nox.yml @@ -0,0 +1,47 @@ +name: OS Static Analysis + +on: + workflow_call: + inputs: + os: + required: True + type: string + +jobs: + nox: + runs-on: ${{ inputs.os }} + strategy: + matrix: + os: + - ${{ inputs.os }} + + # 2024/08/26: Test the earliest and latest supported version, to speed + # up CI. + python-version: + - 3.8 + - 3.11 + + session: + - lint + - docs + - analyze_pytype + - analyze_mypy + + exclude: + - python-version: 3.11 + os: ubuntu-20.04 + + - python-version: 3.8 + os: ubuntu-22.04 + + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/sierra-setup + - uses: kenchan0130/actions-system-info@master + id: system-info + + - name: Run nox + run: | + nox \ + --pythons ${{ matrix.python-version }} \ + --sessions ${{ matrix.session }} diff --git a/.github/workflows/argos.yml b/.github/workflows/argos.yml deleted file mode 100644 index 0366ab59..00000000 --- a/.github/workflows/argos.yml +++ /dev/null @@ -1,177 +0,0 @@ -# Only stuff that actually tests the platform should be here: stage 1 and 2. -name: ARGoS CI Tests - -on: - workflow_call: - inputs: - os: - required: True - type: string - -jobs: - bc-univar-sanity: - runs-on: ${{ inputs.os }} - strategy: - matrix: - python-version: - - 3.8 - - 3.9 - - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/sierra-setup - - uses: ./.github/actions/sample-project-setup - with: - platform: argos - - - uses: nick-fields/retry@v2 - name: Integration tests - with: - timeout_minutes: 3600 - max_attempts: 3 - shell: bash - command: ./scripts/argos-integration-tests.sh -f bc_univar_sanity_test - - - uses: actions/upload-artifact@v3 - with: - name: ci-platform-argos-bc-univar-sanity-${{ runner.os }}-${{ matrix.python-version }}-coverage - path: .coverage.* - - physics-engines: - runs-on: ${{ inputs.os }} - strategy: - matrix: - python-version: - - 3.8 - - 3.9 - - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/sierra-setup - - uses: ./.github/actions/sample-project-setup - with: - platform: argos - - - uses: nick-fields/retry@v2 - name: Integration tests - with: - timeout_minutes: 3600 - max_attempts: 3 - shell: bash - command: ./scripts/argos-integration-tests.sh -f physics_engines_test - - - uses: actions/upload-artifact@v3 - with: - name: ci-platform-argos-physics-engines-${{ runner.os }}-${{ matrix.python-version }}-coverage - path: .coverage.* - - stage1-univar: - runs-on: ${{ inputs.os }} - strategy: - matrix: - python-version: - - 3.8 - - 3.9 - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/sierra-setup - - uses: ./.github/actions/sample-project-setup - with: - platform: argos - - - uses: nick-fields/retry@v2 - name: Integration tests - with: - timeout_minutes: 3600 - max_attempts: 3 - shell: bash - command: ./scripts/argos-integration-tests.sh -f stage1_univar_test - - - uses: actions/upload-artifact@v3 - with: - name: ci-platform-argos-stage1-${{ runner.os }}-${{ matrix.python-version }}-coverage - path: .coverage.* - - stage2-univar: - runs-on: ${{ inputs.os }} - strategy: - matrix: - python-version: - - 3.8 - - 3.9 - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/sierra-setup - - uses: ./.github/actions/sample-project-setup - with: - platform: argos - - - uses: nick-fields/retry@v2 - name: Integration tests - with: - timeout_minutes: 3600 - max_attempts: 3 - shell: bash - command: ./scripts/argos-integration-tests.sh -f stage2_univar_test -e hpc.local - - - uses: actions/upload-artifact@v3 - with: - name: ci-platform-argos-stage2-${{ runner.os }}-${{ matrix.python-version }}-coverage - path: .coverage.* - - - visual-capture: - runs-on: ${{ inputs.os }} - strategy: - matrix: - python-version: - - 3.8 - - 3.9 - - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/sierra-setup - - uses: ./.github/actions/sample-project-setup - with: - platform: argos - - - uses: nick-fields/retry@v2 - name: Integration tests - with: - timeout_minutes: 3600 - max_attempts: 3 - shell: bash - command: ./scripts/argos-integration-tests.sh -f vc_test - - - uses: actions/upload-artifact@v3 - with: - name: ci-platform-argos-vc-${{ runner.os }}-${{ matrix.python-version }}-coverage - path: .coverage.* - - cmdline: - runs-on: ${{ inputs.os }} - strategy: - matrix: - python-version: - - 3.8 - - 3.9 - - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/sierra-setup - - uses: ./.github/actions/sample-project-setup - with: - platform: argos - - - uses: nick-fields/retry@v2 - name: Integration tests - with: - timeout_minutes: 3600 - max_attempts: 3 - shell: bash - command: ./scripts/argos-integration-tests.sh -f cmdline_test - - - uses: actions/upload-artifact@v3 - with: - name: ci-platform-argos-cmdline-${{ runner.os }}-${{ matrix.python-version }}-coverage - path: .coverage.* diff --git a/.github/workflows/sierra-core.yml b/.github/workflows/core.yml similarity index 52% rename from .github/workflows/sierra-core.yml rename to .github/workflows/core.yml index 041cdebc..8a782a8a 100644 --- a/.github/workflows/sierra-core.yml +++ b/.github/workflows/core.yml @@ -8,41 +8,29 @@ on: type: string jobs: - cmdline-opts: + argos: runs-on: ${{ inputs.os }} strategy: matrix: + os: + - ${{ inputs.os }} + + # 2024/08/26: Test the earliest and latest supported version, to speed + # up CI. python-version: - 3.8 - - 3.9 - - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/sierra-setup - - uses: ./.github/actions/sample-project-setup - with: - platform: argos + - 3.11 - - uses: nick-fields/retry@v2 - name: Cmdline options - with: - timeout_minutes: 3600 - max_attempts: 3 - shell: bash - command: ./scripts/core-integration-tests.sh -f cmdline_opts_test + function: + - cmdline_opts_test + - env_vars_test - - uses: actions/upload-artifact@v3 - with: - name: ci-core-cmdline-opts-${{ runner.os }}-${{ matrix.python-version }}-coverage - path: .coverage.* + exclude: + - python-version: 3.11 + os: ubuntu-20.04 - env-vars: - runs-on: ${{ inputs.os }} - strategy: - matrix: - python-version: - - 3.8 - - 3.9 + - python-version: 3.8 + os: ubuntu-22.04 steps: - uses: actions/checkout@v3 @@ -52,111 +40,146 @@ jobs: platform: argos - uses: nick-fields/retry@v2 - name: Environment variables with: timeout_minutes: 3600 max_attempts: 3 shell: bash - command: ./scripts/core-integration-tests.sh -f env_vars_test + command: ./scripts/core-integration-tests.sh -f ${{ matrix.function }} - uses: actions/upload-artifact@v3 with: - name: ci-core-env-vars-${{ runner.os }}-${{ matrix.python-version }}-coverage + name: ci-core-${{ matrix.function }}-${{ runner.os }}-${{ matrix.python-version }}-coverage path: .coverage.* + include-hidden-files: true + if-no-files-found: error + + bc-bivar-sanity: runs-on: ${{ inputs.os }} strategy: matrix: + os: + - ${{ inputs.os }} + + platform: + - argos + - ros1gazebo + python-version: - 3.8 - 3.9 + exclude: + - os: ubuntu-22.04 + platform: ros1gazebo + steps: - uses: actions/checkout@v3 - uses: ./.github/actions/sierra-setup - uses: ./.github/actions/sample-project-setup + if: matrix.platform == 'argos' with: platform: argos - uses: ./.github/actions/sample-project-setup - if: runner.os == 'Linux' + if: matrix.platform == 'ros1gazebo' with: platform: ros1gazebo rosdistro: noetic - uses: nick-fields/retry@v2 - name: Bivariate batch criteria sanity (ARGoS) + name: Bivariate batch criteria sanity (${{ matrix.platform }}) with: timeout_minutes: 3600 max_attempts: 3 shell: bash - command: ./scripts/argos-integration-tests.sh -f bc_bivar_sanity_test + command: ./scripts/${{ matrix.platform }}-integration-tests.sh -f bc_bivar_sanity_test - - uses: nick-fields/retry@v2 - if: runner.os == 'Linux' - name: Bivariate batch criteria sanity (ROS1+Gazebo) - with: - timeout_minutes: 3600 - max_attempts: 3 - shell: bash - command: ./scripts/ros1gazebo-integration-tests.sh -f bc_bivar_sanity_test - uses: actions/upload-artifact@v3 with: - name: ci-core-bc-bivar-sanity-${{ runner.os }}-${{ matrix.python-version }}-coverage + name: ci-core-${{ matrix.platform }}-bc-bivar-sanity-${{ runner.os }}-${{ matrix.python-version }}-coverage path: .coverage.* + include-hidden-files: true + if-no-files-found: error stage1-bivar: runs-on: ${{ inputs.os }} strategy: matrix: + os: + - ${{ inputs.os }} + + # 2024/08/26: Test the earliest and latest supported version, to speed + # up CI. python-version: - 3.8 - - 3.9 + - 3.11 + + platform: + - argos + - ros1gazebo + + exclude: + - python-version: 3.11 + os: ubuntu-20.04 + + - python-version: 3.8 + os: ubuntu-22.04 + + - os: ubuntu-22.04 + platform: ros1gazebo steps: - uses: actions/checkout@v3 - uses: ./.github/actions/sierra-setup - uses: ./.github/actions/sample-project-setup + if: matrix.platform == 'argos' with: platform: argos - uses: ./.github/actions/sample-project-setup - if: runner.os == 'Linux' + if: matrix.platform == 'ros1gazebo' with: platform: ros1gazebo rosdistro: noetic - uses: nick-fields/retry@v2 - name: Bivariate batch criteria stage 1 (ARGoS) - with: - timeout_minutes: 3600 - max_attempts: 3 - shell: bash - command: ./scripts/argos-integration-tests.sh -f stage1_bivar_test - - - uses: nick-fields/retry@v2 - if: runner.os == 'Linux' - name: Bivariate batch criteria stage 1 (ROS1+Gazebo) + name: Bivariate batch criteria stage 1 (${{ matrix.platform }} with: timeout_minutes: 3600 max_attempts: 3 shell: bash - command: ./scripts/ros1gazebo-integration-tests.sh -f stage1_bivar_test + command: ./scripts/${{ matrix.platform }}-integration-tests.sh -f stage1_bivar_test - uses: actions/upload-artifact@v3 with: - name: ci-core-stage1-bivar-${{ runner.os }}-${{ matrix.python-version }}-coverage + name: ci-core-${{ matrix.platform }}-stage1-bivar-${{ runner.os }}-${{ matrix.python-version }}-coverage path: .coverage.* + include-hidden-files: true + if-no-files-found: error stage3-univar: runs-on: ${{ inputs.os }} strategy: matrix: + os: + - ${{ inputs.os }} + + # 2024/08/26: Test the earliest and latest supported version, to speed + # up CI. python-version: - 3.8 - - 3.9 + - 3.11 + + exclude: + - python-version: 3.11 + os: ubuntu-20.04 + + - python-version: 3.8 + os: ubuntu-22.04 + steps: - uses: actions/checkout@v3 - uses: ./.github/actions/sierra-setup @@ -174,16 +197,31 @@ jobs: - uses: actions/upload-artifact@v3 with: - name: ci-core-stage3-univar-${{ runner.os }}-${{ matrix.python-version }}-coverage + name: ci-core-argos-stage3-univar-${{ runner.os }}-${{ matrix.python-version }}-coverage path: .coverage.* + include-hidden-files: true + if-no-files-found: error stage3-bivar: runs-on: ${{ inputs.os }} strategy: matrix: + os: + - ${{ inputs.os }} + + # 2024/08/26: Test the earliest and latest supported version, to speed + # up CI. python-version: - 3.8 - - 3.9 + - 3.11 + + exclude: + - python-version: 3.11 + os: ubuntu-20.04 + + - python-version: 3.8 + os: ubuntu-22.04 + steps: - uses: actions/checkout@v3 - uses: ./.github/actions/sierra-setup @@ -201,16 +239,31 @@ jobs: - uses: actions/upload-artifact@v3 with: - name: ci-core-stage3-univar-${{ runner.os }}-${{ matrix.python-version }}-coverage + name: ci-core-argos-stage3-univar-${{ runner.os }}-${{ matrix.python-version }}-coverage path: .coverage.* + include-hidden-files: true + if-no-files-found: error stage4-univar: runs-on: ${{ inputs.os }} strategy: matrix: + os: + - ${{ inputs.os }} + + # 2024/08/26: Test the earliest and latest supported version, to speed + # up CI. python-version: - 3.8 - - 3.9 + - 3.11 + + exclude: + - python-version: 3.11 + os: ubuntu-20.04 + + - python-version: 3.8 + os: ubuntu-22.04 + steps: - uses: actions/checkout@v3 - uses: ./.github/actions/sierra-setup @@ -228,16 +281,30 @@ jobs: - uses: actions/upload-artifact@v3 with: - name: ci-core-stage4-univar-${{ runner.os }}-${{ matrix.python-version }}-coverage + name: ci-core-argos-stage4-univar-${{ runner.os }}-${{ matrix.python-version }}-coverage path: .coverage.* + include-hidden-files: true stage5-univar: runs-on: ${{ inputs.os }} strategy: matrix: + os: + - ${{ inputs.os }} + + # 2024/08/26: Test the earliest and latest supported version, to speed + # up CI. python-version: - 3.8 - - 3.9 + - 3.11 + + exclude: + - python-version: 3.11 + os: ubuntu-20.04 + + - python-version: 3.8 + os: ubuntu-22.04 + steps: - uses: actions/checkout@v3 - uses: ./.github/actions/sierra-setup @@ -255,16 +322,32 @@ jobs: - uses: actions/upload-artifact@v3 with: - name: ci-core-stage5-univar-${{ runner.os }}-${{ matrix.python-version }}-coverage + name: ci-core-argos-stage5-univar-${{ runner.os }}-${{ matrix.python-version }}-coverage path: .coverage.* + include-hidden-files: true + if-no-files-found: error stage5-bivar: runs-on: ${{ inputs.os }} strategy: matrix: + + os: + - ${{ inputs.os }} + + # 2024/08/26: Test the earliest and latest supported version, to speed + # up CI. python-version: - 3.8 - - 3.9 + - 3.11 + + exclude: + - python-version: 3.11 + os: ubuntu-20.04 + + - python-version: 3.8 + os: ubuntu-22.04 + steps: - uses: actions/checkout@v3 - uses: ./.github/actions/sierra-setup @@ -273,7 +356,7 @@ jobs: platform: argos - uses: nick-fields/retry@v2 - name: Stage5 univariate tests + name: Stage5 bivariate tests with: timeout_minutes: 3600 max_attempts: 3 @@ -282,5 +365,7 @@ jobs: - uses: actions/upload-artifact@v3 with: - name: ci-core-stage5-bivar-${{ runner.os }}-${{ matrix.python-version }}-coverage + name: ci-core-argos-stage5-bivar-${{ runner.os }}-${{ matrix.python-version }}-coverage path: .coverage.* + include-hidden-files: true + if-no-files-found: error diff --git a/.github/workflows/coverage-top.yml b/.github/workflows/coverage-top.yml new file mode 100644 index 00000000..4d9a9c93 --- /dev/null +++ b/.github/workflows/coverage-top.yml @@ -0,0 +1,117 @@ +name: Coverage Top-level + +# Run: +# +# - Every month. Scheduling helps keep drift/issues with updates +# to runners at bay. +# - On pushes. +# +on: + push: + paths: + - 'sierra/**' + + schedule: + - cron: '0 0 1 * *' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + # 2024/08/27: We don't test the core with OSX, because if it works on linux, + # it should work on OSX. Plus, the plugin tests utilize a lot of "core" + # functionality, it the core is already largely tested on OSX via that + # route. Plugins are another story, and are explicitly tested on OSX where + # feasible. + core-ci-ubuntu-2004: + uses: ./.github/workflows/core.yml + secrets: inherit + with: + os: ubuntu-20.04 + + core-ci-ubuntu-2204: + uses: ./.github/workflows/core.yml + secrets: inherit + with: + os: ubuntu-22.04 + + plugin-ci: + uses: ./.github/workflows/plugin.yml + secrets: inherit + + unit-tests: + uses: ./.github/workflows/unit-tests.yml + secrets: inherit + + publish: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: + - 3.8 + + needs: + - core-ci-ubuntu-2004 + - core-ci-ubuntu-2204 + - plugin-ci + + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/publish + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + pypi-token: ${{ secrets.PYPI_API_TOKEN }} + testpypi-token: ${{ secrets.TEST_PYPI_API_TOKEN }} + + coverage: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: + - 3.8 + + needs: + - core-ci-ubuntu-2004 + - plugin-ci + - unit-tests + + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/sierra-setup + - uses: actions/download-artifact@v4 + + - name: Generate coverage report + run: | + # ls -al . || true + # ls -al ci-*-Linux-${{ matrix.python-version }}-coverage/.* || true + # ls -al ci-*-Linux-${{ matrix.python-version }}-coverage/* || true + + echo HERE1 + find . -name "ci-*-Linux-${{ matrix.python-version }}-coverage*" + echo HERE2 + coverage \ + combine \ + $(find . -name "ci-*-Linux-${{ matrix.python-version }}-coverage*") + + coverage report --fail-under=80 + coverage xml + + - uses: actions/upload-artifact@v3 + with: + name: ci-integration-coverage + + path: .coverage + + - uses: actions/upload-artifact@v3 + with: + name: ci-integration-coverage-xml + path: coverage.xml + + - name: Coveralls + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + + run: | + coveralls diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml deleted file mode 100644 index fa423809..00000000 --- a/.github/workflows/coverage.yml +++ /dev/null @@ -1,101 +0,0 @@ -name: Coverage CI - -# Run: -# -# - Every month. Scheduling helps keep drift/issues with updates -# to runners at bay. -# - On pushes. -on: - push: - paths: - - 'sierra/**' - schedule: - - cron: '0 0 1 * *' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - argos-ci: - uses: ./.github/workflows/argos.yml - secrets: inherit - with: - os: ubuntu-20.04 - - ros1gazebo-ci: - uses: ./.github/workflows/ros1gazebo.yml - secrets: inherit - with: - os: ubuntu-20.04 - - sierra-core-ci: - uses: ./.github/workflows/sierra-core.yml - secrets: inherit - with: - os: ubuntu-20.04 - - ros1robot-ci: - uses: ./.github/workflows/ros1robot.yml - secrets: inherit - with: - os: ubuntu-20.04 - - exec-env-ci: - uses: ./.github/workflows/exec-env-plugins.yml - secrets: inherit - with: - os: ubuntu-20.04 - - unit-tests: - uses: ./.github/workflows/unit-tests.yml - secrets: inherit - with: - os: ubuntu-20.04 - - coverage: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: - - 3.8 - - needs: - - unit-tests - - argos-ci - - ros1gazebo-ci - - ros1robot-ci - - exec-env-ci - - sierra-core-ci - - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/sierra-setup - - uses: actions/download-artifact@v4.1.7 - - - name: Generate coverage report - run: | - - coverage combine ci-*-Linux-${{ matrix.python-version }}-coverage/.coverage.* ci-*-Linux-${{ matrix.python-version }}-coverage/.coverage - - coverage report - coverage xml - - - uses: actions/upload-artifact@v3 - with: - name: ci-integration-coverage - - path: .coverage - - - uses: actions/upload-artifact@v3 - with: - name: ci-integration-coverage-xml - path: coverage.xml - - - name: Coveralls - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} - - run: | - coveralls diff --git a/.github/workflows/exec-env-plugins.yml b/.github/workflows/exec-env-plugins.yml deleted file mode 100644 index f0367572..00000000 --- a/.github/workflows/exec-env-plugins.yml +++ /dev/null @@ -1,81 +0,0 @@ -name: --exec-env plugin CI - -on: - workflow_call: - inputs: - os: - required: True - type: string - - # push: - # branches: - # # - master - # # - devel - # paths: - # - 'sierra/**' -jobs: - adhoc: - runs-on: ${{ inputs.os }} - strategy: - matrix: - # You CANNOT use python 3.9 with ubuntu 20.04 with ROS, because 3.8 is - # the system python and things just don't work otherwise... - python-version: - - 3.8 - - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/sierra-setup - - uses: ./.github/actions/sample-project-setup - with: - platform: argos - - - uses: ./.github/actions/sample-project-setup - with: - platform: ros1gazebo - rosdistro: noetic - - - name: Adhoc - run: | - ./scripts/argos-integration-tests.sh -f stage2_univar_test -e hpc.adhoc - ./scripts/ros1gazebo-integration-tests.sh -f stage2_univar_test -e hpc.adhoc - - - uses: actions/upload-artifact@v3 - with: - name: ci-exec-env-adhoc-${{ runner.os }}-${{ matrix.python-version }}-coverage - path: .coverage.* - - slurm: - runs-on: ${{ inputs.os }} - strategy: - matrix: - # You CANNOT use python 3.9 with ubuntu 20.04 with ROS, because 3.8 is - # the system python and things just don't work otherwise... - python-version: - - 3.8 - - steps: - - uses: actions/checkout@v3 - - - uses: ./.github/actions/sierra-setup - - - uses: ./.github/actions/slurm-setup - - - uses: ./.github/actions/sample-project-setup - with: - platform: argos - - - uses: ./.github/actions/sample-project-setup - with: - platform: ros1gazebo - rosdistro: noetic - - - name: SLURM - run: | - ./scripts/argos-integration-tests.sh -f stage2_univar_test -e hpc.slurm - ./scripts/ros1gazebo-integration-tests.sh -f stage2_univar_test -e hpc.slurm - - - uses: actions/upload-artifact@v3 - with: - name: ci-exec-env-slurm-${{ runner.os }}-${{ matrix.python-version }}-coverage - path: .coverage.* diff --git a/.github/workflows/integration-all.yml b/.github/workflows/integration-all.yml deleted file mode 100644 index 1e1cf6c2..00000000 --- a/.github/workflows/integration-all.yml +++ /dev/null @@ -1,95 +0,0 @@ -name: Integration Tests - -# Run: -# -# - Every month. Scheduling helps keep drift/issues with updates -# to runners at bay. -# - On pushes. -on: - push: - paths: - - 'sierra/**' - - schedule: - - cron: '0 0 1 * *' - -jobs: - sierra-core-ci-ubuntu: - uses: ./.github/workflows/sierra-core.yml - secrets: inherit - with: - os: ubuntu-20.04 - - sierra-core-ci-osx: - uses: ./.github/workflows/sierra-core.yml - secrets: inherit - with: - os: macos-12 - - argos-ci-ubuntu: - uses: ./.github/workflows/argos.yml - secrets: inherit - needs: - - sierra-core-ci-ubuntu - - with: - os: ubuntu-20.04 - - argos-ci-osx: - uses: ./.github/workflows/argos.yml - secrets: inherit - needs: - - sierra-core-ci-osx - with: - os: macos-12 - - - ros1gazebo-ci-ubuntu: - uses: ./.github/workflows/ros1gazebo.yml - secrets: inherit - needs: - - sierra-core-ci-ubuntu - - with: - os: ubuntu-20.04 - - ros1robot-ci-ubuntu: - uses: ./.github/workflows/ros1robot.yml - secrets: inherit - needs: - - sierra-core-ci-ubuntu - - with: - os: ubuntu-20.04 - - exec-env-ci-ubuntu: - uses: ./.github/workflows/exec-env-plugins.yml - secrets: inherit - needs: - - sierra-core-ci-ubuntu - - with: - os: ubuntu-20.04 - - publish: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: - - 3.8 - needs: - - argos-ci-ubuntu - - argos-ci-osx - - sierra-core-ci-ubuntu - - sierra-core-ci-osx - - ros1gazebo-ci-ubuntu - - ros1robot-ci-ubuntu - - exec-env-ci-ubuntu - - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/publish - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - pypi-token: ${{ secrets.PYPI_API_TOKEN }} - testpypi-token: ${{ secrets.TEST_PYPI_API_TOKEN }} diff --git a/.github/workflows/plugin.yml b/.github/workflows/plugin.yml new file mode 100644 index 00000000..9079eb87 --- /dev/null +++ b/.github/workflows/plugin.yml @@ -0,0 +1,223 @@ +# Only stuff that actually tests the platform should be here: stage 1 and 2. +name: Plugin CI + +on: + workflow_call: + +jobs: + plugin-argos: + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + working-directory: ${{ github.workspace }} + + strategy: + matrix: + os: + - ubuntu-20.04 + - ubuntu-22.04 + - macos-13 + + # 2024/08/26: Test the earliest and latest supported version, to speed + # up CI. + python-version: + - 3.8 + - 3.11 + + function: + - physics_engines_test + - vc_test + - cmdline_test + - bc_univar_sanity_test + - stage1_univar_test + - stage2_univar_test + - stage3_univar_test + - stage4_univar_test + - stage5_univar_test + - bc_bivar_sanity_test + - stage1_bivar_test + - stage2_bivar_test + - stage3_bivar_test + - stage5_bivar_test + + exclude: + - python-version: 3.11 + os: ubuntu-20.04 + + - python-version: 3.8 + os: ubuntu-22.04 + + - function: vc_test # this test takes FOREVER + os: macos-13 + + - function: cmdline # this test adds marginal confidence + os: macos-13 + + - function: physics_engines_test # this test adds marginal confidence + os: macos-13 + + - function: stage4_univar_test + os: macos-13 + + - function: stage5_univar_test + os: macos-13 + + - function: stage4_bivar_test + os: macos-13 + + - function: stage5_bivar_test + os: macos-13 + + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/sierra-setup + - uses: ./.github/actions/sample-project-setup + with: + platform: argos + + - uses: nick-fields/retry@v2 + name: Integration tests + with: + timeout_minutes: 3600 + max_attempts: 3 + command: ./scripts/argos-integration-tests.sh -f ${{ matrix.function }} -e hpc.local + + - uses: actions/upload-artifact@v4 + with: + name: ci-platform-argos-${{ matrix.function }}-${{ runner.os }}-${{ matrix.python-version }}-coverage + path: .coverage.* + include-hidden-files: true + if-no-files-found: error + + plugin-ros1robot: + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + working-directory: ${{ github.workspace }} + + strategy: + matrix: + python-version: + - 3.8 + + function: + - bc_univar_sanity_test + - stage1_test + + os: + - ubuntu-20.04 + + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/sierra-setup + - uses: ./.github/actions/sample-project-setup + with: + platform: ros1robot + rosdistro: noetic + + - name: Integration tests + run: | + ./scripts/ros1robot-integration-tests.sh -f ${{ matrix.function }} -e hpc.local + + - uses: actions/upload-artifact@v4 + with: + name: ci-platform-ros1robot-${{ matrix.function }}-${{ runner.os }}-${{ matrix.python-version }}-coverage + path: .coverage.* + include-hidden-files: true + if-no-files-found: error + + plugin-ros1gazebo: + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + working-directory: ${{ github.workspace }} + + strategy: + matrix: + # You CANNOT use python 3.9 with ubuntu 20.04 with ROS, because 3.8 is + # the system python and things just don't work otherwise... + python-version: + - 3.8 + + function: + - bc_univar_sanity_test + - stage2_univar_test + + os: + - ubuntu-20.04 + + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/sierra-setup + - uses: ./.github/actions/sample-project-setup + with: + platform: ros1gazebo + rosdistro: noetic + + - name: Integration tests + run: | + ./scripts/ros1gazebo-integration-tests.sh -f ${{ matrix.function }} -e hpc.local + + - uses: actions/upload-artifact@v4 + with: + name: ci-platform-ros1gazebo-${{ matrix.function }}-${{ runner.os }}-${{ matrix.python-version }}-coverage + path: .coverage.* + include-hidden-files: true + if-no-files-found: error + + plugin-exec-env: + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + working-directory: ${{ github.workspace }} + + strategy: + matrix: + # You CANNOT use python 3.9 with ubuntu 20.04 with ROS, because 3.8 is + # the system python and things just don't work otherwise... + python-version: + - 3.8 + + platform: + - argos + - ros1gazebo + + exec-env: + - hpc.adhoc + - hpc.slurm + + os: + - ubuntu-20.04 + + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/sierra-setup + - uses: ./.github/actions/sample-project-setup + if: matrix.platform == 'argos' + with: + platform: argos + + - uses: ./.github/actions/sample-project-setup + if: matrix.platform == 'ros1gazebo' + with: + platform: ros1gazebo + rosdistro: noetic + + - uses: ./.github/actions/slurm-setup + if: matrix.exec-env == 'hpc.slurm' + + - name: Integration Tests + if: matrix.platform != '' + run: | + ./scripts/${{ matrix.platform }}-integration-tests.sh -f stage2_univar_test -e ${{ matrix.exec-env }} + + - uses: actions/upload-artifact@v4 + with: + name: ci-${{ matrix.platform }}-${{ matrix.exec-env }}-${{ runner.os }}-${{ matrix.python-version }}-coverage + path: .coverage.* + include-hidden-files: true + if-no-files-found: error diff --git a/.github/workflows/ros1gazebo.yml b/.github/workflows/ros1gazebo.yml deleted file mode 100644 index 57b27d3a..00000000 --- a/.github/workflows/ros1gazebo.yml +++ /dev/null @@ -1,68 +0,0 @@ -# Only stuff that actually tests the platform should be here: stage 1 and 2. -name: ROS1+Gazebo CI Tests - -on: - workflow_call: - inputs: - os: - required: True - type: string - -jobs: - bc-univar-sanity: - runs-on: ${{ inputs.os }} - strategy: - matrix: - # You CANNOT use python 3.9 with ubuntu 20.04 with ROS, because 3.8 is - # the system python and things just don't work otherwise... - python-version: - - 3.8 - - steps: - - uses: actions/checkout@v3 - - - uses: ./.github/actions/sierra-setup - - - uses: ./.github/actions/sample-project-setup - with: - platform: ros1gazebo - rosdistro: noetic - - - name: Integration tests - shell: bash - run: | - ./scripts/ros1gazebo-integration-tests.sh -f bc_univar_sanity_test - - - uses: actions/upload-artifact@v3 - with: - name: ci-platform-ros1gazebo-bc-univar-sanity-${{ runner.os }}-${{ matrix.python-version }}-coverage - path: .coverage.* - - stage2-univar: - runs-on: ${{ inputs.os }} - strategy: - matrix: - # You CANNOT use python 3.9 with ubuntu 20.04 with ROS, because 3.8 is - # the system python and things just don't work otherwise... - python-version: - - 3.8 - - steps: - - uses: actions/checkout@v3 - - - uses: ./.github/actions/sierra-setup - - - uses: ./.github/actions/sample-project-setup - with: - platform: ros1gazebo - rosdistro: noetic - - - name: Integration tests - shell: bash - run: | - ./scripts/ros1gazebo-integration-tests.sh -f stage2_univar_test -e hpc.local - - - uses: actions/upload-artifact@v3 - with: - name: ci-platform-ros1gazebo-stage2-${{ runner.os }}-${{ matrix.python-version }}-coverage - path: .coverage.* diff --git a/.github/workflows/ros1robot.yml b/.github/workflows/ros1robot.yml deleted file mode 100644 index 3cde7a14..00000000 --- a/.github/workflows/ros1robot.yml +++ /dev/null @@ -1,66 +0,0 @@ -# Only stuff that actually tests the platform should be here: stage 1 and 2. -name: ROS1+Robot CI Tests - -on: - workflow_call: - inputs: - os: - required: True - type: string - -jobs: - bc-univar-sanity: - runs-on: ${{ inputs.os }} - strategy: - matrix: - python-version: - - 3.8 - - 3.9 - - steps: - - uses: actions/checkout@v3 - - - uses: ./.github/actions/sierra-setup - - - uses: ./.github/actions/sample-project-setup - with: - platform: ros1robot - rosdistro: noetic - - - name: Integration tests - shell: bash - run: | - ./scripts/ros1robot-integration-tests.sh -f bc_univar_sanity_test - - - uses: actions/upload-artifact@v3 - with: - name: ci-platform-ros1robot-bc-sanity-${{ runner.os }}-${{ matrix.python-version }}-coverage - path: .coverage.* - - stage1: - runs-on: ${{ inputs.os }} - strategy: - matrix: - python-version: - - 3.8 - - 3.9 - - steps: - - uses: actions/checkout@v3 - - - uses: ./.github/actions/sierra-setup - - - uses: ./.github/actions/sample-project-setup - with: - platform: ros1robot - rosdistro: noetic - - - name: Integration tests - shell: bash - run: | - ./scripts/ros1robot-integration-tests.sh -f stage1_test -e hpc.local - - - uses: actions/upload-artifact@v3 - with: - name: ci-platform-ros1robot-stage1-${{ runner.os }}-${{ matrix.python-version }}-coverage - path: .coverage.* diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml deleted file mode 100644 index 884ef641..00000000 --- a/.github/workflows/static-analysis.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Static Analysis - -# Run: -# -# - Every month. Scheduling helps keep drift/issues with updates -# to runners at bay. -# - On pushes. -on: - push: - paths: - - 'sierra/**' - schedule: - - cron: '0 0 1 * *' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - analyze: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: - - ubuntu-20.04 # ubuntu-latest, as of 8/22 - - macos-12 - - python-version: - - 3.8 - - 3.9 - - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/sierra-setup - - - name: Run nox - run: | - nox --pythons ${{ matrix.python-version }} --sessions lint analysis docs diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index f9537b80..cb7017bc 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -2,19 +2,29 @@ name: Unit Tests on: workflow_call: - inputs: - os: - required: True - type: string jobs: - unit-tests: - runs-on: ${{ inputs.os }} + ci-unit-tests: + runs-on: ${{ matrix.os }} strategy: matrix: + os: + - ubuntu-20.04 + - ubuntu-22.04 + - macos-13 + + # 2024/08/26: Test the earliest and latest supported version, to speed + # up CI. python-version: - 3.8 - - 3.9 + - 3.11 + + exclude: + - python-version: 3.11 + os: ubuntu-20.04 + + - python-version: 3.8 + os: ubuntu-22.04 steps: - uses: actions/checkout@v3 @@ -29,7 +39,9 @@ jobs: which python3 nox --pythons ${{ matrix.python-version }} --sessions unit_tests - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: ci-unit-tests-${{ runner.os }}-${{ matrix.python-version }}-coverage - path: .coverage + path: .coverage* + include-hidden-files: true + if-no-files-found: error diff --git a/.projectile b/.projectile index 76562727..d8478ef0 100755 --- a/.projectile +++ b/.projectile @@ -1,3 +1,7 @@ -/docs/_build -/sierra.egg-info -/dist +-*.nox +-*__pycache__ +-*.mypy_cache +-*.venv diff --git a/README.rst b/README.rst index 85d3388c..e7bd84c4 100755 --- a/README.rst +++ b/README.rst @@ -9,17 +9,13 @@ SIERRA (reSearch pIpEline for Reproducibility, Reusability, and Automation) :target: https://pypi.python.org/pypi/sierra-research/ .. |supported-pythons| image:: https://img.shields.io/pypi/pyversions/sierra-research.svg - :target: https://pypi.python.org/pypi/sierra-research/ -.. |linux-supported| image:: https://img.shields.io/badge/os-Linux-crimson -.. |osx-supported| image:: https://img.shields.io/badge/os-OSX-crimson +.. |os-supported| image:: https://img.shields.io/badge/os-linux%20%7C%20macOS-blue -.. |ci-integration-master| image:: https://github.com/jharwell/sierra/actions/workflows/integration-all.yml/badge.svg?branch=master -.. |ci-analysis-master| image:: https://github.com/jharwell/sierra/actions/workflows/static-analysis.yml/badge.svg?branch=master +.. |ci-analysis-master| image:: https://github.com/jharwell/sierra/actions/workflows/analysis-top.yml/badge.svg?branch=master .. |ci-coverage-master| image:: https://coveralls.io/repos/github/jharwell/sierra/badge.svg?branch=master -.. |ci-integration-devel| image:: https://github.com/jharwell/sierra/actions/workflows/integration-all.yml/badge.svg?branch=devel -.. |ci-analysis-devel| image:: https://github.com/jharwell/sierra/actions/workflows/static-analysis.yml/badge.svg?branch=devel +.. |ci-analysis-devel| image:: https://github.com/jharwell/sierra/actions/workflows/analysis-top.yml/badge.svg?branch=devel .. |ci-coverage-devel| image:: https://coveralls.io/repos/github/jharwell/sierra/badge.svg?branch=devel .. |license| image:: https://img.shields.io/badge/License-MIT-blue.svg @@ -31,24 +27,17 @@ SIERRA (reSearch pIpEline for Reproducibility, Reusability, and Automation) :target: https://sierra.readthedocs.io/en/master/ .. |maintenance| image:: https://img.shields.io/badge/Maintained%3F-yes-green.svg - :target: https://gitHub.com/jharwell/sierra/graphs/commit-activity -:Usage: - |pepy-downloads| |pypi-version| |supported-pythons| |linux-supported| - |osx-supported| - -:Release: - - |ci-analysis-master| |ci-integration-master| |ci-coverage-master| - -:Development: - - |ci-analysis-devel| |ci-integration-devel| |ci-coverage-devel| - -:Misc: - - |license| |doi| |docs| |maintenance| ++---------------+--------------------------------------------------------------------+ +| Usage | |pepy-downloads| |pypi-version| |supported-pythons| |os-supported| | ++---------------+--------------------------------------------------------------------+ +| Release | |ci-analysis-master| |ci-coverage-master| | ++---------------+--------------------------------------------------------------------+ +| Development | |ci-analysis-devel| |ci-coverage-devel| | ++---------------+--------------------------------------------------------------------+ +| Miscellaneous | |license| |doi| |docs| |maintenance| | ++---------------+--------------------------------------------------------------------+ TL;DR diff --git a/docs/conf.py b/docs/conf.py index af8aede1..a5a3ddc5 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -159,11 +159,13 @@ "Hecker2015": ("Hecker2015", "https://www.cs.unm.edu/~wjust/CS523/S2018/Readings/Hecker_Beyond_Pheromones_Swarm_Intelligence.pdf"), "Rosenfeld2006": ("Rosenfeld2006", - "https://users.umiacs.umd.edu/~sarit/data/articles/rosenfeldetalbook06.pdf"), - "SIERRA_GITHUB": ("https://github.com/jharwell/sierra", - "https://github.com/jharwell/sierra"), - "SIERRA_SAMPLE_PROJECT": ("https://github.com/jharwell/sierra-sample-project", - "https://github.com/jharwell/sierra-sample-project"), + "http://users.umiacs.umd.edu/~sarit/data/articles/rosenfeldetalbook06.pdf"), + "SIERRA_GITHUB": ("https://github.com/jharwell/sierra.git", + "https://github.com/jharwell/sierra.git"), + "SIERRA_ROSBRIDGE": ("https://github.com/jharwell/sierra_rosbridge.git", + "https://github.com/jharwell/sierra_rosbridge.git"), + "SIERRA_SAMPLE_PROJECT": ("https://github.com/jharwell/sierra-sample-project.git", + "https://github.com/jharwell/sierra-sample-project.git"), "SIERRA_DOCS": ("https://sierra.readthedocs.io/en/master", "https://sierra.readthedocs.io/en/master"), "FORDYCA": ("FORDYCA", "https://swarm-robotics-fordyca.readthedocs.io"), diff --git a/docs/requirements.txt b/docs/requirements.txt index c3545c76..72106916 100755 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,7 +1,7 @@ -e . -sphinx==5.0.2 -docutils==0.18.1 +sphinx==6.0.0 +docutils==0.19 sphinx-rtd-theme sphinx-argparse sphinx-tabs diff --git a/docs/src/getting_started.rst b/docs/src/getting_started.rst index 9c434bf9..25d5361c 100755 --- a/docs/src/getting_started.rst +++ b/docs/src/getting_started.rst @@ -48,6 +48,7 @@ Basic Setup - ``pssh`` - ``ffmpeg`` - ``xvfb`` + - ``psmisc`` .. group-tab:: OSX diff --git a/docs/src/requirements.rst b/docs/src/requirements.rst index fde485eb..5fdb1cba 100644 --- a/docs/src/requirements.rst +++ b/docs/src/requirements.rst @@ -34,8 +34,8 @@ One of the following: Python Requirements =================== -Python 3.8+. Tested with 3.8-3.9. It may work for newer versions, probably won't -for older. +Python 3.8+. Tested with 3.8-3.10. It may work for newer versions, probably +won't for older. .. _ln-sierra-req-exp: diff --git a/docs/src/trial.rst b/docs/src/trial.rst index 01b625eb..356a43a9 100755 --- a/docs/src/trial.rst +++ b/docs/src/trial.rst @@ -30,6 +30,7 @@ you clone things somewhere else. - ``pssh`` - ``ffmpeg`` - ``xvfb`` + - ``psmisc`` .. group-tab:: OSX @@ -92,7 +93,7 @@ you clone things somewhere else. Where ```` is replaced by your ROS distro. - #. Install the `SIERRA ROSBridge `_:: + #. Install ROS bridge :xref:`SIERRA_ROSBRIDGE`:: pip3 install catkin_tools git clone https://github.com/jharwell/sierra_rosbridge.git diff --git a/docs/src/usage/examples.rst b/docs/src/usage/examples.rst index deaa6c45..7bacd976 100644 --- a/docs/src/usage/examples.rst +++ b/docs/src/usage/examples.rst @@ -171,8 +171,6 @@ Bivariate Batch Criteria Example This example shows how to use ARGoS with a bivariate batch criteria (i.e., with TWO variables/things you want to vary jointly):: -:: - sierra-cli \ --sierra-root=$HOME/exp \ --template-input-file=exp/your-experiment.argos \ @@ -354,8 +352,6 @@ Bivariate Batch Criteria Example This example shows how to use ROS1+gazebo with a bivariate batch criteria (i.e., with TWO variables/things you want to vary jointly):: -:: - sierra-cli \ --sierra-root=$HOME/exp \ --template-input-file=exp/your-experiment.argos \ @@ -390,8 +386,6 @@ Basic Example This examples shows the simplest way to use SIERRA with the ROS1+robot platform plugin:: -:: - sierra-cli \ --platform=platform.ros1robot \ --project=ros1robot_project \ diff --git a/docs/src/usage/subprograms.rst b/docs/src/usage/subprograms.rst index fc70700a..ffdedb87 100755 --- a/docs/src/usage/subprograms.rst +++ b/docs/src/usage/subprograms.rst @@ -20,3 +20,7 @@ depending on what you are doing. - :program:`parallel-rsync` - Used during stage 1 when generating experiments experiments (:term:`ROS1+Robot` platform). + +- :program:`killall` - Used during stage 2 when running :term: + :term:`ARGoS`, :term:`ROS1+Gazebo` experiments to cleanup after each + experimental run. diff --git a/noxfile.py b/noxfile.py index 03ce9735..364660c1 100644 --- a/noxfile.py +++ b/noxfile.py @@ -22,8 +22,10 @@ # Project packages +versions = ['3.8', '3.9', '3.10', '3.11'] -@nox.session(python=['3.8', '3.9']) + +@nox.session(python=versions) def lint(session): session.install('.') # same as 'pip3 install .' session.install('.[devel]') # same as 'pip3 install .[devel]' @@ -52,8 +54,8 @@ def lint(session): # venv argument needed so the apt module can be found in the nox venv on linux -@nox.session(python=['3.8', '3.9']) -def analysis(session): +@nox.session(python=versions) +def analyze_pytype(session): session.install('.') # same as 'pip3 install .' session.install('.[devel]') # same as 'pip3 install .[devel]' @@ -65,6 +67,15 @@ def analysis(session): 'sierra', external=True) + +# venv argument needed so the apt module can be found in the nox venv on linux +@nox.session(python=versions) +def analyze_mypy(session): + session.install('.') # same as 'pip3 install .' + session.install('.[devel]') # same as 'pip3 install .[devel]' + + cores = psutil.cpu_count() + session.run('mypyrun', '--select', # No syntax errors @@ -126,7 +137,7 @@ def analysis(session): 'sierra') -@nox.session(python=['3.8', '3.9']) +@nox.session(python=versions) def docs(session): session.install('.') # same as 'pip3 install .' session.install('.[devel]') # same as 'pip3 install .[devel]' @@ -147,7 +158,7 @@ def docs(session): 'sierra') -@nox.session(python=['3.8', '3.9']) +@nox.session(python=versions) def unit_tests(session): session.install('.') # same as 'pip3 install .' session.install('.[devel]') # same as 'pip3 install .[devel]' diff --git a/scripts/argos-integration-tests.sh b/scripts/argos-integration-tests.sh index 73a00530..92091157 100755 --- a/scripts/argos-integration-tests.sh +++ b/scripts/argos-integration-tests.sh @@ -7,11 +7,11 @@ setup_env() { export SIERRA_ROOT=$HOME/test if [ "$GITHUB_ACTIONS" = true ]; then - export SAMPLE_ROOT=$HOME/work/sierra-sample-project + export SAMPLE_ROOT=$GITHUB_WORKSPACE/sierra-sample-project export ARGOS_INSTALL_PREFIX=/usr/local else - export SAMPLE_ROOT=$HOME/git/sierra-sample-project - export ARGOS_INSTALL_PREFIX=/$HOME/.local + export SAMPLE_ROOT=$HOME/git/thesis/sierra-sample-project + export ARGOS_INSTALL_PREFIX=/$HOME/.local/ fi # Set ARGoS library search path. Must contain both the ARGoS core libraries path @@ -27,7 +27,7 @@ setup_env() { # between jobs in a workflow on OSX, and doing this the way # github says to do doesn't work. export PATH=$pythonLocation/bin:$PATH - + # Required to get coverage.py to work with the installed version # of SIERRA. Omitting this results in either nothing getting # measured because the local site-packages is omitted, or if that @@ -39,21 +39,21 @@ setup_env() { export COVERAGE_CMD="coverage \ run \ - --debug=debug\ + --debug=debug \ $(which sierra-cli)" export SIERRA_BASE_CMD="$COVERAGE_CMD \ --sierra-root=$SIERRA_ROOT \ --platform=platform.argos \ --project=argos_project \ - --exp-setup=exp_setup.T5000.K5 \ + --exp-setup=exp_setup.T500.K5 \ --n-runs=4 \ --exec-strict \ --template-input-file=$SAMPLE_ROOT/exp/argos/template.argos \ --scenario=LowBlockCount.10x10x2 \ --exec-no-devnull \ --with-robot-leds \ - --with-robot-rab\ + --with-robot-rab \ --log-level=TRACE" export PARALLEL="--env ARGOS_PLUGIN_PATH --env LD_LIBRARY_PATH" @@ -73,13 +73,24 @@ sanity_check_pipeline() { $SIERRA_CMD --pipeline 3 - $SIERRA_CMD --pipeline 4 + # Semi-hack to avoid running stage 4 on OSX in github actions in + # order to avoid having to install mactex. + if [[ ! (("$GITHUB_ACTIONS" = true) && ("$RUNNER_OS" = "macOS")) ]]; then - rm -rf $SIERRA_ROOT + $SIERRA_CMD --pipeline 4 - $SIERRA_CMD --pipeline 1 2 3 4 + rm -rf $SIERRA_ROOT - rm -rf $SIERRA_ROOT + $SIERRA_CMD --pipeline 1 2 3 4 + + rm -rf $SIERRA_ROOT + else + rm -rf $SIERRA_ROOT + + $SIERRA_CMD --pipeline 1 2 3 + + rm -rf $SIERRA_ROOT + fi } ################################################################################ @@ -87,7 +98,12 @@ sanity_check_pipeline() { # crash. ################################################################################ physics_engines_test() { - ENGINES=(1 2 4 6 8 12 16 24) + + # Don't test with ALL engine sizes, just the smallest, largest, + # and a few in between. + # + # All: 1 2 4 6 8 12 16 24 + ENGINES=(1 8 16 24) for n in "${ENGINES[@]}" do @@ -195,7 +211,7 @@ stage1_univar_test() { [ -f "$input_root/exp${exp}/seeds.pkl" ] || false for run in {0..3}; do - [ -f "$input_root/exp${exp}/template_run${run}.argos" ] ||false + [ -f "$input_root/exp${exp}/template_${run}.argos" ] ||false done done @@ -236,7 +252,7 @@ stage1_bivar_test() { [ -f "$input_root1/c1-exp${i}+c2-exp${j}/exp_def.pkl" ] || false [ -f "$input_root1/c1-exp${i}+c2-exp${j}/seeds.pkl" ] || false for run in {0..3}; do - [ -f "$input_root1/c1-exp${i}+c2-exp${j}/template_run${run}.argos" ] ||false + [ -f "$input_root1/c1-exp${i}+c2-exp${j}/template_${run}.argos" ] ||false done done done @@ -268,7 +284,7 @@ stage1_bivar_test() { [ -f "$input_root2/c1-exp${i}+c2-exp${j}/seeds.pkl" ] || false for run in {0..3}; do - [ -f "$input_root2/c1-exp${i}+c2-exp${j}/template_run${run}.argos" ] ||false + [ -f "$input_root2/c1-exp${i}+c2-exp${j}/template_${run}.argos" ] ||false done done done @@ -384,7 +400,7 @@ stage2_bivar_test() { for i in {0..2}; do for j in {0..4}; do for run in {0..3}; do - [ -f "$output_root1/c1-exp${i}+c2-exp${j}/template_run${run}_output/collected-data.csv" ] ||false + [ -f "$output_root1/c1-exp${i}+c2-exp${j}/template_${run}_output/collected-data.csv" ] ||false done done done @@ -752,7 +768,7 @@ vc_test() { --batch-criteria population_size.Linear3.C3 \ --pipeline 1 2 3 4 \ --platform-vc \ - --exp-setup=exp_setup.T500" + --exp-setup=exp_setup.T50" cameras=(overhead sw @@ -792,7 +808,7 @@ cmdline_test() { --physics-n-engines=1 \ --controller=foraging.footbot_foraging \ --batch-criteria population_size.Linear3.C3 \ - --exp-setup=exp_setup.T500" + --exp-setup=exp_setup.T50" $SIERRA_CMD --n-robots=10 --pipeline 1 diff --git a/scripts/core-integration-tests.sh b/scripts/core-integration-tests.sh index 3780bfd6..a45a171c 100755 --- a/scripts/core-integration-tests.sh +++ b/scripts/core-integration-tests.sh @@ -7,7 +7,7 @@ setup_env() { export SIERRA_ROOT=$HOME/test if [ "$GITHUB_ACTIONS" = true ]; then - export SAMPLE_ROOT=$HOME/work/sierra-sample-project + export SAMPLE_ROOT=$GITHUB_WORKSPACE/sierra-sample-project export ARGOS_INSTALL_PREFIX=/usr/local else diff --git a/scripts/ros1gazebo-integration-tests.sh b/scripts/ros1gazebo-integration-tests.sh index 8755d1f1..1b9f6861 100755 --- a/scripts/ros1gazebo-integration-tests.sh +++ b/scripts/ros1gazebo-integration-tests.sh @@ -7,7 +7,7 @@ setup_env() { export SIERRA_ROOT=$HOME/test if [ "$GITHUB_ACTIONS" = true ]; then - export SAMPLE_ROOT=$HOME/work/sierra-sample-project + export SAMPLE_ROOT=$GITHUB_WORKSPACE/sierra-sample-project else export SAMPLE_ROOT=$HOME/git/sierra-sample-project fi @@ -45,11 +45,11 @@ setup_env() { --project=ros1gazebo_project \ --exp-setup=exp_setup.T5.K5\ --n-runs=4 \ - --exec-strict\ + --exec-strict \ --template-input-file=$SAMPLE_ROOT/exp/ros1gazebo/turtlebot3_house.launch \ --scenario=HouseWorld.10x10x2 \ --controller=turtlebot3.wander \ - --robot turtlebot3\ + --robot turtlebot3 \ --exec-no-devnull \ --log-level=TRACE" diff --git a/scripts/ros1robot-integration-tests.sh b/scripts/ros1robot-integration-tests.sh index 59f42799..d63278f9 100755 --- a/scripts/ros1robot-integration-tests.sh +++ b/scripts/ros1robot-integration-tests.sh @@ -7,7 +7,7 @@ setup_env() { export SIERRA_ROOT=$HOME/test if [ "$GITHUB_ACTIONS" = true ]; then - export SAMPLE_ROOT=$HOME/work/sierra-sample-project + export SAMPLE_ROOT=$GITHUB_WORKSPACE/sierra-sample-project else export SAMPLE_ROOT=$HOME/git/sierra-sample-project fi diff --git a/setup.py b/setup.py index 0dedb61b..39c37832 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ # The directory containing this file here = pathlib.Path(__file__).parent -# The text of the README file +# The text of the README file. readme = (here / "README.rst").read_text() # Get version @@ -56,6 +56,9 @@ # "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "License :: OSI Approved :: MIT License", "Environment :: Console", "Operating System :: MacOS :: MacOS X", @@ -119,9 +122,9 @@ 'twine', 'setuptools', - # Sphinx packages - "sphinx==5.0.2", - "docutils==0.18.1", + # sphinx packages + "sphinx==6.0.0", + "docutils==0.19", "sphinx-rtd-theme", "sphinx-argparse", "sphinx-tabs", diff --git a/sierra/core/graphs/heatmap.py b/sierra/core/graphs/heatmap.py index 5559a558..0fbf5c09 100755 --- a/sierra/core/graphs/heatmap.py +++ b/sierra/core/graphs/heatmap.py @@ -211,7 +211,7 @@ def generate(self) -> None: # Scaffold graph. We can use either dataframe for setting the graph # size; we assume they have the same dimensions. # - fig, axes = plt.subplots(ncols=2) + fig, axes = plt.subplots(nrows=1, ncols=2) Heatmap.set_graph_size(dfs[0], fig) y = np.arange(len(dfs[0].columns)) diff --git a/sierra/core/graphs/stacked_line_graph.py b/sierra/core/graphs/stacked_line_graph.py index e195b544..a866afe3 100755 --- a/sierra/core/graphs/stacked_line_graph.py +++ b/sierra/core/graphs/stacked_line_graph.py @@ -222,7 +222,9 @@ def _read_stats(self) -> tp.Dict[str, pd.DataFrame]: return dfs - def _read_models(self) -> tp.Tuple[pd.DataFrame, tp.List[str]]: + # 2024/09/13 [JRH]: The union is for compatability with type checkers in + # python {3.8,3.11}. + def _read_models(self) -> tp.Tuple[pd.DataFrame, tp.Union[tp.List[str], tp.List[bytes]]]: if self.model_root is not None: model_fpath = self.model_root / \ (self.input_stem + config.kModelsExt['model']) diff --git a/sierra/core/graphs/summary_line_graph.py b/sierra/core/graphs/summary_line_graph.py index fafa8efd..48f3eb27 100755 --- a/sierra/core/graphs/summary_line_graph.py +++ b/sierra/core/graphs/summary_line_graph.py @@ -332,7 +332,9 @@ def _read_bw_stats(self) -> tp.Dict[str, tp.List[pd.DataFrame]]: return dfs - def _read_models(self) -> tp.Tuple[pd.DataFrame, tp.List[str]]: + # 2024/09/13 [JRH]: The union is for compatability with type checkers in + # python {3.8,3.11}. + def _read_models(self) -> tp.Tuple[pd.DataFrame, tp.Union[tp.List[str], tp.List[bytes]]]: if self.model_root is None: return (None, []) diff --git a/sierra/core/pipeline/stage3/statistics_calculator.py b/sierra/core/pipeline/stage3/statistics_calculator.py index 12150d1e..6f8b25c9 100755 --- a/sierra/core/pipeline/stage3/statistics_calculator.py +++ b/sierra/core/pipeline/stage3/statistics_calculator.py @@ -233,7 +233,7 @@ def __call__(self, exp_output_root: pathlib.Path) -> None: r'\d+') runs = list(exp_output_root.iterdir()) - assert(all(re.match(pattern, r.name) for r in runs)),\ + assert (all(re.match(pattern, r.name) for r in runs)), \ f"Extra files/not all dirs in '{exp_output_root}' are exp runs" # Maps (unique .csv stem, optional parent dir) to the averaged dataframe @@ -299,7 +299,7 @@ def _gather_item_from_sims(self, reader = storage.DataFrameReader(self.gather_opts['storage_medium']) df = reader(item_path, index_col=False) - if df.dtypes[0] == 'object': + if df.dtypes.iloc[0] == 'object': df[df.columns[0]] = df[df.columns[0]].apply(lambda x: float(x)) if item not in gathered: @@ -373,7 +373,7 @@ def _verify_exp_outputs_pairwise(self, str(path1)) continue - assert (utils.path_exists(path1) and utils.path_exists(path2)),\ + assert (utils.path_exists(path1) and utils.path_exists(path2)), \ f"Either {path1} or {path2} does not exist" # Verify both dataframes have same # columns, and that @@ -385,15 +385,15 @@ def _verify_exp_outputs_pairwise(self, assert (len(df1.columns) == len(df2.columns)), \ (f"Dataframes from {path1} and {path2} do not have " "the same # columns") - assert(sorted(df1.columns) == sorted(df2.columns)),\ + assert (sorted(df1.columns) == sorted(df2.columns)), \ f"Columns from {path1} and {path2} not identical" # Verify the length of all columns in both dataframes is the same for c1 in df1.columns: - assert(all(len(df1[c1]) == len(df1[c2]) for c2 in df1.columns)),\ + assert (all(len(df1[c1]) == len(df1[c2]) for c2 in df1.columns)), \ f"Not all columns from {path1} have same length" - assert(all(len(df1[c1]) == len(df2[c2]) for c2 in df1.columns)),\ + assert (all(len(df1[c1]) == len(df2[c2]) for c2 in df1.columns)), \ (f"Not all columns from {path1} and {path2} have " "the same length") diff --git a/sierra/core/pipeline/stage4/graph_collator.py b/sierra/core/pipeline/stage4/graph_collator.py index 91a977ef..0717daf9 100755 --- a/sierra/core/pipeline/stage4/graph_collator.py +++ b/sierra/core/pipeline/stage4/graph_collator.py @@ -124,7 +124,7 @@ def _collate_exp(self, data_df = storage.DataFrameReader('storage.csv')(csv_ipath) - assert target['col'] in data_df.columns.values,\ + assert target['col'] in data_df.columns.values, \ "{0} not in columns of {1}".format(target['col'], target['src_stem'] + stat.df_ext) @@ -221,7 +221,7 @@ def _collate_exp(self, data_df = storage.DataFrameReader('storage.csv')(csv_ipath) - assert target['col'] in data_df.columns.values,\ + assert target['col'] in data_df.columns.values, \ "{0} not in columns of {1}, which has {2}".format(target['col'], csv_ipath, data_df.columns) @@ -238,10 +238,11 @@ def _collate_exp(self, # in sequence, to generate a SEQUENCE of 2D dataframes. for row in data_df[target['col']].index: if row in stat.df_seq.keys(): - stat.df_seq[row].loc[xlabel][ylabel] = data_df[target['col']][row] + stat.df_seq[row].loc[xlabel][ylabel] = data_df.loc[row, + target['col']] else: df = pd.DataFrame(columns=stat.ylabels, index=stat.xlabels) - df.loc[xlabel][ylabel] = data_df[target['col']][row] + df.loc[xlabel][ylabel] = data_df.loc[row, target['col']] stat.df_seq[row] = df diff --git a/sierra/core/startup.py b/sierra/core/startup.py index 977d84c9..ecb7fb58 100644 --- a/sierra/core/startup.py +++ b/sierra/core/startup.py @@ -74,8 +74,8 @@ def _linux_pkg_checks() -> None: dist = distro.id() os_info = distro.os_release_info() - if any(candidate in os_info['id_like'] for candidate in ['debian', - 'ubuntu']): + if any(candidate in os_info['id'] for candidate in ['debian', + 'ubuntu']): _apt_pkg_checks(dist) else: logging.warning(("Unknown Linux distro '%s' detected: skipping package " diff --git a/sierra/version.py b/sierra/version.py index d4be2b36..1124d027 100644 --- a/sierra/version.py +++ b/sierra/version.py @@ -9,4 +9,4 @@ # Project packages -__version__ = "1.3.6" +__version__ = "1.3.10"