[tool.poetry]
name = "chance_of_showers"
version = "0.0.0"
description = "DAQ and analysis code for chance_of_showers water metrics project"
authors = ["Matthew Epland"]
license = "MIT"
readme = "README.md"
repository = "https://github.com/mepland/chance_of_showers"

[tool.poetry.dependencies]
python = "~=3.11.4"
hydra-core = "^1.3.2"
numpy = "^1.26.4"
pandas = "^2.2.1"
polars = "^0.20.23"
humanize = "^4.9.0"
holidays = "^0.44"
psutil = "^5.9.8"

[tool.poetry.group.dev]
optional = true

[tool.poetry.group.dev.dependencies]
pre-commit = "^3.6.2"
isort = "^5.13.2"
pyupgrade = "^3.15.1"
black = { extras = ["jupyter"], version = "^24.3.0" }
blacken-docs = "^1.16.0"
flake8 = "^7.0.0"
mypy = "^1.8.0"
pylint = "^3.1.0"
bandit = "^1.7.7"
detect-secrets = "^1.4.0"
vulture = "^2.11"
yamllint = "^1.35.1"
blocklint = "^0.2.4"
pymend = { git = "https://github.com/JanEricNitschke/pymend.git" }
deptry = "^0.12.0"
html5validator = "^0.4.2"
typos = "^1.19.0"
proselint = "^0.13.0"
pandas-stubs = "^2.2.0.240218"
types-pillow = "^10.2.0.20240213"
types-pyyaml = "^6.0.12.12"
types-pygments = "^2.17.0.20240106"
types-colorama = "^0.4.15.20240205"
types-decorator = "^5.1.8.20240106"
types-six = "^1.16.21.20240301"
flake8-absolute-import = "^1.0.0.2"
flake8-all-not-strings = "^0.0.1"
flake8-annotations = "^3.0.1"
flake8-assertive = "^2.1.0"
flake8-async = "^22.11.14"
flake8-boolean-trap = "^1.0.1"
flake8-broken-line = "^1.0.0"
flake8-bugbear = "^24.2.6"
flake8-builtins = "^2.2.0"
flake8-clean-block = "^0.1.2"
flake8-coding = "^1.3.2"
flake8-comments = "^0.1.2"
flake8-comprehensions = "^3.14.0"
flake8-datetimez = "^20.10.0"
flake8-dunder-all = "^0.3.1"
flake8-dunder-class-obj = "^0.1.1"
flake8-eradicate = "^1.5.0"
flake8-escaping-style = "^0.1.2"
flake8-functions-names = "^0.4.0"
flake8-future-annotations = "^1.1.0"
flake8-get-chaining = "^0.2.0"
flake8-github-annotations = "^1.1.1"
flake8-import-conventions = "^0.1.0"
flake8-inflammatory-jargon = "^1.0.1"
flake8-keyword-params = "^1.2.0"
flake8-literal = "^1.4.0"
flake8-logging = "^1.5.0"
flake8-loopy = "^1.1.0"
flake8-mutable = "^1.2.0"
flake8-no-debug-vars = "^0.1.0"
flake8-no-implicit-concat = "^0.3.5"
flake8-noqa = "^1.4.0"
flake8-pep3101 = "^2.1.0"
flake8-pep585 = "^0.1.7"
flake8-picky-parentheses = "^0.5.4"
flake8-pie = "^0.16.0"
flake8-printf-formatting = "^1.1.2"
flake8-pyprojecttoml = "^0.0.2"
flake8-pytest-style = "^1.7.2"
flake8-return = "^1.2.0"
flake8-secure-coding-standard = "^1.4.1"
flake8-simplify = "^0.21.0"
flake8-string-format = "^0.3.0"
flake8-type-checking = "^2.9.0"
flake8-typing-as-t = "^0.0.3"
flake8-unused-arguments = "^0.0.13"
flake8-use-fstring = "^1.4"
flake8-use-pathlib = "^0.3.0"
dlint = "^0.14.1"
pandas-vet = "^2023.8.2"
pydoclint = { extras = ["flake8"], version = "^0.4.1" }
tryceratops = "^2.3.2"
ruff = "^0.4.3"

[tool.poetry.group.daq]
optional = true

[tool.poetry.group.daq.dependencies]
adafruit-circuitpython-mcp3xxx = "^1.4.17"
gpiozero = "^2.0.1"
rpi-gpio = "^0.7.1"
"luma.oled" = "^3.13.0"
pause = "^0.3"

[tool.poetry.group.web]
optional = true

[tool.poetry.group.web.dependencies]
flask = "^3.0.2"
flask-socketio = "^5.3.6"
simple-websocket = "^1.0.0"
python-arptable = "^0.0.2"

[tool.poetry.group.ana]
optional = true

[tool.poetry.group.ana.dependencies]
jupyterlab = "^4.1.3"
jupytext = "^1.16.1"
jupyterlab-vim = "^4.1.3"
jupyter-dash = "^0.4.2"
ipywidgets = "^8.1.2"
pyarrow = "^15.0.0"
tqdm = "^4.66.4"
matplotlib = "^3.8.3"
plotly = "^5.19.0"
statsmodels = "^0.14.1"
prophet = "^1.1.5"
torch = { version = "^2.2.1+cu118", source = "pytorch-gpu-src" }
torchvision = { version = "^0.17.1+cu118", source = "pytorch-gpu-src" }
torchaudio = { version = "^2.2.1+cu118", source = "pytorch-gpu-src" }
catboost = "^1.2.3"
lightgbm = "^4.3.0"
darts = "^0.29.0"
tensorboard = "^2.16.2"
bayesian-optimization = "^1.4.3"
xlsxwriter = "^3.2.0"

[[tool.poetry.source]]
name = "pytorch-gpu-src"
url = "https://download.pytorch.org/whl/cu118"
priority = "explicit"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.isort]
py_version = "311"
profile = "black"
multi_line_output = 3
combine_star = "true"
group_by_package = "true"
skip_gitignore = "true"
atomic = "true"
treat_comments_as_code = ["# %%"]

[tool.black]
line-length = 100
target-version = ["py311"]
extend-exclude = '''
/(
  ^\.cache
  | \.direnv
  | \.env
  | \.git
  | \.github
  | \.ipynb_checkpoints
  | \.venv
  | __pycache__
)/
'''

[tool.flake8]
max-complexity = 20
ignore = [
  "E501",
  "ESC102",
  "FNE003",
  "FNE004",
  "FNE008",
  "PD005",
  "PIE786",
  "SCS109",
  "TRY003",
  "TYT03",
  "W503",
]
extend-select = ["B901", "B902", "B903", "B904", "B905", "B906", "B907", "B908"]
per-file-ignores = [
  "ana/exploratory_ana.py:E402,E800,DALL000",
  "ana/drive_bayesian_opt.py:E402,CM001",
  "ana/manual_bad_point.py:E402,E800",
]
extend-exclude = [
  ".cache",
  ".direnv",
  ".env",
  ".git",
  ".github",
  ".ipynb_checkpoints",
  ".venv",
  "__pycache__",
]
literal-inline-quotes = "double"
literal-multiline-quotes = "double"
no-accept-encodings = true
# https://jsh9.github.io/pydoclint/config_options.html
style = "google"
arg-type-hints-in-docstring = true

[tool.ruff]
extend-exclude = [
  ".cache",
  ".direnv",
  ".env",
  ".git",
  ".github",
  ".ipynb_checkpoints",
  ".venv",
  "__pycache__",
]

[tool.ruff.lint.per-file-ignores]
"ana/exploratory_ana.py" = ["E402"]

[tool.mypy]
python_version = "3.11"
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disable_error_code = ["import"]
# warn_unused_ignores = true is useful when upgrading mypy versions,
# but leaving it as true all the time gives false positives when running mypy in the pre-commit env
warn_unused_ignores = false
exclude = [
  ".cache",
  ".direnv",
  ".env",
  ".git",
  ".github",
  ".ipynb_checkpoints",
  ".venv",
  "__pycache__",
]

[tool.pylint.main]
fail-under = 10
fail-on = "I"
jobs = 0
py-version = "3.11"
suggestion-mode = true
ignore = [
  ".cache",
  ".direnv",
  ".env",
  ".git",
  ".github",
  ".ipynb_checkpoints",
  ".venv",
  "__pycache__",
]

[tool.pylint."MESSAGES CONTROL"]
disable = [
  "line-too-long",
  "global-statement",
  "useless-return",
  "too-many-branches",
  "too-many-lines",
  "wrong-import-position",
  "ungrouped-imports",
  "unnecessary-pass",
  "broad-exception-caught",
  "logging-format-interpolation",
  "logging-fstring-interpolation",
  "logging-not-lazy",
]
enable = ["useless-suppression"]

[tool.pylint.design]
max-args = 8
max-locals = 30
max-statements = 100
max-attributes = 15
max-nested-blocks = 6
min-public-methods = 1

[tool.pylint.basic]
attr-naming-style = "snake_case"
class-const-naming-style = "UPPER_CASE"
class-naming-style = "PascalCase"
const-naming-style = "UPPER_CASE"
function-naming-style = "snake_case"
method-naming-style = "snake_case"
module-naming-style = "snake_case"
variable-naming-style = "snake_case"
good-names = ["i", "j", "k", "ex", "Run", "_", "x", "y", "ax", "v", "n"]

[tool.vulture]
paths = ["."]
exclude = [
  ".cache",
  ".direnv",
  ".env",
  ".git",
  ".github",
  ".ipynb_checkpoints",
  ".venv",
  "__pycache__",
]

[tool.pymend]
input-style = "auto"
output-style = "google"
check = true
force-params = true
force-params-min-n-params = 0
force-meta-min-func-length = 0
force-return = true
force-raises = true
force-methods = false
force-attributes = false
force-defaults = true
ignore-privates = true
ignore-unused-arguments = true
ignored-functions = ["__init__", "on_exception"]
extend-exclude = '''
(
  ^\.cache
  | .direnv
  | .env
  | .git
  | .github
  | .ipynb_checkpoints
  | .venv
  | __pycache__
  | .dev_config
)
'''

[tool.deptry]
ignore = [
  "DEP003", # transitive dependencies
  "DEP004", # false positives from optional poetry groups
]

[tool.deptry.per_rule_ignores]
DEP001 = [
  "board",     # adafruit-circuitpython-mcp3xxx
  "busio",     # adafruit-circuitpython-mcp3xxx
  "digitalio", # adafruit-circuitpython-mcp3xxx
  "PIL",       # luma-core
]

[tool.typos.default]
locale = "en-us"
extend-ignore-words-re = ["MAPE", "Dout"]

[tool.typos.files]
extend-exclude = [
  ".cache",
  ".direnv",
  ".env",
  ".git",
  ".github",
  ".ipynb_checkpoints",
  ".venv",
  "__pycache__",
  "*.kicad*",
]
ignore-hidden = false
ignore-parent = false
