Skip to content

Commit

Permalink
Merge branch 'main' into capytaine_v2_min_mesh
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelcdevin authored Oct 27, 2023
2 parents f55d3c3 + 8d383e3 commit abc6540
Show file tree
Hide file tree
Showing 14 changed files with 199 additions and 666 deletions.
15 changes: 2 additions & 13 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,9 @@ The documentation uses the Jupyter notebook tutorials in the `examples` director
When building the documentation locally you will need to have installed [pandoc](https://pandoc.org/installing.html) and [gifsicle](https://github.com/kohler/gifsicle).
We recommend installing pandoc using its Anaconda distribution: `conda install -c conda-forge pandoc`.

**NOTE:** it may be expedient at times to:
**NOTE:** it may be expedient at times to avoid running the tutorial notebooks. To do so, add [`nbsphinx_execute = 'never'`](https://nbsphinx.readthedocs.io/en/0.9.3/configuration.html#nbsphinx_execute) to `docs/source/conf.py`. Make sure not to commit these changes!

1. **Avoid running the tutorial notebooks:** Add [`nbsphinx_execute = 'never'`](https://nbsphinx.readthedocs.io/en/0.9.3/configuration.html#nbsphinx_execute) to `docs/source/conf.py`
2. **Disable the link check operation:** Comment out the `linkcheck` call in `docs/build_docs.py`

```python
if __name__ == '__main__':
source.make_theory_animations
# linkcheck()
html()
cleanup()
```

Make sure not to commit these changes!
If you add or change any hyperlinks in the documentation, we recommend checking the "Build documentation" warnings in the GitHub Actions CI workflow to make sure the links will not cause an issue. The CI will not fail due to broken links, only issue a warning (see [issue #286](https://github.com/sandialabs/WecOptTool/issues/286)).

### Editing the tutorials
The tutorials are used as part of the Documentation.
Expand Down
2 changes: 1 addition & 1 deletion docs/build_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def linkcheck():
linkcheck_dir,
doctree_dir,
'linkcheck',
warningiserror=True)
warningiserror=False)
app.build()


Expand Down
20 changes: 0 additions & 20 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,26 +57,6 @@ def setup(app):
'app.add_directive',
'app.add_role',]

linkcheck_ignore = [
'https://github.com/HIPS/autograd/blob/master/docs/tutorial.md#',
'https://doi.org/10.2172/1330189',
'https://sandialabs.github.io/WecOptTool/*',
'https://doi.org/10.1080/17445302.2015.1089052',
'https://digitalops.sandia.gov/*',
]

linkcheck_request_headers = {
'https://doi.org/10.1109/TSTE.2014.2371536': {
'User-Agent': 'my-app/0.0.1'
},
'https://doi.org/10.1109/9.467672': {
'User-Agent': 'my-app/0.0.1'
},
'https://doi.org/10.1109/TSTE.2023.3272868': {
'User-Agent': 'my-app/0.0.1'
},
}

# -- References (BibTex) -----------------------------------------------------
bibtex_bibfiles = ['wecopttool_refs.bib']
bibtex_encoding = 'utf-8-sig'
Expand Down
Binary file modified examples/data/bem.nc
Binary file not shown.
33 changes: 1 addition & 32 deletions examples/tutorial_1_WaveBot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -97,25 +97,6 @@
"ndof = fb.nb_dofs"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Next we will add the mass and hydrostatic stiffness properties. \n",
"If these values are known they can be added directly.\n",
"Here we will use the fact that the WaveBot is free floating and assume constant density to calculate these properties, which Capytaine can natively perform with the `FloatingBody` created above. For convenience, this functionality has been wrapped in `wecopttool.hydrostatics`."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"stiffness = wot.hydrostatics.stiffness_matrix(fb).values\n",
"mass = wot.hydrostatics.inertia_matrix(fb).values"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -260,8 +241,6 @@
"source": [
"wec = wot.WEC.from_bem(\n",
" bem_data,\n",
" inertia_matrix=mass,\n",
" hydrostatic_stiffness=stiffness,\n",
" constraints=constraints,\n",
" friction=None,\n",
" f_add=f_add,\n",
Expand Down Expand Up @@ -536,8 +515,6 @@
"# Update WEC\n",
"\n",
"wec_2 = wot.WEC.from_bem(bem_data,\n",
" inertia_matrix=mass,\n",
" hydrostatic_stiffness=stiffness,\n",
" constraints=constraints_2,\n",
" friction=None,\n",
" f_add=f_add_2\n",
Expand Down Expand Up @@ -582,8 +559,6 @@
"source": [
"wec_2_nocon = wot.WEC.from_bem(\n",
" bem_data,\n",
" inertia_matrix=mass,\n",
" hydrostatic_stiffness=stiffness,\n",
" constraints=None,\n",
" friction=None,\n",
" f_add=f_add_2)\n",
Expand Down Expand Up @@ -736,10 +711,6 @@
" nfreq = 50\n",
" bem_data = wot.run_bem(fb, freq)\n",
"\n",
" # Mass & hydrostatic stiffness\n",
" stiffness_3 = wot.hydrostatics.stiffness_matrix(fb).values\n",
" mass_3 = wot.hydrostatics.inertia_matrix(fb).values\n",
"\n",
" # Impedance definition\n",
" omega = bem_data.omega.values\n",
" gear_ratio = 12.0\n",
Expand Down Expand Up @@ -788,8 +759,6 @@
"\n",
" # Create WEC\n",
" wec = wot.WEC.from_bem(bem_data,\n",
" inertia_matrix=mass_3,\n",
" hydrostatic_stiffness=stiffness_3,\n",
" constraints=constraints,\n",
" friction=None, \n",
" f_add=f_add,\n",
Expand Down Expand Up @@ -898,7 +867,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.10"
"version": "3.10.9"
},
"vscode": {
"interpreter": {
Expand Down
Loading

0 comments on commit abc6540

Please sign in to comment.