-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
164 lines (147 loc) · 4.82 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
[tool.poetry]
name = "rra-climate-health"
version = "0.0.1"
description = "A collection of geospatial models examining the relationship between climate variables, socio-demographic indicators, and health outcomes."
authors = [
"Victor Vilchis Tella <[email protected]>",
]
license = "BSD-3-Clause"
readme = "README.md"
documentation = "https://ihmeuw.github.io/rra-climate-health"
homepage = "https://ihmeuw.github.io/rra-climate-health"
repository = "https://github.com/ihmeuw/rra-climate-health"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
packages = [
{ include = "rra_climate_health", from = "src" }
]
[tool.poetry.dependencies]
python = ">=3.10, <3.13"
click = "*"
numpy = "^1.26.0"
pandas = "^1.5"
pymer4 = "^0.8.2"
scikit-learn = "^1.5.0"
matplotlib = "^3.9.0"
seaborn = "^0.13.2"
xarray = "^2024.1.0"
rasterra = "^0.5.12"
geopandas = "^1.0.0"
rra-tools = "^1.0.11"
rasterio = "^1.3.10"
pyarrow = "^16.1.0"
netcdf4 = "^1.7.1"
pydantic = "^2.7.4"
pyyaml = "^6.0.1"
reportlab = "^4.2.2"
rioxarray = "^0.17.0"
[tool.poetry.group.dev.dependencies]
mkdocstrings = {version = ">=0.23", extras = ["python"]}
mkdocs-material = "*"
mkdocs-table-reader-plugin = "*"
mypy = "*"
pre-commit = "*"
pymdown-extensions = "*"
pytest = "*"
pytest-github-actions-annotate-failures = "*"
pytest-cov = "*"
python-kacl = "*"
ruff = ">=0.2.0"
pandas-stubs = "^2.2.2.240909"
types-pyyaml = "^6.0.12.20240917"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry.scripts]
strun = "spatial_temp_cgf.cli:strun"
sttask = "spatial_temp_cgf.cli:sttask"
[tool.ruff]
target-version = "py310" # The lowest supported version
[tool.ruff.lint]
# By default, enable all the lint rules.
# Add to the ignore list below if you don't want some rules.
# If you need some ignores for certain modules, see tool.ruff.lint.per-file-ignores below.
# For individual ignore cases, prefer inline `# noqa`s within the code.
select = ["ALL"]
ignore = [
"COM812", # flake8 missing trailing comma, fomatter handles
"ISC001", # Implicit string concatenation is not allowed
"ANN", # Type hints related, let mypy handle these.
"D", # Docstrings related, way too strict to our taste
"T201", # Use of `print` detected, we don't have formal logging yet.
"PD901", # Don't use generic 'df', practicality beats purity.
"PD008", # .at is okay
"PD010", # I like .unstack()
"PD101", # nunique is totally reasonable to use and cleaner than the suggestion
"PD015", # pd.merge is a-ok
"RET504", # Assign to variable before return, useful for debugging
"FBT001", # Boolean type positional arg, annoying with cli flags
"S603", # Supbrocess arg validation, prone to false positives
"FIX002", # TODOs are okay.
"TD002", # TODOs don't need an author
"TD003", # TODOs don't need a linked issue
"PYI041", # float | int is better explicit typing than depending on a special case
"RUF005", # list concatenation is fine
"RUF007", # zip is idiomatic, this check is dumb.
"RET505", # Else after return, too many false positives.
"E501", # Line too long, handled by ruff format
"UP038", # tuple in isinstance is fine
"PERF401", # Loops are sometimes fine
]
[tool.ruff.lint.per-file-ignores]
"tests/**" = [
"S101", # "Use of `assert` detected"
"ARG", # "Unused function argument". Fixtures are often unused.
"S105", # "Possible hardcoded password".
]
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.ruff.lint.pep8-naming]
classmethod-decorators = [
"classmethod",
"pydantic.validator",
"pydantic.root_validator",
]
[tool.ruff.lint.pylint]
max-args = 10
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.pytest.ini_options]
addopts = """\
--cov rra_climate_health \
--cov tests \
--cov-report term-missing \
--no-cov-on-fail \
"""
[tool.mypy]
# This is the global mypy configuration.
# Avoid changing this!
strict = true # See all the enabled flags `mypy --help | grep -A 10 'Strict mode'`
disallow_any_unimported = false
# You can use this list to exclude directories, files or modules from type checking.
# exclude = []
# handle mypy errors when 3rd party packages are not typed.
[[tool.mypy.overrides]]
module = [
"affine.*",
"geopandas.*",
"rasterio.*",
"scipy.*",
"seaborn.*",
"shapely.*",
"sklearn.*",
"rpy2.*",
"pymer4.*",
"reportlab.*",
]
ignore_missing_imports = true