Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull bug fixes into dev #900

Merged
merged 10 commits into from
Jul 1, 2022
Prev Previous commit
Next Next commit
CI: Split docs jobs | Add color to docs logs | Cancel runs on new pus…
…h | Add 2021b to MATLAB versions (#862)

* Split docs CI into test and build jobs

This PR splits the docs CI workflow into two independent jobs. The
first "test" job checks the current branch with any warnings
triggering a failure. The second jobs builds and deploys the
production docs, allowing any warnings to pass. This allows the
commit author to see any new issues they may be adding to the docs
while not stopping the docs being published.

* Try to get color output in log

* Remove redundant steps for branch test

* Fix duplicate targets using anonymous references

* Cancel previous runs if new commits are made

* Fix spelling mistake to test concurrency

* Limit concurrency to pull requests for the unit tests

This is to ensure all commits on the master and dev branches are
tested, which will be important if we are going to measure
coverage using an external service like codecov.

* Fix another spelling mistake

* Add R2021b to explicit MATLAB versions tested
  • Loading branch information
H0R5E authored Jun 29, 2022
commit 09b2b49ddbb75c2328d8553bbc16eff612cfae49
31 changes: 27 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,35 @@ on:
- master
- dev
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
FORCE_COLOR: 1
jobs:
test:
name: Test the current branch
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
with:
lfs: 'true'
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: _wssphinx
environment-file: docs/environment.yml
python-version: '3.9'
auto-activate-base: false
- run: |
conda info
- name: Build docs
run: |
sphinx-build -W --keep-going -b html docs ${{ runner.temp }}
build:
name: Build all branches
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -32,10 +59,6 @@ jobs:
auto-activate-base: false
- run: |
conda info
- name: Build docs (branch)
run: |
sphinx-build -b html docs ${{ runner.temp }}
if: ${{ github.event_name == 'pull_request' }}
- name: Create build directory
run: echo "BUILD_DIR=$(mktemp -d -t pages-XXXXXXXXXX)" >> $GITHUB_ENV
- name: Build docs
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/run-tests-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ on:
pull_request:
branches:
- dev
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
run_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
release: [R2020b, R2021a, latest]
release: [R2020b, R2021a, R2021b, latest]
name: MATLAB ${{ matrix.release }}
steps:
- name: Check out repository
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/run-tests-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ on:
pull_request:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
run_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
release: [R2020b, R2021a, latest]
release: [R2020b, R2021a, R2021b, latest]
name: MATLAB ${{ matrix.release }}
steps:
- name: Check out repository
Expand Down
10 changes: 5 additions & 5 deletions docs/theory/theory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,9 @@ is the wave phase.

Dispersion Relation
^^^^^^^^^^^^^^^^^^^
For ocean waves, the dispersion relation is a relation betwen the wave angular frequency and the wave number (i.e. wavelength).
For ocean waves, the dispersion relation is a relation between the wave angular frequency and the wave number (i.e. wavelength).
The dispersion relation is derived using separation of variables to satisfy the free surface kinematic and dynamic boundary conditions.
For a more detailed derivation please the reader is referred `here <https://web.mit.edu/13.021/demos/lectures/lecture19.pdf>`_ The dispersion relation that WEC-sim uses is defined as:
For a more detailed derivation please the reader is referred `here <https://web.mit.edu/13.021/demos/lectures/lecture19.pdf>`__ The dispersion relation that WEC-sim uses is defined as:

.. math::

Expand Down Expand Up @@ -425,8 +425,8 @@ The time-averaged power, per unit wave crest with, for a propagating water wave

where :math:`\rho` is the fluid density, :math:`g` is gravitational acceleration, :math:`A` is the wave amplitude, and :math:`c_{g}` is wave group velocity.
The group velocity is the speed of propagation of a packet of waves which is always slower than the wave phase velocity. For a more detailed derivation on the
group velocity the reader is referred `here <http://web.mit.edu/2.016/www/handouts/2005Reading7.pdf>`_ . The group velocity of a two-dimensional progressive wave
is given by the following expresion:
group velocity the reader is referred `here <http://web.mit.edu/2.016/www/handouts/2005Reading7.pdf>`__. The group velocity of a two-dimensional progressive wave
is given by the following expression:

.. math::

Expand Down Expand Up @@ -459,7 +459,7 @@ Similar to the other wave property expressions, the wave power expression can be

.. Note::
The deep water condition is often used without proper validation of the wave environment which can have a significant effect on wave power.
WEC-Sim by default will calculate the wave power using the full expression, no simplifcation, unless the hydrodynamic data is imported with
WEC-Sim by default will calculate the wave power using the full expression, no simplification, unless the hydrodynamic data is imported with
the assumption of infinite water depth.

Irregular Waves
Expand Down