Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
franneck94 committed Feb 11, 2024
1 parent 665703d commit 2e682a3
Show file tree
Hide file tree
Showing 8 changed files with 170 additions and 151 deletions.
29 changes: 18 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,41 @@ default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-ast
- id: check-builtin-literals
- id: check-merge-conflict
- id: check-yaml
- id: check-toml

- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.1
hooks:
- id: nbqa-isort

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
exclude: ^docs/

- repo: https://github.com/psf/black
rev: 23.10.1
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.1
hooks:
- id: black
exclude: ^docs/
- id: ruff-format
types_or: [python, pyi, jupyter]

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.1.3'
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.2.0'
hooks:
- id: ruff
types_or: [python, pyi, jupyter]
args: [ --fix, --exit-non-zero-on-fix ]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.6.1
rev: v1.8.0
hooks:
- id: mypy
exclude: ^docs/
language: system
pass_filenames: false
args: ['.']
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

## Version 0.4.3: September 12, 2022

- Bugfix for computing the mean val score in CV
- Bugfix for computing the mean validation score in CV

## Version 0.4.2: September 12, 2022

Expand Down
218 changes: 140 additions & 78 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,49 +1,22 @@
[tool.black]
target-version = ['py39']
target-version = ['py38']
line-length = 80
skip-string-normalization = false
skip-magic-trailing-comma = false
extend-exclude = '''
force-exclude = '''
/(
| docs
| setup.py
)/
'''

[tool.isort]
py_version = 39
sections = [
"FUTURE",
"STDLIB",
"THIRDPARTY",
"FIRSTPARTY",
"LOCALFOLDER"
]
default_section = "FIRSTPARTY"
known_third_party = [
"numpy",
"pandas",
"keras",
"tensorflow",
"sklearn",
"matplotlib",
"scipy",
"h5py",
"seaborn",
"numba",
"gym",
"PyQt5",
"PyQt6",
"pyqtgraph",
"torch",
"tqdm",
"cv2",
"skimage",
"tensorflow_datasets",
"scikeras"
]
py_version = 38
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
default_section = "THIRDPARTY"
known_third_party = []
known_first_party = []
known_local_folder = ["tensorcross"]
known_local_folder = []
# style: black
multi_line_output = 3
include_trailing_comma = true
Expand All @@ -54,14 +27,131 @@ line_length = 80
split_on_trailing_comma = true
lines_after_imports = 2
force_single_line = true
skip_glob = [
"docs/*",
"setup.py"
skip_glob = ["docs/*", "setup.py"]
filter_files = true

[tool.ruff]
target-version = "py38"
line-length = 80
indent-width = 4
extend-exclude = ["docs", "test", "tests"]

[tool.ruff.lint]
select = ["F", "E"]
extend-select = [
"C90",
"I",
"N",
"UP",
"YTT",
"ANN",
"ASYNC",
"TRIO",
"S",
"BLE",
"B",
"A",
"COM",
"C4",
"DTZ",
"T10",
"DJ",
"EM",
"EXE",
"FA",
"ISC",
"ICN",
"G",
"INP",
"PIE",
"PYI",
"PT",
"Q",
"RSE",
"RET",
"SLOT",
"SIM",
"TID",
"TCH",
"INT",
"ARG",
"PTH",
"PD",
"PL",
"TRY",
"FLY",
"NPY",
"AIR",
"PERF",
"FURB",
"LOG",
"RUF",
]
ignore = [
"ANN101",
"ANN102",
"I001",
"NPY002",
"INP001",
"TRY003",
"ISC001",
"COM812",
"UP",
"TCH003",
"ANN401",
"TCH",
"PTH",
]
fixable = ["ALL"]
unfixable = []
preview = true
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

[tool.ruff.lint.isort]
force-single-line = true
force-sort-within-sections = false
lines-after-imports = 2
known-first-party = []
known-local-folder = []
known-third-party = []
section-order = [
"future",
"standard-library",
"third-party",
"first-party",
"local-folder",
]

[tool.ruff.lint.mccabe]
max-complexity = 24

[tool.ruff.lint.pycodestyle]
ignore-overlong-task-comments = true

[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.ruff.lint.flake8-annotations]
allow-star-arg-any = false
ignore-fully-untyped = false

[tool.ruff.lint.pylint]
max-args = 5
max-branches = 12
max-locals = 15
max-statements = 50

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
preview = false
docstring-code-format = true

[tool.mypy]
# Platform configuration
python_version = "3.8"
python_version = "3.10"
# imports related
ignore_missing_imports = true
follow_imports = "silent"
Expand Down Expand Up @@ -89,7 +179,7 @@ disallow_any_decorated = false
disallow_any_explicit = false
disallow_any_generics = false
# Miscellaneous strictness flags
allow_untyped_globals = true
allow_untyped_globals = false
allow_redefinition = false
local_partial_types = false
implicit_reexport = true
Expand All @@ -98,56 +188,28 @@ strict_equality = true
show_error_context = false
show_column_numbers = false
show_error_codes = true
exclude = ["examples"]

[tool.ruff]
target-version = "py39"
select = ["F", "E"]
extend-select = ["W", "C90", "I", "N", "UP", "YTT", "ANN", "ASYNC", "B", "A", "C4", "DTZ", "FA", "ISC", "ICN", "PIE", "PYI", "PT", "RET", "SLOT", "SIM", "ARG", "PTH", "PD", "PLC", "PLE", "PLR", "PLW", "FLY", "NPY", "PERF", "RUF"]
ignore = ["I001", "ANN401", "SIM300", "PERF203", "ANN101", "B905", "UP007", "UP006", "PTH", "UP035"]
fixable = ["F", "E", "W", "C90", "I", "N", "UP", "YTT", "ANN", "ASYNC", "B", "A", "C4", "DTZ", "FA", "ISC", "ICN", "PIE", "PYI", "PT", "RET", "SLOT", "SIM", "ARG", "PTH", "PD", "PLC", "PLE", "PLR", "PLW", "FLY", "NPY", "PERF", "RUF"]
unfixable = []
line-length = 80
extend-exclude = ["tests", "test"]
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.isort]
force-single-line = true
force-sort-within-sections = false
lines-after-imports = 2
[tool.ruff.mccabe]
max-complexity = 24
[tool.ruff.pycodestyle]
ignore-overlong-task-comments = true
[tool.ruff.pydocstyle]
convention = "numpy"
[tool.ruff.flake8-annotations]
allow-star-arg-any = false
ignore-fully-untyped = false
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
exclude = ["docs", "test", "tests"]

[tool.pyright]
pythonVersion = "3.9"
pythonVersion = "3.10"
typeCheckingMode = "basic"
# enable subset of "strict"
reportDuplicateImport = true
reportInvalidStubStatement = true
reportOverlappingOverload = true
reportPropertyTypeMismatch = true
reportUntypedClassDecorator = true
reportUntypedClassDecorator = false
reportUntypedFunctionDecorator = true
reportUntypedNamedTuple = true
reportUnusedImport = true
# disable subset of "basic"
reportGeneralTypeIssues = false
reportGeneralTypeIssues = true
reportMissingModuleSource = false
reportOptionalCall = false
reportOptionalIterable = false
reportOptionalMemberAccess = false
reportOptionalOperand = false
reportOptionalSubscript = false
reportPrivateImportUsage = false
reportOptionalCall = true
reportOptionalIterable = true
reportOptionalMemberAccess = true
reportOptionalOperand = true
reportOptionalSubscript = true
reportPrivateImportUsage = true
reportUnboundVariable = true
exclude = ["docs", "setup.py"]
52 changes: 0 additions & 52 deletions setup.cfg

This file was deleted.

4 changes: 2 additions & 2 deletions tensorcross/model_selection/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

__all__ = [
"BaseSearch",
"GridSearch",
"RandomSearch",
"BaseSearchCV",
"GridSearch",
"GridSearchCV",
"RandomSearch",
"RandomSearchCV",
]
Loading

0 comments on commit 2e682a3

Please sign in to comment.