diff --git a/CHANGELOG b/CHANGELOG index 07dad25..19d6b16 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ 0.9.2 - ref: improve speed when displaying QMap data + - enh: add developer mode for loading creep-compliance data (#14) - setup: bump afmformats from 0.13.3 to 0.14.3 (mostly speed, support AFM workshop maps) - setup: bump nanite from 1.7.4 to 1.7.6 (mostly speed) diff --git a/docs/sec_interface.rst b/docs/sec_interface.rst index 57fee01..449b652 100644 --- a/docs/sec_interface.rst +++ b/docs/sec_interface.rst @@ -244,3 +244,15 @@ documentation `. The button at the bottom starts the PyJibe curve rater which is compatible to the nanite rating workflow. If you would like to import your own training set, please read the quick guide :ref:`sec_qg_import_ts`. + + +Developer mode +============== +Under *Edit | Developer mode*, you can enable developer mode which will: + +- Allow you to open experimental data that were not recorded via + force-distance modality (e.g. creep-compliance). Related issues are + `nanite #11 `_ and + `afmformats #15 `_. +- Slow down loading of large datasets (because the modality has to be + determined first). diff --git a/pyjibe/head/main.py b/pyjibe/head/main.py index c1573d0..5010272 100644 --- a/pyjibe/head/main.py +++ b/pyjibe/head/main.py @@ -15,6 +15,7 @@ import h5py import lmfit import nanite +import nanite.read import numpy import scipy import sklearn @@ -67,6 +68,11 @@ def __init__(self, *args, **kwargs): self.action_open_bulk.triggered.connect(self.on_open_bulk) self.action_open_single.triggered.connect(self.on_open_single) self.action_open_multiple.triggered.connect(self.on_open_multiple) + # Edit menu + is_dev_mode = bool(int(self.settings.value("developer mode", "0"))) + self.action_developer_mode.setChecked(is_dev_mode) + self.on_developer_mode(is_dev_mode) + self.action_developer_mode.triggered.connect(self.on_developer_mode) # Tool menu self.actionConvert_AFM_data.triggered.connect(self.on_tool_convert) # Help menu @@ -146,6 +152,7 @@ def rem_subwindow(self, title): self.menuExport.removeAction(action) break + @QtCore.pyqtSlot() def on_about(self): about_text = "PyJibe is a user interface for data analysis in " \ + "atomic force microscopy with an emphasis on biological " \ @@ -157,10 +164,22 @@ def on_about(self): "PyJibe {}".format(__version__), about_text) + @QtCore.pyqtSlot(bool) + def on_developer_mode(self, checked): + # remember in settings + self.settings.setValue("developer mode", str(int(checked))) + # set nanite + if checked: + nanite.read.DEFAULT_MODALITY = None + else: + nanite.read.DEFAULT_MODALITY = "force-distance" + + @QtCore.pyqtSlot() def on_documentation(self): webbrowser.open("https://pyjibe.readthedocs.io") - def on_open_bulk(self, evt=None): + @QtCore.pyqtSlot() + def on_open_bulk(self): dlg = custom_widgets.DirectoryDialogMultiSelect(self) search_dir = self.settings.value("paths/load data", "") dlg.setDirectory(search_dir) @@ -172,7 +191,8 @@ def on_open_bulk(self, evt=None): self.settings.setValue("paths/load data", str(dlg.getDirectory())) - def on_open_multiple(self, evt=None): + @QtCore.pyqtSlot() + def on_open_multiple(self): dlg = custom_widgets.DirectoryDialogMultiSelect(self) search_dir = self.settings.value("paths/load data", "") dlg.setDirectory(search_dir) @@ -185,7 +205,8 @@ def on_open_multiple(self, evt=None): self.settings.setValue("paths/load data", str(dlg.getDirectory())) - def on_open_single(self, evt=None): + @QtCore.pyqtSlot() + def on_open_single(self): ext_opts = [] # all exts = ["*"+e for e in registry.known_suffixes] @@ -206,6 +227,7 @@ def on_open_single(self, evt=None): self.settings.setValue("paths/load data", str(pathlib.Path(n[0]).parent)) + @QtCore.pyqtSlot() def on_software(self): libs = [afmformats, h5py, @@ -228,6 +250,7 @@ def on_software(self): "Software", sw_text) + @QtCore.pyqtSlot() def on_tool_convert(self): dlg = ConvertDialog(self) dlg.show() diff --git a/pyjibe/head/main.ui b/pyjibe/head/main.ui index 3dedc79..0b28731 100644 --- a/pyjibe/head/main.ui +++ b/pyjibe/head/main.ui @@ -109,7 +109,14 @@ + + + &Edit + + + + @@ -174,6 +181,14 @@ Convert AFM data + + + true + + + &Developer mode + +