forked from NREL/floris
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
170 lines (149 loc) · 3.94 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
[build-system]
requires = ["setuptools >= 40.6.0", "wheel"]
build-backend = "setuptools.build_meta"
[coverage.run]
# Coverage.py configuration file
# https://coverage.readthedocs.io/en/latest/config.html
branch = true
source = "floris/*"
omit = [
"setup.py",
"tests/*"
]
[tool.pytest.ini_options]
testpaths = "tests"
filterwarnings = [
"ignore::DeprecationWarning:pandas.*:"
]
## Pyflakes (F)
## pycodestyle (E, W)
# mccabe (C90)
# isort (I) # Use isort directly until more isort features are included in ruff
# pep8-naming (N)
# pydocstyle (D)
# pyupgrade (UP)
# flake8-2020 (YTT)
# flake8-annotations (ANN)
# flake8-bandit (S)
# flake8-blind-except (BLE)
# flake8-boolean-trap (FBT)
# flake8-bugbear (B)
# flake8-builtins (A)
# flake8-commas (COM)
# flake8-comprehensions (C4)
# flake8-datetimez (DTZ)
# flake8-debugger (T10)
# flake8-errmsg (EM)
# flake8-executable (EXE)
# flake8-implicit-str-concat (ISC)
# flake8-import-conventions (ICN)
# flake8-logging-format (G)
# flake8-no-pep420 (INP)
# flake8-pie (PIE)
# flake8-print (T20)
# flake8-pytest-style (PT)
# flake8-quotes (Q)
# flake8-return (RET)
# flake8-simplify (SIM)
# flake8-tidy-imports (TID)
# flake8-type-checking (TCH)
# flake8-unused-arguments (ARG)
# flake8-use-pathlib (PTH)
# eradicate (ERA)
# pandas-vet (PD)
# pygrep-hooks (PGH)
# Pylint (PL)
# - Convention (PLC)
# - Error (PLE)
# - Refactor (PLR)
# - Warning (PLW)
# tryceratops (TRY)
# flake8-raise (RSE)
# flake8-self (SLF)
# Ruff-specific rules (RUF)
[tool.ruff]
src = ["floris", "tests"]
line-length = 100
target-version = "py310"
# See https://github.com/charliermarsh/ruff#supported-rules
# for rules included and matching to prefix.
select = ["F", "E", "W", "C4", ] #"T20", "I"
# I - isort is not fully implemented in ruff so there is not parity. Consider disabling I.
# F401 unused-import: Ignore until all used isort flags are adopted in ruff
ignore = ["F401"]
# Allow autofix for all enabled rules (when `--fix`) is provided.
# fixable = ["A", "B", "C", "D", "E", "F"]
fixable = ["F", "E", "W", "C4"] #"T20", "I"
unfixable = []
# Exclude a variety of commonly ignored directories.
exclude = [
"floris/version.py",
".bzr",
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.per-file-ignores]
# F841 unused-variable: ignore since this file uses numexpr and many variables look unused
"floris/simulation/wake_deflection/jimenez.py" = ["F841"]
"floris/simulation/wake_turbulence/crespo_hernandez.py" = ["F841"]
"floris/simulation/wake_deflection/gauss.py" = ["F841"]
"floris/simulation/wake_velocity/jensen.py" = ["F841"]
"floris/simulation/wake_velocity/gauss.py" = ["F841"]
"floris/simulation/wake_velocity/empirical_gauss.py" = ["F841"]
# I001 unsorted-imports: ignore because the import order is meaningful to navigate
# import dependencies
"floris/simulation/__init__.py" = ["I001"]
# FIXME
"floris/tools/interface_utilities.py" = ["F821"]
"floris/tools/wind_rose.py" = ["F821"]
[tool.ruff.isort]
combine-as-imports = true
known-first-party = ["floris"]
order-by-type = false
# lines-after-imports = 2
# [tool.ruff.mccabe]
# # Unlike Flake8, default to a complexity level of 10.
# max-complexity = 10
[tool.isort]
sections = [
"FUTURE",
"STDLIB",
"THIRDPARTY",
"FIRSTPARTY",
"LOCALFOLDER"
]
known_first_party = [
"floris"
]
multi_line_output = 3
combine_as_imports = true
force_grid_wrap = 3
include_trailing_comma = true
use_parentheses = true
lines_after_imports = 2
line_length = 100
order_by_type = false
split_on_trailing_comma = true
# length_sort = true
# case_sensitive: False
# force_sort_within_sections: True
# reverse_relative: True
# sort_relative_in_force_sorted_sections: True