-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ruff toml * ruff fix * fix and format * update ruff * remove ruff config in pyproject * lint workflow use ruff.toml * unpin ruff * fix circular imports * clean up imports * revert to 3.9 annotations, dataclasses_json does not work with __future__ annotations * pin ruff
- Loading branch information
Showing
55 changed files
with
1,356 additions
and
838 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
include = ["src/fairchem/core/**/*.py", "src/fairchem/data/oc/**/*.py"] | ||
line-length = 88 | ||
|
||
[lint] | ||
select = [ | ||
"B", # flake8-bugbear | ||
"C4", # flake8-comprehensions | ||
"E", # pycodestyle error | ||
"EXE", # flake8-executable | ||
"F", # pyflakes | ||
"FA", # flake8-future-annotations | ||
"FBT003", # boolean-positional-value-in-call | ||
"FLY", # flynt | ||
"I", # isort | ||
"ICN", # flake8-import-conventions | ||
"PD", # pandas-vet | ||
"PERF", # perflint | ||
"PIE", # flake8-pie | ||
"PL", # pylint | ||
"PT", # flake8-pytest-style | ||
"PYI", # flakes8-pyi | ||
"Q", # flake8-quotes | ||
"RET", # flake8-return | ||
"RSE", # flake8-raise | ||
"RUF", # Ruff-specific rules | ||
"SIM", # flake8-simplify | ||
"SLOT", # flake8-slots | ||
"TCH", # flake8-type-checking | ||
"TID", # tidy imports | ||
"TID", # flake8-tidy-imports | ||
"UP", # pyupgrade | ||
"W", # pycodestyle warning | ||
"YTT", # flake8-2020 | ||
] | ||
ignore = [ | ||
"PLR", # Design related pylint codes | ||
"E501", # Line too long | ||
"B028", # No explicit stacklevel | ||
"EM101", # Exception must not use a string literal | ||
"EM102", # Exception must not use an f-string literal | ||
"G004", # f-string in Logging statement | ||
"RUF015", # Prefer next(iter()) | ||
"RET505", # Unnecessary `elif` after `return` | ||
"PT004", # Fixture does not return anthing | ||
"B017", # pytest.raises | ||
"PT011", # pytest.raises | ||
"PT012", # pytest.raises" | ||
"E741", # ambigous variable naming, i.e. one letter | ||
"FBT003", # boolean positional variable in function call | ||
"PERF203", # `try`-`except` within a loop incurs performance overhead (no overhead in Py 3.11+) | ||
"EXE002", # The file is executable but no shebang is present (not sure why some files come up as this) | ||
"PLC2401", # non ASCII characters | ||
] | ||
unfixable = [ | ||
"T20", # Removes print statements | ||
"F841", # Removes unused variables | ||
] | ||
|
||
[lint.isort] | ||
known-first-party = ["fairchem.core"] | ||
required-imports = ["from __future__ import annotations"] | ||
|
||
[lint.pydocstyle] | ||
convention = "google" | ||
|
||
[lint.per-file-ignores] | ||
# Ignore `E402` (import violations) in all `__init__.py` files, and in `path/to/file.py`. | ||
"src/fairchem/core/__init__.py" = ["I002"] | ||
"src/fairchem/core/conf.py" = ["I002"] | ||
"src/fairchem/core/common/*" = ["PLW0603"] # Using the global statement to update [] is discouraged | ||
"src/fairchem/core/scripts/*" = ["PLW0603"] # Using the global statement to update [] is discouraged | ||
"src/fairchem/core/models/*" = ["PERF401"] # Use a list comprehension to create a transformed list | ||
"src/fairchem/core/models/gemnet*" = ["B023"] # Function definition does not bind loop variable `first_sph` | ||
# Ignore `E402` (import violations) in all `__init__.py` files, and in `path/to/file.py`. | ||
"src/fairchem/data/oc/core/__init__.py" = ["F401"] | ||
"src/fairchem/data/oc/utils/__init__.py" = ["F401"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
src/fairchem/applications/AdsorbML/adsorbml/scripts/write_top_k_vasp.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from __future__ import annotations | ||
|
||
import argparse | ||
import os | ||
import pickle | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
from .reaction import Reaction | ||
from __future__ import annotations | ||
|
||
from .ocpneb import OCPNEB | ||
from .reaction import Reaction | ||
|
||
__all__ = ["Reaction", "OCPNEB"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.