-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
208 lines (186 loc) · 6.32 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
[build-system]
requires = ["hatchling>=1.8.0"]
build-backend = "hatchling.build"
[project]
name = "temporalscope"
dynamic = ["version"]
description = "TemporalScope: Model-Agnostic Temporal Feature Importance Analysis."
authors = [
{ name = "Philip Ndikum", email = "philip-ndikum@users.noreply.github.com" },
{ name = "Serge Ndikum" },
{ name = "Kane Norman", email = "kanenorman@fas.harvard.edu" },
]
license = "Apache-2.0"
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
"shap>=0.46.0",
"borutashap>=1.0.17",
"scikit-learn>=1.5.1",
"polars>=1.5.0",
"statsmodels>=0.14.2",
"pyarrow>=17.0.0",
"lightgbm>=4.5.0",
"flax>=0.8.5",
"jax>=0.4.31",
"modin[all]>=0.31.0",
"python-dotenv>=1.0.1",
]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"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 :: Scientific/Engineering :: Artificial Intelligence",
]
keywords = [
"Shap",
"Borutashap",
"Feature-Importance",
"Temporal-Feature-Importance",
"Temporal-Feature-Analysis",
"XAI",
"ML",
"AI",
"Machine-Learning",
"Artificial-Intelligence",
"TemporalScope",
"Time-Series",
]
[project.optional-dependencies]
docs = [
"pydata-sphinx-theme",
"myst-parser",
"sphinx >=4.0",
"sphinx-copybutton",
"sphinx-autodoc-typehints",
"sphinx-autodoc-annotation",
'sphinx-autoapi',
]
[project.urls]
"Source code" = "https://github.com/philip-ndikum/TemporalScope"
Documentation = "https://temporalscope.readthedocs.io/en/latest/"
[tool.hatch.envs.default]
dependencies = ["pre-commit", "ruff", "jupyterlab", "notebook", "commitizen"]
[tool.hatch.envs.docs]
features = ["docs"]
[tool.hatch.envs.test]
extra-dependencies = ["pytest", "pytest-cov", "pytest-custom_exit_code", "pytest-mock"]
[tool.hatch.envs.docs.scripts]
build = "sphinx-build -WTb html . _build"
serve = "python -m http.server --directory _build"
[tool.hatch.envs.test.scripts]
unit = 'pytest --cov-report xml:coverage.xml --cov="temporalscope" -m "not integration" {args:test}'
integration = 'pytest --cov-report xml:coverage.xml --cov="temporalscope" -m "integration" {args:test}'
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-v -ra -q"
log_cli = true
log_cli_level = "INFO"
log_format = "[%(asctime)s][%(levelname)s] %(message)s"
log_date_format = "%Y-%m-%d %H:%M:%S"
minversion = "6.0"
filterwarnings = "ignore"
[tool.ruff.format]
docstring-code-format = true
[tool.ruff]
extend-exclude = ["*.pyc", "tutorial_notebooks/*"]
target-version = "py310"
line-length = 120
[tool.ruff.lint]
select = [
"C4", # flake8-comprehensions
"C90", # McCabe cyclomatic complexity
"E501", # Long lines
"EXE", # flake8-executable
"F", # Pyflakes
"INT", # flake8-gettext
"PERF", # Perflint
"PL", # Pylint
"Q", # flake8-quotes
"SIM", # flake8-simplify
"SLOT", # flake8-slots
"T10", # flake8-debugger
"W", # pycodestyle
"YTT", # flake8-2020
"I", # isort
# built-in shadowing
"A001", # builtin-variable-shadowing
"A002", # builtin-argument-shadowing
"A003", # builtin-attribute-shadowing
# docstring rules
"D", # flake8-docstrings
]
ignore = [
"D400", # Ignore "First line should end with a period" for docstrings.
"D401", # Ignore "First line should be in imperative mood" for docstrings.
"D415", # Ignore "First line should end with a period, question mark, or exclamation point."
"E501", # Ignore "Line too long" in docstrings/comments for exceeding 120 characters.
"PERF203", # `try`-`except` within a loop incurs performance overhead
"PERF401", # Use a list comprehension to create a transformed list
"PLR1714", # repeated-equality-comparison
"PLR5501", # collapsible-else-if
"PLW2901", # redefined-loop-name
"SIM108", # if-else-block-instead-of-if-exp
"PLR0913", # too many arguments
"SIM102", # temporary
"C901", # temporary
"D100", # Missing docstring in public module
"D104", # Missing docstring in public package
"D211", # No blank lines allowed before class docstring
"D213", # Multi-line docstring summary should start at the second line
"D203", # 1 blank line required before class docstring
]
[tool.ruff.lint.per-file-ignores]
"docs/conf.py" = ["A001", "D103"]
[tool.mypy]
files = "src/temporalscope"
python_version = "3.10"
ignore_missing_imports = true
warn_unreachable = true
exclude = 'test/*'
warn_return_any = false # Turn off MyPy warnings for missing return types
[tool.bandit]
exclude_dirs = ["test"]
[tool.hatch.build.targets.wheel]
packages = ["src/temporalscope"]
[tool.hatch.build.targets.sdist]
include = ["/src", "/VERSION.txt"]
[tool.hatch.version]
path = "VERSION.txt"
pattern = "(?P<version>.+)"
[tool.hatch.envs.default.scripts]
check = "ruff check {args}"
fix = "ruff check --fix"
format = "ruff format {args}"
format-check = "ruff format --check {args}"
docformat = """
docformatter --check --recursive --wrap-summaries 120 --wrap-descriptions 120 src/temporalscope || \
docformatter --in-place --recursive --wrap-summaries 120 --wrap-descriptions 120 src/temporalscope
"""
clear-coverage = "coverage erase"
# Automated developer Q&A script
quality-assurance = """
pytest &&
docformatter --check --recursive --wrap-summaries 120 --wrap-descriptions 120 src/temporalscope || \
docformatter --in-place --recursive --wrap-summaries 120 --wrap-descriptions 120 src/temporalscope
ruff check src/temporalscope --output-format=full --show-files --show-fixes &&
mypy src/temporalscope --ignore-missing-imports --show-error-codes --warn-unreachable &&
bandit -r src/temporalscope
"""
generate-kernel = """
python -m ipykernel install --user --name temporalscope-kernel --display-name "TemporalScope"
echo "Jupyter kernel 'TemporalScope' created. You can now use it in Jupyter notebooks."
"""
[tool.commitizen]
version = "0.1.0"
update_changelog_on_bump = true
tag_format = "v$version"
version_files = ["pyproject.toml:version", "VERSION.txt"]
[tool.hatch.metadata]
allow-direct-references = true