Skip to content

Commit

Permalink
Add ruff + basic implementation of ClassicalClassifier
Browse files Browse the repository at this point in the history
  • Loading branch information
KarelZe committed Nov 20, 2023
1 parent 7b26cf0 commit fb518b9
Show file tree
Hide file tree
Showing 15 changed files with 1,165 additions and 411 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ jobs:
python -m pip install --upgrade pip setuptools
pip install .[dev]
- name: Test with pytest
run: pytest -v --cov=tclf --pyargs tclf
run: pytest -v --cov=src tests/
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
45 changes: 0 additions & 45 deletions examples/plot_classifier.py

This file was deleted.

18 changes: 0 additions & 18 deletions examples/plot_template.py

This file was deleted.

27 changes: 0 additions & 27 deletions examples/plot_transformer.py

This file was deleted.

66 changes: 45 additions & 21 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
packages = ["tclf"]

[project]
name = "otc"
authors = [
Expand Down Expand Up @@ -35,16 +32,6 @@ dynamic = ["version"]
"Homepage" = "https://github.com/KarelZe/thesis"
"Bug Tracker" = "https://github.com/KarelZe/thesis/issues"

[tool.autoflake]
recursive = true
in-place = true
ignore-init-module-imports = true
remove-all-unused-imports = true
remove-unused-variables = true

[tool.isort]
profile = "black"

[tool.mypy]
# https://github.com/python/mypy/issues/2410
ignore_missing_imports = true
Expand All @@ -55,18 +42,13 @@ disallow_incomplete_defs = true
[project.optional-dependencies]
dev=[
"build",
"mypy",
"pre-commit",
"pytest",
"pytest-cov",
"ruff",
]


[tool.pylint.TYPECHECK]
# List of members which are set dynamically and missed by Pylint inference
# system, and so shouldn't trigger E1101 when accessed.
generated-members=["numpy.*", "torch.*"]

[tool.pytest.ini_options]
minversion = 7.0
addopts = "-ra -p no:warnings -v --cov --cov-report term-missing --doctest-modules"
Expand All @@ -79,8 +61,6 @@ omit = [
"tclf/tests/*",
]
branch = true
source = ["tclf"]
include = ["*/tclf/*"]

[tool.coverage.report]
exclude_also = [
Expand All @@ -94,3 +74,47 @@ exclude_also = [
"if self.verbose:"
]
show_missing = true


[tool.ruff]
# See rules: https://beta.ruff.rs/docs/rules/
select = [
"C", # flake8-comprehensions
"D", # pydocstyle
"E", # pycodestyle errors
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"NPY", # numpy
"PD", # pandas-vet
"PIE", # misc lints
"PT", # pytest
"PTH", # flake8-use-pathlib
"PGH", # pygrep
"RET", # return
"RUF", # ruff-specific rules
"UP", # pyupgrade
"SIM", # flake8-simplify
"W", # pycodestyle warnings
]

include = ["*.py", "*.pyi", "**/pyproject.toml", "*.ipynb"]

ignore = [
"E501", # line too long, handled by black
"N803", # argument name should be lowercase
"N806", # variable name should be lowercase
"C901", # too complex
"D206", # indent with white space
"W191", # tab identation
]

[tool.ruff.isort]
known-first-party = ["tclf"]
section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"]

[tool.ruff.per-file-ignores]
"__init__.py" = ["D104", "F401"] # disable missing docstrings in __init__, unused imports

[tool.ruff.pydocstyle]
convention = "google"
File renamed without changes.
Loading

0 comments on commit fb518b9

Please sign in to comment.