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

Pre-commit hooks and black code formatting #224

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Add pre-commit hooks and run black
98f5c275d4b1cb2d13852ed75c278d9816347355
2 changes: 1 addition & 1 deletion .github_changelog_generator
Original file line number Diff line number Diff line change
@@ -1 +1 @@
since-tag=1.0.0
since-tag=1.0.0
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,5 @@ figs/*
*.sharpy

# Exceptions
# !tests/coupled/multibody/floating_wind_turbine/oc3_cs_v07.floating.h5
# !tests/coupled/multibody/floating_wind_turbine/oc3_cs_v07.floating.h5
!tests/coupled/multibody/floating_wind_turbine/oc3_cs_v07.floating.h*
34 changes: 34 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black
- id: black
args: [--line-length=120]
types: [python]
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
types: [python]
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
args: [--max-line-length=120]
types: [python]
- repo: https://github.com/PyCQA/bandit
rev: 1.7.4
hooks:
- id: bandit
args: [-r]
types: [python]
20 changes: 10 additions & 10 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"license": "other-open",
"title": "SHARPy: A dynamic aeroelastic simulation toolbox for very flexible aircraft and wind turbines",
"upload_type": "software",
"license": "other-open",
"title": "SHARPy: A dynamic aeroelastic simulation toolbox for very flexible aircraft and wind turbines",
"upload_type": "software",
"creators": [
{
"orcid": "0000-0002-8133-9481",
"affiliation": "Imperial College London",
"orcid": "0000-0002-8133-9481",
"affiliation": "Imperial College London",
"name": "Alfonso del Carre"
},
{
Expand All @@ -14,15 +14,15 @@
"name": "Norberto Goizueta"
},
{
"orcid": "0000-0003-4840-5392",
"affiliation": "Imperial College London",
"orcid": "0000-0003-4840-5392",
"affiliation": "Imperial College London",
"name": "Arturo Mu\u00f1oz-Sim\u00f3n"
},
},
{
"orcid": "0000-0002-6706-3220",
"orcid": "0000-0002-6706-3220",
"affiliation": "Imperial College London",
"name": "Rafael Palacios"
}
],
],
"access_right": "open"
}
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,3 @@ RUN cd sharpy_dir && \
rm -rf build

ENTRYPOINT ["/bin/bash", "--init-file", "/root/bashrc"]

12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ wings and wind turbines.

### Contact

For more information on the [research team](http://www.imperial.ac.uk/aeroelastics/people/) developing SHARPy or to get
For more information on the [research team](http://www.imperial.ac.uk/aeroelastics/people/) developing SHARPy or to get
in touch, [visit our homepage](http://www.imperial.ac.uk/aeroelastics).

## Physical Models
Expand All @@ -25,8 +25,8 @@ SHARPy is a modular aeroelastic solver that currently uses two specific models f

For the structural model, SHARPy employs a nonlinear, geometrically-exact displacement and rotation-based composite beam formulation,
augmented with Lagrange multipliers for additional kinematic constraints.
This model has the advantage of providing the solution directly in the physical problem's degrees of freedom, making the
coupling with the aerodynamic solver simple and not requiring any post-processing. The 1D beam formulation used limits
This model has the advantage of providing the solution directly in the physical problem's degrees of freedom, making the
coupling with the aerodynamic solver simple and not requiring any post-processing. The 1D beam formulation used limits
the analyses that can be done by SHARPy to slender structures, such as high aspect ratio wings.

The aerodynamic model utilises the Unsteady Vortex Lattice Method (UVLM). The aerodynamic surfaces are modelled as a thin
Expand Down Expand Up @@ -70,16 +70,16 @@ The documentation for SHARPy can be found [here](http://ic-sharpy.readthedocs.io

## Installing SHARPy

For the latest documentation, see the
For the latest documentation, see the
[installation docs](https://ic-sharpy.readthedocs.io/en/latest/content/installation.html).

As of version v1.0.1, SHARPy can also be obtained from Docker Hub to avoid compilation
and platform-dependant issues. If you are interested, make sure you check
and platform-dependant issues. If you are interested, make sure you check
the [SHARPy Docker distribution docs](https://ic-sharpy.readthedocs.io/en/latest/content/installation.html#using-sharpy-from-a-docker-container).

## Contributing and Bug reports

If you think you can add a useful feature to SHARPy, want to write documentation or you encounter a bug, by all means,
If you think you can add a useful feature to SHARPy, want to write documentation or you encounter a bug, by all means,
check out the [collaboration guide](https://ic-sharpy.readthedocs.io/en/latest/content/contributing.html).

## Citing SHARPy
Expand Down
12 changes: 6 additions & 6 deletions docs/JOSS/paper.bib
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,10 @@ @article{Murua2012-2
pages = {1575-1585},
year = {2012},
doi = {10.2514/1.J051543},
URL = {
URL = {
https://doi.org/10.2514/1.J051543
},
eprint = {
eprint = {
https://doi.org/10.2514/1.J051543
}
}
Expand All @@ -397,13 +397,13 @@ @article{Simpson2013-2
year = {2013},
doi = {10.2514/1.J052136},

URL = {
URL = {
https://doi.org/10.2514/1.J052136

},
eprint = {
eprint = {
https://doi.org/10.2514/1.J052136

}
}

Expand Down
26 changes: 13 additions & 13 deletions docs/source/_static/sharpy_guide/sharpy_intro.html
Original file line number Diff line number Diff line change
Expand Up @@ -8451,15 +8451,15 @@
}
/* Flexible box model classes */
/* Taken from Alex Russell http://infrequently.org/2009/08/css-3-progress/ */
/* This file is a compatability layer. It allows the usage of flexible box
/* This file is a compatability layer. It allows the usage of flexible box
model layouts accross multiple browsers, including older browsers. The newest,
universal implementation of the flexible box model is used when available (see
`Modern browsers` comments below). Browsers that are known to implement this
`Modern browsers` comments below). Browsers that are known to implement this
new spec completely include:

Firefox 28.0+
Chrome 29.0+
Internet Explorer 11+
Internet Explorer 11+
Opera 17.0+

Browsers not listed, including Safari, are supported via the styling under the
Expand Down Expand Up @@ -11233,7 +11233,7 @@
background: #f7f7f7;
border-top: 1px solid #cfcfcf;
border-bottom: 1px solid #cfcfcf;
/* This injects handle bars (a short, wide = symbol) for
/* This injects handle bars (a short, wide = symbol) for
the resize handle. */
}
div#pager .ui-resizable-handle::after {
Expand Down Expand Up @@ -11676,7 +11676,7 @@
.highlight .il { color: #666666 } /* Literal.Number.Integer.Long */
</style>
<style type="text/css">

/* Temporary definitions which will become obsolete with Notebook release 5.0 */
.ansi-black-fg { color: #3E424D; }
.ansi-black-bg { background-color: #3E424D; }
Expand Down Expand Up @@ -11730,14 +11730,14 @@
div.cell {
display: block;
page-break-inside: avoid;
}
div.output_wrapper {
}
div.output_wrapper {
display: block;
page-break-inside: avoid;
page-break-inside: avoid;
}
div.output {
div.output {
display: block;
page-break-inside: avoid;
page-break-inside: avoid;
}
}
</style>
Expand Down Expand Up @@ -12404,7 +12404,7 @@ <h2 id="Structural-data">Structural data<a class="anchor-link" href="#Structural
<div class="text_cell_render border-box-sizing rendered_html">
<ul>
<li><code>frame_fo_reference_delta [num_elem, num_node_elem, 3]</code> contains the $\Delta$ vector in body-attached ($A$) frame of reference. As a rule of thumb:
$$\Delta = \left\{
$$\Delta = \left\{
\begin{matrix}
[-1, 0, 0], \quad \text{if right wing} \\
[1, 0, 0], \quad \text{if left wing} \\
Expand Down Expand Up @@ -12588,7 +12588,7 @@ <h3 id="StaticUvlm">StaticUvlm<a class="anchor-link" href="#StaticUvlm">&#182;</
</li>
<li><p><code>n_rollup</code> how many steps are carried out to convect the wake with full free-wake. This usually should be <code>0</code>, but if you want a pretty picture, you can use <code>n_rollup = int(mstar*1.5)</code>.</p>
</li>
<li><p><code>rollup_dt</code> if <code>n_rollup &gt; 0</code>, set <code>rollup_dt</code> to
<li><p><code>rollup_dt</code> if <code>n_rollup &gt; 0</code>, set <code>rollup_dt</code> to
$$
\Delta t_{\mathrm{rollup}} = \frac{c/M}{u_\infty}
$$</p>
Expand Down Expand Up @@ -12928,7 +12928,7 @@ <h1 id="Other-useful-software">Other useful software<a class="anchor-link" href=
</div>
</body>




</html>