Skip to content

Commit 03af146

Browse files
authored
Merge branch 'cy/pre-release-fixes-2.0' into cy/upgrade-gentl-backend
2 parents fe62907 + df89e7e commit 03af146

6 files changed

Lines changed: 603 additions & 101 deletions

File tree

.pre-commit-config.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.4.0
3+
rev: v6.0.0
44
hooks:
55
- id: check-added-large-files
66
- id: check-yaml
7+
- id: check-toml
78
- id: end-of-file-fixer
89
- id: name-tests-test
910
args: [--pytest-test-first]
1011
- id: trailing-whitespace
1112
- id: check-merge-conflict
13+
- repo: https://github.com/tox-dev/pyproject-fmt
14+
rev: v2.15.2
15+
hooks:
16+
- id: pyproject-fmt
17+
- repo: https://github.com/abravalheri/validate-pyproject
18+
rev: v0.25
19+
hooks:
20+
- id: validate-pyproject
1221
- repo: https://github.com/astral-sh/ruff-pre-commit
13-
rev: v0.14.10
22+
rev: v0.15.0
1423
hooks:
1524
# Run the formatter.
1625
- id: ruff-format

dlclivegui/processors/dlc_processor_socket.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ def register_processor(cls):
4040
return cls
4141

4242

43-
# pragma: no cover
44-
class OneEuroFilter:
43+
class OneEuroFilter: # pragma: no cover
4544
def __init__(self, t0, x0, dx0=None, min_cutoff=1.0, beta=0.0, d_cutoff=1.0):
4645
self.min_cutoff = min_cutoff
4746
self.beta = beta
@@ -81,8 +80,6 @@ def __call__(self, t, x):
8180

8281

8382
# pragma: cover
84-
85-
8683
class BaseProcessorSocket(Processor):
8784
"""
8885
Base processor class that implements a socket server to help remote control recording in experiments.
@@ -492,7 +489,7 @@ def get_data(self):
492489

493490

494491
@register_processor
495-
class ExampleProcessorSocketCalculateMousePose(BaseProcessorSocket):
492+
class ExampleProcessorSocketCalculateMousePose(BaseProcessorSocket): # pragma: no cover
496493
"""
497494
DLC Processor with pose calculations (center, heading, head angle) and optional filtering.
498495
@@ -663,7 +660,7 @@ def get_data(self):
663660

664661

665662
@register_processor
666-
class ExampleProcessorSocketFilterKeypoints(BaseProcessorSocket):
663+
class ExampleProcessorSocketFilterKeypoints(BaseProcessorSocket): # pragma: no cover
667664
PROCESSOR_NAME = "Mouse Pose with less keypoints"
668665
PROCESSOR_DESCRIPTION = "Calculates mouse center, heading, and head angle with optional One-Euro filtering"
669666
PROCESSOR_PARAMS = {

pyproject.toml

Lines changed: 109 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,54 @@
11
[build-system]
2-
requires = ["setuptools>=68.0"]
32
build-backend = "setuptools.build_meta"
3+
requires = [ "setuptools>=68" ]
44

55
[project]
66
name = "deeplabcut-live-gui"
7-
dynamic = ["version"]
87
description = "PySide6-based GUI to run real time DeepLabCut experiments"
98
readme = "README.md"
10-
requires-python = ">=3.10"
11-
license-files = ["LICENSE"]
12-
authors = [
13-
{name = "A. & M. Mathis Labs", email = "adim@deeplabcut.org"}
14-
]
15-
keywords = ["deeplabcut", "pose estimation", "real-time", "gui", "deep learning"]
9+
keywords = [ "deep learning", "deeplabcut", "gui", "pose estimation", "real-time" ]
10+
license-files = [ "LICENSE" ]
11+
authors = [ { name = "A. & M. Mathis Labs", email = "adim@deeplabcut.org" } ]
12+
requires-python = ">=3.10,<3.13"
1613
classifiers = [
17-
"Programming Language :: Python :: 3",
18-
"Programming Language :: Python :: 3.10",
19-
"Programming Language :: Python :: 3.11",
20-
"Programming Language :: Python :: 3.12",
21-
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
22-
"Operating System :: OS Independent",
23-
"Development Status :: 4 - Beta",
24-
"Intended Audience :: Science/Research",
25-
"Topic :: Scientific/Engineering :: Artificial Intelligence",
26-
"Framework :: Qt",
27-
"Environment :: X11 Applications :: Qt",
14+
"Development Status :: 4 - Beta",
15+
"Environment :: X11 Applications :: Qt",
16+
"Intended Audience :: Science/Research",
17+
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
18+
"Operating System :: OS Independent",
19+
"Programming Language :: Python :: 3 :: Only",
20+
"Programming Language :: Python :: 3.10",
21+
"Programming Language :: Python :: 3.11",
22+
"Programming Language :: Python :: 3.12",
23+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
2824
]
29-
25+
dynamic = [ "version" ]
3026
dependencies = [
31-
"deeplabcut-live>=2.0.0", # might be missing timm and scipy
32-
"PySide6",
33-
"qdarkstyle",
34-
"numpy",
35-
"opencv-python",
36-
"cv2-enumerate-cameras",
37-
"pydantic>=2.0",
38-
"vidgear[core]",
39-
"matplotlib",
27+
"cv2-enumerate-cameras",
28+
"deeplabcut-live>=2", # might be missing timm and scipy
29+
"matplotlib",
30+
"numpy",
31+
"opencv-python",
32+
"pydantic>=2",
33+
"pyside6",
34+
"qdarkstyle",
35+
"vidgear[core]",
4036
]
41-
42-
[project.optional-dependencies]
43-
basler = ["pypylon"]
44-
gentl = ["harvesters"]
45-
all = ["pypylon", "harvesters"]
46-
pytorch = [
47-
"deeplabcut-live[pytorch]>=2.0.0", # this includes timm and scipy
37+
optional-dependencies.all = [ "harvesters", "pypylon" ]
38+
optional-dependencies.basler = [ "pypylon" ]
39+
optional-dependencies.dev = [
40+
"hypothesis>=6",
41+
"pre-commit",
42+
"pytest>=7",
43+
"pytest-cov>=4",
44+
"pytest-mock>=3.10",
45+
"pytest-qt>=4.2",
4846
]
49-
tf = [
50-
"deeplabcut-live[tf]>=2.0.0",
47+
optional-dependencies.gentl = [ "harvesters" ]
48+
optional-dependencies.pytorch = [
49+
"deeplabcut-live[pytorch]>=2", # this includes timm and scipy
5150
]
51+
<<<<<<< cy/upgrade-gentl-backend
5252
dev = [
5353
"pytest>=7.0",
5454
"pytest-cov>=4.0",
@@ -65,44 +65,62 @@ test = [
6565
"pytest-qt>=4.2",
6666
"pytest-timeout>=2.0",
6767
"hypothesis>=6.0",
68+
=======
69+
optional-dependencies.test = [
70+
"hypothesis>=6",
71+
"pytest>=7",
72+
"pytest-cov>=4",
73+
"pytest-mock>=3.10",
74+
"pytest-qt>=4.2",
6875
]
76+
optional-dependencies.tf = [
77+
"deeplabcut-live[tf]>=2",
78+
>>>>>>> cy/pre-release-fixes-2.0
79+
]
80+
urls."Bug Tracker" = "https://github.com/DeepLabCut/DeepLabCut-live-GUI/issues"
81+
urls.Documentation = "https://github.com/DeepLabCut/DeepLabCut-live-GUI"
82+
urls.Homepage = "https://github.com/DeepLabCut/DeepLabCut-live-GUI"
83+
urls.Repository = "https://github.com/DeepLabCut/DeepLabCut-live-GUI"
84+
scripts.dlclivegui = "dlclivegui:main"
6985

70-
[project.urls]
71-
Homepage = "https://github.com/DeepLabCut/DeepLabCut-live-GUI"
72-
Repository = "https://github.com/DeepLabCut/DeepLabCut-live-GUI"
73-
Documentation = "https://github.com/DeepLabCut/DeepLabCut-live-GUI"
74-
"Bug Tracker" = "https://github.com/DeepLabCut/DeepLabCut-live-GUI/issues"
75-
76-
[project.scripts]
77-
dlclivegui = "dlclivegui:main"
78-
86+
[tool.setuptools]
7987
# [tool.setuptools]
88+
8089
# include-package-data = true
8190

8291
# This is more granular and explicit than include-package-data,
92+
8393
# which can be too broad and include unwanted files.
84-
[tool.setuptools.package-data]
85-
"dlclivegui.assets" = ["*.png"]
8694

95+
package-data."dlclivegui.assets" = [ "*.png" ]
96+
packages.find.where = [ "." ]
97+
packages.find.include = [ "dlclivegui*" ]
98+
packages.find.exclude = [ "tests*", "docs*" ]
8799

88-
[tool.setuptools.packages.find]
89-
where = ["."]
90-
include = ["dlclivegui*"]
91-
exclude = ["tests*", "docs*"]
100+
[tool.ruff]
101+
target-version = "py310"
102+
line-length = 120
103+
fix = true
104+
lint.select = [ "B", "E", "F", "I", "UP" ]
105+
lint.ignore = [ "E741" ]
106+
107+
[tool.pyproject-fmt]
108+
generate-python-classifiers = false
92109

93-
[tool.pytest.ini_options]
94-
testpaths = ["tests"]
95-
python_files = ["test_*.py"]
96-
python_classes = ["Test*"]
97-
python_functions = ["test_*"]
98-
addopts = [
99-
"--strict-markers",
100-
"--strict-config",
101-
"--disable-warnings",
102-
# "--maxfail=1",
103-
"-ra",
104-
"-q",
110+
[tool.pytest]
111+
ini_options.testpaths = [ "tests" ]
112+
ini_options.python_files = [ "test_*.py" ]
113+
ini_options.python_classes = [ "Test*" ]
114+
ini_options.python_functions = [ "test_*" ]
115+
ini_options.addopts = [
116+
"--strict-markers",
117+
"--strict-config",
118+
"--disable-warnings",
119+
# "--maxfail=1",
120+
"-ra",
121+
"-q",
105122
]
123+
<<<<<<< cy/upgrade-gentl-backend
106124
markers = [
107125
"unit: Unit tests for individual components",
108126
"integration: Integration tests for component interaction",
@@ -111,33 +129,33 @@ markers = [
111129
# "slow: Tests that take a long time to run",
112130
"gui: Tests that require GUI interaction",
113131
"timeout: Test timeout in seconds (pytest-timeout)",
132+
=======
133+
ini_options.markers = [
134+
"unit: Unit tests for individual components",
135+
"integration: Integration tests for component interaction",
136+
"functional: Functional tests for end-to-end workflows",
137+
"hardware: Tests that require specific hardware, notable camera backends",
138+
# "slow: Tests that take a long time to run",
139+
"gui: Tests that require GUI interaction",
140+
>>>>>>> cy/pre-release-fixes-2.0
114141
]
115142

116-
[tool.coverage.run]
117-
source = ["dlclivegui"]
118-
omit = [
119-
"*/tests/*",
120-
"*/__pycache__/*",
121-
"*/site-packages/*",
143+
[tool.coverage]
144+
run.branch = true
145+
run.omit = [
146+
"*/__pycache__/*",
147+
"*/site-packages/*",
122148
]
123-
124-
[tool.coverage.report]
125-
exclude_lines = [
126-
"pragma: no cover",
127-
"def __repr__",
128-
"raise AssertionError",
129-
"raise NotImplementedError",
130-
"if __name__ == .__main__.:",
131-
"if TYPE_CHECKING:",
132-
"@abstract",
149+
run.source = [ "dlclivegui", "tests" ]
150+
report.exclude_lines = [
151+
"@abstract",
152+
"def __repr__",
153+
"if __name__ == .__main__.:",
154+
"if TYPE_CHECKING:",
155+
"pragma: no cover",
156+
"raise AssertionError",
157+
"raise NotImplementedError",
158+
]
159+
report.omit = [
160+
"tests/*",
133161
]
134-
135-
[tool.ruff]
136-
lint.select = ["E", "F", "B", "I", "UP"]
137-
lint.ignore = ["E741"]
138-
target-version = "py310"
139-
fix = true
140-
line-length = 120
141-
142-
[tool.ruff.lint.pydocstyle]
143-
convention = "google"

0 commit comments

Comments
 (0)