Skip to content

Commit 07650bc

Browse files
committed
all\refac: #68 use tfds
- general refactor for preffering usage of tfds - use ruff for formatting and linting - update contribution docs
1 parent ec8b11d commit 07650bc

Some content is hidden

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

46 files changed

+2392
-1825
lines changed

.github/workflows/python-ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,13 @@ jobs:
7272
- name: Run mypy
7373
run: |
7474
cd core
75-
poetry run mypy seg_tgce
75+
poetry run mypy .
7676
77-
- name: Run pylint
77+
- name: Run linter
7878
run: |
7979
cd core
80-
poetry run pylint seg_tgce
80+
poetry run ruff check .
81+
poetry run ruff format --exit-non-zero-on-format .
8182
8283
lint-docs:
8384
runs-on: ubuntu-22.04

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ notebooks/**/.ipynb_checkpoints
1010
core/dist
1111
__data__
1212
**/results/**
13-
tuner_results/
13+
tuner_results/
14+
**/vis/

.vscode/launch.json

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
55
"version": "0.2.0",
66
"configurations": [
7+
78
{
89
"name": "Poetry: Oxford pet",
910
"type": "debugpy",
@@ -48,13 +49,26 @@
4849
"PYTHONPATH": "${workspaceFolder}"
4950
}
5051
},
52+
{
53+
"name": "Poetry: Histology baseline experiment",
54+
"type": "debugpy",
55+
"request": "launch",
56+
"module": "seg_tgce.experiments.histology.baseline",
57+
"console": "integratedTerminal",
58+
"justMyCode": true,
59+
"env": {
60+
"PYTHONPATH": "${workspaceFolder}"
61+
},
62+
// "args": ["--use-tuner"],
63+
},
5164
{
5265
"name": "Poetry: Histology scalar experiment",
5366
"type": "debugpy",
5467
"request": "launch",
5568
"module": "seg_tgce.experiments.histology.scalar",
5669
"console": "integratedTerminal",
5770
"justMyCode": true,
71+
"args": ["--use-tuner"],
5872
"env": {
5973
"PYTHONPATH": "${workspaceFolder}"
6074
}
@@ -92,6 +106,17 @@
92106
"PYTHONPATH": "${workspaceFolder}"
93107
}
94108
},
109+
{
110+
"name": "Poetry: Crowd seg tfds",
111+
"type": "debugpy",
112+
"request": "launch",
113+
"module": "seg_tgce.data.crowd_seg.tfds_builder",
114+
"console": "integratedTerminal",
115+
"justMyCode": true,
116+
"env": {
117+
"PYTHONPATH": "${workspaceFolder}"
118+
}
119+
},
95120
{
96121
"name": "Poetry: Unet",
97122
"type": "debugpy",
@@ -124,6 +149,28 @@
124149
"env": {
125150
"PYTHONPATH": "${workspaceFolder}"
126151
}
127-
}
152+
},
153+
{
154+
"name": "Tgce scalar debug",
155+
"type": "debugpy",
156+
"request": "launch",
157+
"module": "seg_tgce.loss.tgce_debug",
158+
"console": "integratedTerminal",
159+
"justMyCode": true,
160+
"env": {
161+
"PYTHONPATH": "${workspaceFolder}"
162+
}
163+
},
164+
{
165+
"name": "Poetry: Oxford pet tfds",
166+
"type": "debugpy",
167+
"request": "launch",
168+
"module": "seg_tgce.data.oxford_pet.oxford_pet_tfds",
169+
"console": "integratedTerminal",
170+
"justMyCode": true,
171+
"env": {
172+
"PYTHONPATH": "${workspaceFolder}"
173+
}
174+
},
128175
]
129176
}

.vscode/settings.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
{
22
"editor.formatOnSave": true,
3-
"editor.rulers": [88],
3+
"editor.rulers": [90],
44
"python.analysis.autoImportCompletions": true,
55
"[json]": {
66
"editor.defaultFormatter": "esbenp.prettier-vscode",
7-
"editor.formatOnSave": true
7+
"editor.formatOnSave": true,
88
},
99
"[python]": {
10-
"editor.defaultFormatter": "ms-python.black-formatter",
10+
"editor.defaultFormatter": "charliermarsh.ruff",
1111
"editor.formatOnSave": true,
1212
"editor.codeActionsOnSave": {
13-
"source.organizeImports": "explicit"
13+
"source.organizeImports": "explicit",
14+
"source.fixAll": "explicit"
1415
}
1516
},
16-
"isort.args": ["--profile", "black"],
17-
"isort.path": ["~/.env/python", "-m", "isort"],
18-
"workbench.colorTheme": "Gruvbox Dark Hard"
17+
"workbench.colorTheme": "Gruvbox Dark Hard",
18+
"mypy-type-checker.cwd": "${nearestConfig}",
19+
"python.defaultInterpreterPath": "${workspaceFolder}/core/.venv/bin/python"
1920
}

0 commit comments

Comments
 (0)