You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* adding chceks for toml files into actions
* lint fixes
* lint checks
* link fixes
* changes
* disabling ruff check
* change to path info instead
* adding E501 and E721 to be ignored for now
---------
Co-authored-by: Tim Hunter <tim.hunter@ecmwf.int>
Copy file name to clipboardExpand all lines: packages/common/pyproject.toml
+17-10Lines changed: 17 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ name = "weathergen-common"
3
3
version = "0.1.0"
4
4
description = "The WeatherGenerator Machine Learning Earth System Model"
5
5
readme = "../../README.md"
6
-
requires-python = ">=3.11,<3.13"
6
+
requires-python = ">=3.12,<3.13"
7
7
dependencies = [
8
8
"xarray>=2025.6.1",
9
9
"dask>=2024.9.1",
@@ -42,12 +42,6 @@ not-callable = false
42
42
43
43
44
44
45
-
[tool.black]
46
-
47
-
# Wide rows
48
-
line-length = 100
49
-
50
-
51
45
# The linting configuration
52
46
[tool.ruff]
53
47
@@ -70,7 +64,11 @@ select = [
70
64
# isort
71
65
"I",
72
66
# Banned imports
73
-
"TID"
67
+
"TID",
68
+
# Naming conventions
69
+
"N",
70
+
# print
71
+
"T201"
74
72
]
75
73
76
74
# These rules are sensible and should be enabled at a later stage.
@@ -82,11 +80,20 @@ ignore = [
82
80
"SIM118",
83
81
"SIM102",
84
82
"SIM401",
85
-
"UP040", # TODO: enable later
86
83
# To ignore, not relevant for us
87
-
"SIM108"# in case additional norm layer supports are added in future
84
+
"SIM108", # in case additional norm layer supports are added in future
85
+
"N817", # we use heavy acronyms, e.g., allowing 'import LongModuleName as LMN' (LMN is accepted)
86
+
"E731", # overly restrictive and less readable code
87
+
"N812", # prevents us following the convention for importing torch.nn.functional as F
88
88
]
89
89
90
+
[tool.ruff.lint.flake8-tidy-imports.banned-api]
91
+
"numpy.ndarray".msg = "Do not use 'ndarray' to describe a numpy array type, it is a function. Use numpy.typing.NDArray or numpy.typing.NDArray[np.float32] for example"
# These rules are sensible and should be enabled at a later stage.
46
58
ignore = [
47
-
"E501",
48
-
"E721",
49
-
"E722",
50
59
# "B006",
51
60
"B011",
52
61
"UP008",
53
62
"SIM117",
54
63
"SIM118",
55
64
"SIM102",
56
65
"SIM401",
66
+
"E501", # to be removed
67
+
"E721",
57
68
# To ignore, not relevant for us
58
-
"E741",
69
+
"SIM108", # in case additional norm layer supports are added in future
70
+
"N817", # we use heavy acronyms, e.g., allowing 'import LongModuleName as LMN' (LMN is accepted)
71
+
"E731", # overly restrictive and less readable code
72
+
"N812", # prevents us following the convention for importing torch.nn.functional as F
59
73
]
60
74
75
+
[tool.ruff.lint.flake8-tidy-imports.banned-api]
76
+
"numpy.ndarray".msg = "Do not use 'ndarray' to describe a numpy array type, it is a function. Use numpy.typing.NDArray or numpy.typing.NDArray[np.float32] for example"
0 commit comments