Skip to content

Commit 2c75dec

Browse files
committed
update project_name to dbs_annotator
1 parent b316e1b commit 2c75dec

65 files changed

Lines changed: 274 additions & 234 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
A desktop application for annotating Deep Brain Stimulation (DBS) clinical programming sessions. Built for clinicians and researchers working with DBS systems (Medtronic Percept and others).
44

5-
**Version:** derived from `clinical_dbs_annotator.__version__`
5+
**Version:** derived from `dbs_annotator.__version__`
66
**Author:** Lucia Poma (lucia.poma@wysscenter.ch)
77

88
## For End Users
@@ -79,14 +79,14 @@ pip install -e .
7979
```bash
8080
python run.py
8181
# or
82-
python -m clinical_dbs_annotator
82+
python -m dbs_annotator
8383
```
8484

8585
### Project Structure
8686

8787
```
8888
App_ClinicalDBSAnnot/
89-
├── src/clinical_dbs_annotator/ # Application source code
89+
├── src/dbs_annotator/ # Application source code
9090
│ ├── models/ # Data models (session, scales, stimulation, electrode)
9191
│ ├── views/ # Qt views (step0-3, annotations, wizard window)
9292
│ ├── controllers/ # Business logic (wizard controller)
-95.2 MB
Binary file not shown.

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from datetime import datetime
44
from importlib import metadata
55

6-
_DIST_NAME = "clinical-dbs-annotator"
6+
_DIST_NAME = "dbs-annotator"
77

88
project = "Clinical DBS Annotator"
99
author = "Lucia Poma"

pyproject.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[project]
2-
name = "clinical-dbs-annotator"
2+
name = "dbs-annotator"
33
description = "A graphical user interface for annotating DBS clinical programming sessions"
44
readme = "README.md"
55
requires-python = ">=3.14"
@@ -51,22 +51,22 @@ docs = [
5151
]
5252

5353
[project.scripts]
54-
clinical-dbs-annotator = "clinical_dbs_annotator.__main__:main"
54+
dbs-annotator = "dbs_annotator.__main__:main"
5555

5656
[project.urls]
57-
Homepage = "https://github.com/bml/clinical-dbs-annotator"
58-
Repository = "https://github.com/bml/clinical-dbs-annotator"
59-
Documentation = "https://github.com/bml/clinical-dbs-annotator/blob/main/README.md"
57+
Homepage = "https://github.com/bml/dbs-annotator"
58+
Repository = "https://github.com/bml/dbs-annotator"
59+
Documentation = "https://github.com/bml/dbs-annotator/blob/main/README.md"
6060

6161
[build-system]
6262
requires = ["hatchling"]
6363
build-backend = "hatchling.build"
6464

6565
[tool.hatch.version]
66-
path = "src/clinical_dbs_annotator/__init__.py"
66+
path = "src/dbs_annotator/__init__.py"
6767

6868
[tool.hatch.build.targets.wheel]
69-
packages = ["src/clinical_dbs_annotator"]
69+
packages = ["src/dbs_annotator"]
7070

7171
[tool.pytest.ini_options]
7272
testpaths = ["tests"]
@@ -75,7 +75,7 @@ python_classes = ["Test*"]
7575
python_functions = ["test_*"]
7676
addopts = [
7777
"--verbose",
78-
"--cov=clinical_dbs_annotator",
78+
"--cov=dbs_annotator",
7979
"--cov-report=html",
8080
"--cov-report=term-missing",
8181
]

run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import sys
1212

13-
from clinical_dbs_annotator.__main__ import main
13+
from dbs_annotator.__main__ import main
1414

1515
if __name__ == "__main__":
1616
sys.exit(main())

scripts/ClinicalDBSAnnotator.iss

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,59 +5,57 @@
55
#define AppName "ClinicalDBSAnnotator"
66
#define AppVersion "0.3.0"
77
#define AppPublisher "Brain Modulation Lab"
8-
#define AppURL "https://github.com/bml/clinical-dbs-annotator"
8+
#define AppURL "https://github.com/bml/dbs-annotator"
99
#define AppExeName "ClinicalDBSAnnotator_Windows_0_3_0.exe"
1010

1111
[Setup]
12-
AppId={{{{A1B2C3D4-E5F6-7890-ABCD-EF1234567890}}}}
13-
AppName={{{{#AppName}}}}
14-
AppVersion={{{{#AppVersion}}}}
15-
AppPublisher={{{{#AppPublisher}}}}
16-
AppPublisherURL={{{{#AppURL}}}}
17-
AppSupportURL={{{{#AppURL}}}}
18-
AppUpdatesURL={{{{#AppURL}}}}
19-
DefaultDirName={{{{autopf}}}}\{{{{{#AppName}}}}}
20-
DefaultGroupName={{{{#AppName}}}}
12+
AppId={{A1B2C3D4-E5F6-7890-ABCD-EF1234567890}
13+
AppName={#AppName}
14+
AppVersion={#AppVersion}
15+
AppPublisher={#AppPublisher}
16+
AppPublisherURL={#AppURL}
17+
AppSupportURL={#AppURL}
18+
AppUpdatesURL={#AppURL}
19+
DefaultDirName={autopf}\{#AppName}
20+
DefaultGroupName={#AppName}
2121
AllowNoIcons=yes
2222
OutputDir=installer_output
23-
OutputBaseFilename={{{{#AppName}}}}_Setup_{{{{{#AppVersion}}}}_Windows
23+
OutputBaseFilename={#AppName}_Setup_{#AppVersion}_Windows
2424
Compression=lzma2/max
2525
SolidCompression=yes
2626
WizardStyle=Modern
27-
WizardImageFile=..\icons\logoneutral.bmp
28-
WizardSmallImageFile=..\icons\logoneutral-small.bmp
2927
SetupIconFile=..\icons\logoneutral.ico
30-
UninstallDisplayIcon={{{{app}}}}\{{{{{#AppExeName}}}}}
28+
UninstallDisplayIcon={app}\{#AppExeName}
3129
ChangesAssociations=yes
3230

3331
[Languages]
3432
Name: "english"; MessagesFile: "compiler:Default.isl"
3533
Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
3634

3735
[Tasks]
38-
Name: "desktopicon"; Description: "{{{{cm:CreateDesktopIcon}}}}"; GroupDescription: "{{{{cm:AdditionalIcons}}}}"
39-
Name: "quicklaunchicon"; Description: "{{{{cm:CreateQuickLaunchIcon}}}}"; GroupDescription: "{{{{cm:AdditionalIcons}}}}"; OnlyBelowVersion: 6.1
36+
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
37+
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; OnlyBelowVersion: 6.1
4038

4139
[Files]
4240
; Main application files from PyInstaller onedir build
43-
Source: "dist\ClinicalDBSAnnotator_Windows_0_3_0\*"; DestDir: "{{{{app}}}}"; Flags: ignoreversion recursesubdirs createallsubdirs
41+
Source: "dist\ClinicalDBSAnnotator_Windows_0_3_0\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
4442
; Icon file for shortcuts
45-
Source: "..\icons\logoneutral.ico"; DestDir: "{{{{app}}}}"; Flags: ignoreversion
43+
Source: "..\icons\logoneutral.ico"; DestDir: "{app}"; Flags: ignoreversion
4644

4745
[Icons]
48-
Name: "{{{{group}}}}\{{{{{#AppName}}}}"; Filename: "{{{{app}}}}\{{{{{#AppExeName}}}}"; IconFilename: "{{{{app}}}}\logoneutral.ico"
49-
Name: "{{{{commondesktop}}}}\{{{{{#AppName}}}}"; Filename: "{{{{app}}}}\{{{{{#AppExeName}}}}"; IconFilename: "{{{{app}}}}\logoneutral.ico"; Tasks: desktopicon
50-
Name: "{{{{userappdata}}}}\Microsoft\Internet Explorer\Quick Launch\{{{{{#AppName}}}}"; Filename: "{{{{app}}}}\{{{{{#AppExeName}}}}"; IconFilename: "{{{{app}}}}\logoneutral.ico"; Tasks: quicklaunchicon
46+
Name: "{group}\{#AppName}"; Filename: "{app}\{#AppExeName}"; IconFilename: "{app}\logoneutral.ico"
47+
Name: "{commondesktop}\{#AppName}"; Filename: "{app}\{#AppExeName}"; IconFilename: "{app}\logoneutral.ico"; Tasks: desktopicon
48+
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AppName}"; Filename: "{app}\{#AppExeName}"; IconFilename: "{app}\logoneutral.ico"; Tasks: quicklaunchicon
5149

5250
[Run]
53-
Filename: "{{{{app}}}}\{{{{{#AppExeName}}}}"; Description: "{{{{cm:LaunchProgram,{{{{#StringChange(AppName, '&', '&&')}}}}}}"; Flags: nowait postinstall skipifsilent
51+
Filename: "{app}\{#AppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(AppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
5452

5553
[Registry]
5654
; File association for .tsv annotation files
5755
Root: HKCR; Subkey: ".tsv\OpenWithProgids"; ValueType: string; ValueName: "ClinicalDBSAnnotator.tsv"; ValueData: ""; Flags: uninsdeletevalue
5856
Root: HKCR; Subkey: "ClinicalDBSAnnotator.tsv"; ValueType: string; ValueName: ""; ValueData: "Clinical DBS Annotator File"; Flags: uninsdeletekey
59-
Root: HKCR; Subkey: "ClinicalDBSAnnotator.tsv\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{{{{app}}}}\logoneutral.ico,0"
60-
Root: HKCR; Subkey: "ClinicalDBSAnnotator.tsv\shell\open\command"; ValueType: string; ValueName: ""; ValueData: '"{{{{app}}}}\{{{{{#AppExeName}}}}" "%1"'
57+
Root: HKCR; Subkey: "ClinicalDBSAnnotator.tsv\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\logoneutral.ico,0"
58+
Root: HKCR; Subkey: "ClinicalDBSAnnotator.tsv\shell\open\command"; ValueType: string; ValueName: ""; ValueData: ""{app}\{#AppExeName}" "%1""
6159

6260
[UninstallDelete]
63-
Type: filesandordirs; Name: "{{{{app}}}}
61+
Type: filesandordirs; Name: "{app}"

scripts/build_macos.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424

2525
def _read_version() -> str:
26-
init_path = SRC_DIR / "clinical_dbs_annotator" / "__init__.py"
26+
init_path = SRC_DIR / "dbs_annotator" / "__init__.py"
2727
text = init_path.read_text(encoding="utf-8")
2828
m = re.search(
2929
r'^__version__\s*=\s*["\']([^"\']+)["\']\s*$', text, flags=re.MULTILINE
@@ -72,7 +72,7 @@ def build_macos_app(*, console: bool, onefile: bool):
7272
name = f"{APP_NAME}_{PLATFORM}_{VERSION.replace('.', '_')}"
7373
entrypoint = PROJECT_ROOT / "run.py"
7474
styles_dir = PROJECT_ROOT / "styles"
75-
config_dir = SRC_DIR / "clinical_dbs_annotator" / "config"
75+
config_dir = SRC_DIR / "dbs_annotator" / "config"
7676

7777
icon_icns = ICONS_DIR / "logoneutral.icns"
7878
icon_fallback = ICONS_DIR / "logoneutral.ico"
@@ -98,11 +98,11 @@ def build_macos_app(*, console: bool, onefile: bool):
9898
"--hidden-import=pandas",
9999
"--hidden-import=openpyxl",
100100
"--hidden-import=xlrd",
101-
"--hidden-import=PySide6.QtCore",
102-
"--hidden-import=PySide6.QtGui",
103-
"--hidden-import=PySide6.QtWidgets",
101+
"--hidden-import=dbs_annotator",
102+
"--collect-all=PySide6",
104103
"--exclude-module=PySide6.QtWebEngineWidgets",
105104
"--exclude-module=PySide6.QtWebEngineCore",
105+
"--osx-bundle-identifier=com.bml.dbs-annotator",
106106
# Add data files (macOS uses : separator)
107107
f"--add-data={ICONS_DIR / 'logoneutral.ico'}:icons",
108108
f"--add-data={ICONS_DIR / 'logoneutral.png'}:icons",
@@ -124,6 +124,16 @@ def build_macos_app(*, console: bool, onefile: bool):
124124
else:
125125
cmd.append("--windowed")
126126

127+
# Add package metadata for version detection (macOS venv layout)
128+
venv_lib = PROJECT_ROOT / ".venv" / "lib"
129+
if venv_lib.exists():
130+
# macOS: .venv/lib/pythonX.Y/site-packages
131+
dist_info_dirs = list(
132+
venv_lib.glob("python*/site-packages/dbs_annotator*.dist-info")
133+
)
134+
if dist_info_dirs:
135+
cmd.append(f"--add-data={dist_info_dirs[0]}:.")
136+
127137
# Run PyInstaller
128138
try:
129139
subprocess.run(cmd, check=True, cwd=PROJECT_ROOT)
@@ -168,8 +178,8 @@ def main():
168178
ICONS_DIR / "logoneutral.png",
169179
PROJECT_ROOT / "styles" / "dark_theme.qss",
170180
PROJECT_ROOT / "styles" / "light_theme.qss",
171-
SRC_DIR / "clinical_dbs_annotator" / "config" / "clinical_presets.json",
172-
SRC_DIR / "clinical_dbs_annotator" / "config" / "session_scales_presets.json",
181+
SRC_DIR / "dbs_annotator" / "config" / "clinical_presets.json",
182+
SRC_DIR / "dbs_annotator" / "config" / "session_scales_presets.json",
173183
]
174184

175185
for path in required_files:

scripts/build_windows.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222

2323
def _read_version() -> str:
24-
init_path = SRC_DIR / "clinical_dbs_annotator" / "__init__.py"
24+
init_path = SRC_DIR / "dbs_annotator" / "__init__.py"
2525
text = init_path.read_text(encoding="utf-8")
2626
m = re.search(
2727
r'^__version__\s*=\s*["\']([^"\']+)["\']\s*$', text, flags=re.MULTILINE
@@ -41,7 +41,7 @@ def build_windows_exe(*, console: bool, onefile: bool) -> bool:
4141
name = f"{APP_NAME}_{PLATFORM}_{VERSION.replace('.', '_')}"
4242
entrypoint = PROJECT_ROOT / "run.py"
4343
styles_dir = PROJECT_ROOT / "styles"
44-
config_dir = SRC_DIR / "clinical_dbs_annotator" / "config"
44+
config_dir = SRC_DIR / "dbs_annotator" / "config"
4545

4646
cmd = [
4747
sys.executable,
@@ -58,6 +58,7 @@ def build_windows_exe(*, console: bool, onefile: bool) -> bool:
5858
"--hidden-import=pandas",
5959
"--hidden-import=openpyxl",
6060
"--hidden-import=xlrd",
61+
"--hidden-import=dbs_annotator",
6162
]
6263

6364
if onefile:
@@ -84,6 +85,13 @@ def build_windows_exe(*, console: bool, onefile: bool) -> bool:
8485
]
8586
)
8687

88+
# Add package metadata for version detection
89+
venv_site_packages = PROJECT_ROOT / ".venv" / "Lib" / "site-packages"
90+
dist_info_dirs = list(venv_site_packages.glob("dbs_annotator*.dist-info"))
91+
if dist_info_dirs:
92+
dist_info = dist_info_dirs[0]
93+
cmd.append(f"--add-data={dist_info};.")
94+
8795
try:
8896
subprocess.run(cmd, check=True, cwd=PROJECT_ROOT)
8997
print("\n✓ Build successful!")

scripts/build_windows_nuitka.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
BUILD_DIR = PROJECT_ROOT / "build"
2626
ICONS_DIR = PROJECT_ROOT / "icons"
2727
STYLES_DIR = PROJECT_ROOT / "styles"
28-
CONFIG_DIR = SRC_DIR / "clinical_dbs_annotator" / "config"
28+
CONFIG_DIR = SRC_DIR / "dbs_annotator" / "config"
2929

3030
NAME = "ClinicalDBSAnnotator"
3131
ENTRYPOINT = PROJECT_ROOT / "run.py"
3232

3333

3434
def _read_version() -> str:
35-
init_path = SRC_DIR / "clinical_dbs_annotator" / "__init__.py"
35+
init_path = SRC_DIR / "dbs_annotator" / "__init__.py"
3636
text = init_path.read_text(encoding="utf-8")
3737
m = re.search(
3838
r'^__version__\s*=\s*["\']([^"\']+)["\']\s*$', text, flags=re.MULTILINE

0 commit comments

Comments
 (0)