8000 Merge remote-tracking branch 'origin/develop' into enh/parallel_monte… · RocketPy-Team/RocketPy@c563472 · GitHub
[go: up one dir, main page]

Skip to content

Commit c563472

Browse files
committed
Merge remote-tracking branch 'origin/develop' into enh/parallel_montecarlo
2 parents 615a907 + d977fbe commit c563472

File tree

166 files changed

+28576
-11812
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+28576
-11812
lines changed

.github/workflows/lint_black.yaml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/linters.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Linters
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
6+
paths:
7+
- "**.py"
8+
- "**.ipynb"
9+
- ".github/**"
10+
- "pyproject.toml"
11+
- "requirements*"
12+
- ".pylintrc"
13+
14+
jobs:
15+
lint:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
python-version: ["3.9"]
20+
steps:
21+
- uses: actions/checkout@v3
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v3
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install .[all]
30+
pip install .[tests]
31+
pip install pylint isort flake8 black
32+
- name: Run isort
33+
run: isort --check-only rocketpy/ tests/ docs/ --profile black
34+
- name: Run black
35+
uses: psf/black@stable
36+
with:
37+
options: "--check rocketpy/ tests/ docs/"
38+
jupyter: true
39+
- name: Run flake8
40+
run: flake8 rocketpy/ tests/
41+
- name: Run pylint
42+
run: |
43+
pylint rocketpy/ tests/

.github/workflows/publish-to-pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Set up Python
2020
uses: actions/setup-python@v3
2121
with:
22-
python-version: "3.8"
22+
python-version: "3.9"
2323
- name: Install dependencies
2424
run: |
2525
python -m pip install --upgrade pip
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Scheduled Tests
2+
3+
on:
4+
schedule:
5+
- cron: "0 17 */14 * 5" # every 2 weeks, always on a Friday at 17:00
6+
timezone: "America/Sao_Paulo"
7+
8+
defaults:
9+
run:
10+
shell: bash
11+
12+
jobs:
13+
pytest:
14+
if: github.ref == "refs/heads/master" || github.ref == "refs/heads/develop"
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
fail-fast: false
19+
python-version: [3.9, 3.12]
20+
21+
env:
22+
OS: ${{ matrix.os }}
23+
PYTHON: ${{ matrix.python-version }}
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Set up Python
27+
uses: actions/setup-python@v2
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
31+
- name: Install rocketpy
32+
run: pip install .
33+
34+
- name: Test importing rocketpy
35+
run: python -c "import sys, rocketpy; print(f'{rocketpy.__name__} running on Python {sys.version}')"
36+
37+
- name: Install test dependencies
38+
run: |
39+
pip install -r requirements-tests.txt
40+
pip install .[all]
41+
42+
- name: Run Unit Tests
43+
run: pytest tests/unit --cov=rocketpy
44+
45+
- name: Run Documentation Tests
46+
run: pytest rocketpy --doctest-modules --cov=rocketpy --cov-append
47+
48+
- name: Run Integration Tests
49+
run: pytest tests/integration --cov=rocketpy --cov-append
50+
51+
- name: Run Acceptance Tests
52+
run: pytest tests/acceptance --cov=rocketpy --cov-append --cov-report=xml
53+
54+
- name: Run slow tests
55+
run: pytest tests -vv -m slow --runslow --cov=rocketpy --cov-append --cov-report=xml

.github/workflows/test_pytest.yaml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,8 @@ jobs:
1818
runs-on: ${{ matrix.os }}
1919
strategy:
2020
matrix:
21-
os: [ubuntu-latest, windows-latest]
22-
python-version: [3.8, 3.12]
23-
include:
24-
- os: macos-latest
25-
python-version: 3.12
21+
os: [ubuntu-latest, macos-latest, windows-latest]
22+
python-version: [3.9, 3.12]
2623
env:
2724
OS: ${{ matrix.os }}
2825
PYTHON: ${{ matrix.python-version }}
@@ -48,17 +45,19 @@ jobs:
4845
run: python -c "import sys, rocketpy; print(f'{rocketpy.__name__} running on Python {sys.version}')"
4946

5047
- name: Install test dependencies
51-
run: pip install -r requirements-tests.txt
48+
run: |
49+
pip install -r requirements-tests.txt
50+
pip install .[all]
5251
5352
- name: Run Unit Tests
5453
run: pytest tests/unit --cov=rocketpy
5554

56-
- name: Run Integration Tests
57-
run: pytest $(find tests -maxdepth 1 -name "*.py") --cov=rocketpy --cov-append
58-
5955
- name: Run Documentation Tests
6056
run: pytest rocketpy --doctest-modules --cov=rocketpy --cov-append
6157

58+
- name: Run Integration Tests
59+
run: pytest tests/integration --cov=rocketpy --cov-append
60+
6261
- name: Run Acceptance Tests
6362
run: pytest tests/acceptance --cov=rocketpy --cov-append --cov-report=xml
6463

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ instance/
7272
# Sphinx documentation
7373
docs/_build/
7474

75+
# WebServer extension
76+
.iis
77+
7578
# PyBuilder
7679
.pybuilder/
7780
target/
@@ -159,9 +162,6 @@ cython_debug/
159162
*.docx
160163
*.pdf
161164

162-
# VSCode project settings
163-
.vscode/
164-
165165
# PyCharm
166166
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
167167
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore

.pylintrc

Lines changed: 50 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ fail-under=10
4646
#from-stdin=
4747

4848
# Files or directories to be skipped. They should be base names, not paths.
49-
ignore=CVS, docs
49+
ignore=CVS, docs, data,
5050

5151
# Add files or directories matching the regular expressions patterns to the
5252
# ignore-list. The regex matches against paths and can be in Posix or Windows
@@ -88,7 +88,7 @@ persistent=yes
8888

8989
# Minimum Python version to use for version dependent checks. Will default to
9090
# the version used to run pylint.
91-
py-version=3.8
91+
py-version=3.9
9292

9393
# Discover python modules and packages in the file system subtree.
9494
recursive=no
@@ -212,7 +212,24 @@ good-names=FlightPhases,
212212
fin_set_NACA,
213213
fin_set_E473,
214214
HIRESW_dictionary,
215-
215+
prop_I_11,
216+
Kt, # transformation matrix transposed
217+
clalpha2D,
218+
clalpha2D_incompressible,
219+
r_NOZ, # Nozzle position vector
220+
rocket_dry_I_33,
221+
rocket_dry_I_11,
222+
motor_I_33_at_t,
223+
motor_I_11_at_t,
224+
motor_I_33_derivative_at_t,
225+
motor_I_11_derivative_at_t,
226+
M3_forcing,
227+
M3_damping,
228+
CM_to_CDM,
229+
CM_to_CPM,
230+
center_of_mass_without_motor_to_CDM,
231+
motor_center_of_dry_mass_to_CDM,
232+
generic_motor_cesaroni_M1520,
216233

217234
# Good variable names regexes, separated by a comma. If names match any regex,
218235
# they will always be accepted
@@ -222,6 +239,8 @@ good-names-rgxs= ^[a-z][0-9]?$, # Single lowercase characters, possibly followe
222239
^(dry_|propellant_)[A-Z]+_\d+$, # Variables starting with 'dry_' or 'propellant_', followed by uppercase characters, underscore, and digits
223240
^[a-z]+_ISA$, # Lowercase words ending with '_ISA'
224241
^plot(1D|2D)$, # Variables starting with 'plot' followed by '1D' or '2D'
242+
S_noz*, # nozzle gyration tensor
243+
r_CM*, # center of mass position and its variations
225244

226245
# Include a hint for the correct naming format with invalid-name.
227246
include-naming-hint=no
@@ -312,16 +331,16 @@ exclude-too-few-public-methods=
312331
ignored-parents=
313332

314333
# Maximum number of arguments for function / method.
315-
max-args=10
334+
max-args=15
316335

317336
# Maximum number of attributes for a class (see R0902).
318-
max-attributes=30
337+
max-attributes=50
319338

320339
# Maximum number of boolean expressions in an if statement (see R0916).
321340
max-bool-expr=5
322341

323342
# Maximum number of branch for function / method body.
324-
max-branches=12
343+
max-branches=25
325344

326345
# Maximum number of locals for function / method body.
327346
max-locals=30
@@ -330,16 +349,16 @@ max-locals=30
330349
max-parents=7
331350

332351
# Maximum number of public methods for a class (see R0904).
333-
max-public-methods=40
352+
max-public-methods=25
334353

335354
# Maximum number of return / yield for function / method body.
336-
max-returns=6
355+
max-returns=25
337356

338357
# Maximum number of statements in function / method body.
339-
max-statements=50
358+
max-statements=25
340359

341360
# Minimum number of public methods for a class (see R0903).
342-
min-public-methods=2
361+
min-public-methods=0
343362

344363

345364
[EXCEPTIONS]
@@ -454,14 +473,32 @@ disable=raw-checker-failed,
454473
file-ignored,
455474
suppressed-message,
456475
useless-suppression,
457-
deprecated-pragma,
476+
deprecated-pragma, # because we have some peniding deprecations in the code.
458477
use-symbolic-message-instead,
459478
use-implicit-booleaness-not-comparison-to-string,
460479
use-implicit-booleaness-not-comparison-to-zero,
461-
no-else-return,
480+
no-else-return, # this is a style preference, we don't need to follow it
462481
inconsistent-return-statements,
463-
unspecified-encoding,
482+
unspecified-encoding, # this is not a relevant issue.
464483
no-member, # because we use funcify_method decorator
484+
invalid-overridden-method, # because we use funcify_method decorator
485+
too-many-function-args, # because we use funcify_method decorator
486+
fixme, # because we use TODO in the code
487+
missing-module-docstring, # not useful for most of the modules.
488+
attribute-defined-outside-init, # to avoid more than 200 errors (code works fine)
489+
not-an-iterable, # rocketpy Functions are iterable, false positive
490+
too-many-function-args, # gives false positives for Function calls
491+
method-hidden, # avoids some errors in tank_geometry and flight classes
492+
missing-timeout, # not a problem to use requests without timeout
493+
protected-access, # we use private attriubutes out of the class (maybe we should fix this)
494+
duplicate-code, # repeating code is a bad thing, but should we really care about it?
495+
line-too-long, # black already takes care of this
496+
missing-function-docstring, # this is too verbose.
497+
redefined-outer-name, # too verbose, and doesn't add much value
498+
method-cache-max-size-none,
499+
no-else-raise, # pointless
500+
501+
465502

466503
# Enable the message, report, category or checker with the given id(s). You can
467504
# either give multiple identifier separated by comma (,) or put this option

.readthedocs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ version: 2
77

88
# Set the version of Python and other tools
99
build:
10-
os: ubuntu-20.04
10+
os: ubuntu-22.04
1111
tools:
12-
python: "3.9"
12+
python: "3.12"
1313

1414
# Build documentation in the docs/ directory with Sphinx
1515
sphinx:

.vscode/extensions.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"recommendations": [
3+
"ambooth.git-rename",
4+
"github.vscode-pull-request-github",
5+
"gruntfuggly.todo-tree",
6+
"mechatroner.rainbow-csv",
7+
"ms-python.black-formatter",
8+
"ms-python.debugpy",
9+
"ms-python.pylint",
10+
"ms-python.python",
11+
"ms-python.vscode-pylance",
12+
"ms-toolsai.jupyter",
13+
"ms-toolsai.jupyter-keymap",
14+
"ms-toolsai.jupyter-renderers",
15+
"ms-toolsai.vscode-jupyter-cell-tags",
16+
"ms-toolsai.vscode-jupyter-slideshow",
17+
"ms-vscode.cmake-tools",
18+
"ms-vscode.makefile-tools",
19+
"njpwerner.autodocstring",
20+
"streetsidesoftware.code-spell-checker",
21+
"trond-snekvik.simple-rst",
22+
]
23+
}

0 commit comments

Comments
 (0)
0