Skip to content

Commit 052568b

Browse files
committed
fix: replace hardcoded nd2 test with env var
1 parent 16ed8aa commit 052568b

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
trash/
55
.venv/
66
env/
7+
env.sh
78

89
__pycache__/
910
*.py[cod]

src/nd2_analyzer/ui/app.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ def initMenuBar(self):
257257
test_menu = menu_bar.addMenu("Test")
258258
test_action = QAction("Test", self)
259259
test_action.setShortcut("Ctrl+T")
260-
test_action.triggered.connect(self.hhln_test)
260+
test_action.triggered.connect(self.nd2_test)
261261
test_menu.addAction(test_action)
262262

263263
if sys.platform == "darwin":
@@ -276,10 +276,15 @@ def on_reset_roi(self):
276276
t, p, c = ApplicationState.get_instance().view_index
277277
pub.sendMessage("roi_reset", p=p)
278278

279-
def hhln_test(self):
280-
ImageData.load_nd2(
281-
"/Users/hiram/Documents/EVERYTHING/20-29 Research/22 OliveiraLab/22.12 ND2 analyzer/nd2-analyzer/final_data/rpu_nd2/3-RPU_mCherry_M9Plain_10h002.nd2"
282-
)
279+
def nd2_test(self):
280+
test_path = os.environ.get('PARTAKER_ND2_TEST')
281+
if not test_path:
282+
# Error dialog
283+
QMessageBox.warning(self, "Error", "No PARTAKER_ND2_TEST environment variable!")
284+
return
285+
286+
ImageData.load_nd2(test_path)
287+
# "/Users/hiram/Documents/EVERYTHING/20-29 Research/22 OliveiraLab/22.12 ND2 analyzer/nd2-analyzer/final_data/rpu_nd2/3-RPU_mCherry_M9Plain_10h002.nd2"
283288

284289
def show_experiment_dialog(self):
285290
experiment = ExperimentDialog()
@@ -454,4 +459,4 @@ def highlight_cell(self, cell_id):
454459
app = QApplication(sys.argv)
455460
window = App()
456461
window.show()
457-
sys.exit(app.exec())
462+
sys.exit(app.exec())

0 commit comments

Comments
 (0)