Skip to content

Commit

Permalink
Add ruff (#440)
Browse files Browse the repository at this point in the history
* fix ruff linting

* add ruff

* poetry update

* remove depreciated docs

* update CI

* remove flake8 config
  • Loading branch information
PythonFZ authored Nov 23, 2022
1 parent 14d18c4 commit 0a93188
Show file tree
Hide file tree
Showing 41 changed files with 1,131 additions and 1,551 deletions.
4 changes: 0 additions & 4 deletions .flake8

This file was deleted.

20 changes: 11 additions & 9 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,21 @@ jobs:
- name: run isort
run: |
isort --check-only --quiet .
flake8:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install flake8
python-version: "3.10"
- name: Install dependencies
run: |
pip install flake8==4.0.1
- name: run flake8
run: |
flake8 . --count --show-source --statistics
python -m pip install --upgrade pip
pip install ruff
- name: Run Ruff
run: ruff .

pylint-disabled:
runs-on: ubuntu-latest
steps:
Expand Down
7 changes: 3 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ repos:
hooks:
- id: isort

- repo: https://gitlab.com/pycqa/flake8
rev: 4.0.1
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.133
hooks:
- id: flake8
additional_dependencies: [flake8-isort]
- id: ruff
Loading

6 comments on commit 0a93188

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Report for Python 3.9

name min max mean stddev median iqr outliers ops rounds iterations
0 tests/benchmark/test_benchmark.py::test_NodeCollector_run_and_save 0.000221503 0.000624108 0.000271757 7.43993e-05 0.000235703 5.695e-05 11;7 3679.75 85 1
1 tests/benchmark/test_benchmark.py::test_InputOutput_load_lazy 0.00088791 0.00102161 0.000900162 1.01427e-05 0.000896911 1.0201e-05 88;14 1110.91 578 1
2 tests/benchmark/test_benchmark.py::test_InputOutput_load 0.00089281 0.00108651 0.0009062 1.60925e-05 0.000901911 1.0601e-05 23;15 1103.51 550 1
3 tests/benchmark/test_benchmark.py::test_InputOutput_run_and_save 0.00128051 0.00216321 0.00136836 7.93216e-05 0.00134761 6.045e-05 60;40 730.804 560 1
4 tests/benchmark/test_benchmark.py::test_NodeCollector_load_lazy 0.00155152 0.00187302 0.00157846 1.97299e-05 0.00157627 1.52005e-05 25;12 633.528 404 1
5 tests/benchmark/test_benchmark.py::test_NodeCollector_load 0.00155472 0.00174502 0.00157433 1.70252e-05 0.00157097 1.42e-05 31;10 635.192 410 1
6 tests/benchmark/test_benchmark.py::test_InputOutput_write_graph 0.00575987 0.00646418 0.00591062 0.000102618 0.00589387 0.000113652 27;4 169.187 125 1
7 tests/benchmark/test_benchmark.py::test_NodeCollector_write_graph 1.21058 1.27084 1.23608 0.0232598 1.23716 0.0318646 2;0 0.809012 5 1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Report for Python 3.8

name min max mean stddev median iqr outliers ops rounds iterations
0 tests/benchmark/test_benchmark.py::test_NodeCollector_run_and_save 0.000247704 0.000963315 0.000433299 0.000205053 0.000339405 0.000261904 14;2 2307.87 79 1
1 tests/benchmark/test_benchmark.py::test_InputOutput_load_lazy 0.00100371 0.00122722 0.00105015 6.45524e-05 0.00101932 2.51502e-05 88;91 952.248 479 1
2 tests/benchmark/test_benchmark.py::test_InputOutput_load 0.00100402 0.00115832 0.00102034 1.33402e-05 0.00101602 1.69e-05 92;6 980.064 522 1
3 tests/benchmark/test_benchmark.py::test_InputOutput_run_and_save 0.00150462 0.0748069 0.0018196 0.00318929 0.00162733 0.000128602 1;57 549.57 529 1
4 tests/benchmark/test_benchmark.py::test_NodeCollector_load 0.00170013 0.00206563 0.00173534 5.10986e-05 0.00172513 1.99242e-05 14;15 576.256 339 1
5 tests/benchmark/test_benchmark.py::test_NodeCollector_load_lazy 0.00170983 0.00186033 0.00173379 1.65585e-05 0.00173213 1.92e-05 65;6 576.772 380 1
6 tests/benchmark/test_benchmark.py::test_InputOutput_write_graph 0.00617699 0.0100567 0.00665206 0.000527103 0.0065062 0.000397206 7;5 150.329 94 1
7 tests/benchmark/test_benchmark.py::test_NodeCollector_write_graph 1.35977 2.45342 1.61412 0.470316 1.42855 0.314235 1;1 0.619534 5 1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Report for Python 3.10

name min max mean stddev median iqr outliers ops rounds iterations
0 tests/benchmark/test_benchmark.py::test_NodeCollector_run_and_save 0.000330898 0.00847255 0.000734667 0.00111545 0.000516047 0.000183949 3;6 1361.16 80 1
1 tests/benchmark/test_benchmark.py::test_InputOutput_load_lazy 0.000832795 0.00328438 0.00101981 0.000197685 0.000971295 0.0002075 71;15 980.574 686 1
2 tests/benchmark/test_benchmark.py::test_InputOutput_load 0.000835095 0.00302618 0.000998252 0.00018199 0.000949494 0.000188198 72;21 1001.75 609 1
3 tests/benchmark/test_benchmark.py::test_NodeCollector_load 0.00137139 0.00433057 0.00170591 0.000269496 0.00163979 0.000319198 141;16 586.197 569 1
4 tests/benchmark/test_benchmark.py::test_NodeCollector_load_lazy 0.00138369 0.00264838 0.00176516 0.000203752 0.00173189 0.000259248 123;9 566.519 420 1
5 tests/benchmark/test_benchmark.py::test_InputOutput_run_and_save 0.00173259 0.00911695 0.002192 0.000559576 0.00208389 0.000278924 21;24 456.204 405 1
6 tests/benchmark/test_benchmark.py::test_InputOutput_write_graph 0.00310478 0.00838695 0.00374863 0.000596873 0.00362598 0.000368348 14;13 266.764 215 1
7 tests/benchmark/test_benchmark.py::test_NodeCollector_write_graph 1.41579 1.53581 1.48508 0.0478529 1.48231 0.0717661 2;0 0.673364 5 1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Report for Python 3.10

name min max mean stddev median iqr outliers ops rounds iterations
0 tests/benchmark/test_benchmark.py::test_NodeCollector_run_and_save 0.000230503 0.000463606 0.000261634 4.67088e-05 0.000241653 2.1001e-05 13;14 3822.13 94 1
1 tests/benchmark/test_benchmark.py::test_InputOutput_load 0.000885312 0.00110432 0.000904502 1.31538e-05 0.000900813 1.39e-05 155;13 1105.58 740 1
2 tests/benchmark/test_benchmark.py::test_InputOutput_load_lazy 0.000886612 0.000993013 0.00090234 1.08861e-05 0.000898612 1.25005e-05 171;23 1108.23 744 1
3 tests/benchmark/test_benchmark.py::test_InputOutput_run_and_save 0.00142142 0.0126837 0.00150268 0.000478987 0.00146067 4.6501e-05 5;61 665.478 736 1
4 tests/benchmark/test_benchmark.py::test_NodeCollector_load_lazy 0.00146982 0.00178932 0.00149101 2.15344e-05 0.00148677 1.6901e-05 18;10 670.686 490 1
5 tests/benchmark/test_benchmark.py::test_NodeCollector_load 0.00147922 0.00171812 0.0014995 1.85982e-05 0.00149487 1.77e-05 33;10 666.889 498 1
6 tests/benchmark/test_benchmark.py::test_InputOutput_write_graph 0.00263363 0.00308374 0.00273812 6.43315e-05 0.00272894 8.28505e-05 85;4 365.215 276 1
7 tests/benchmark/test_benchmark.py::test_NodeCollector_write_graph 1.30859 1.39767 1.35364 0.0322527 1.35034 0.0361931 2;0 0.738748 5 1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Report for Python 3.9

name min max mean stddev median iqr outliers ops rounds iterations
0 tests/benchmark/test_benchmark.py::test_NodeCollector_run_and_save 0.0003377 0.0012095 0.000493782 0.000132324 0.00045915 0.0001308 16;5 2025.18 84 1
1 tests/benchmark/test_benchmark.py::test_InputOutput_load 0.000905001 0.0064217 0.00103232 0.000312576 0.000944199 0.000139474 26;35 968.687 595 1
2 tests/benchmark/test_benchmark.py::test_InputOutput_load_lazy 0.000917598 0.0040541 0.00102495 0.000210253 0.000952899 0.000125601 31;28 975.657 505 1
3 tests/benchmark/test_benchmark.py::test_NodeCollector_load 0.0015018 0.0056943 0.0017174 0.000307422 0.0016305 0.000251093 31;20 582.276 422 1
4 tests/benchmark/test_benchmark.py::test_NodeCollector_load_lazy 0.0015171 0.0042543 0.00174247 0.000265657 0.0016781 0.000264226 41;13 573.899 447 1
5 tests/benchmark/test_benchmark.py::test_InputOutput_run_and_save 0.0016813 0.0060502 0.00212716 0.000384084 0.0020614 0.0002755 37;19 470.11 440 1
6 tests/benchmark/test_benchmark.py::test_InputOutput_write_graph 0.00599481 0.0204062 0.00699539 0.00169273 0.00659921 0.0006537 6;8 142.951 115 1
7 tests/benchmark/test_benchmark.py::test_NodeCollector_write_graph 1.25864 1.37603 1.32094 0.0447468 1.32082 0.0639729 2;0 0.757034 5 1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Report for Python 3.8

name min max mean stddev median iqr outliers ops rounds iterations
0 tests/benchmark/test_benchmark.py::test_NodeCollector_run_and_save 0.000367302 0.00100491 0.000580449 0.000146153 0.000555203 0.000182151 17;2 1722.8 68 1
1 tests/benchmark/test_benchmark.py::test_InputOutput_load_lazy 0.000933503 0.00168641 0.00111317 0.000145145 0.0010796 0.000211026 178;6 898.333 543 1
2 tests/benchmark/test_benchmark.py::test_InputOutput_load 0.000940199 0.0029681 0.00118556 0.000189541 0.00114705 0.0001901 82;15 843.484 468 1
3 tests/benchmark/test_benchmark.py::test_NodeCollector_load 0.00152661 0.00738394 0.00190358 0.000421468 0.00183431 0.000311327 19;12 525.326 371 1
4 tests/benchmark/test_benchmark.py::test_NodeCollector_load_lazy 0.00156251 0.00320052 0.00193457 0.000231565 0.00190831 0.000342627 106;3 516.911 337 1
5 tests/benchmark/test_benchmark.py::test_InputOutput_run_and_save 0.00173931 0.0336749 0.00224264 0.00160267 0.00209521 0.000311802 6;13 445.903 438 1
6 tests/benchmark/test_benchmark.py::test_InputOutput_write_graph 0.00621334 0.0116684 0.00745096 0.000895638 0.00726479 0.000770805 17;7 134.211 104 1
7 tests/benchmark/test_benchmark.py::test_NodeCollector_write_graph 1.46081 1.8764 1.59423 0.162834 1.53624 0.139984 1;1 0.627261 5 1

Please sign in to comment.