datalab-platform 0.0.1.dev0__py3-none-any.whl → 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- datalab/__init__.py +35 -2
- datalab/adapters_metadata/__init__.py +31 -0
- datalab/adapters_metadata/base_adapter.py +316 -0
- datalab/adapters_metadata/common.py +422 -0
- datalab/adapters_metadata/geometry_adapter.py +98 -0
- datalab/adapters_metadata/table_adapter.py +84 -0
- datalab/adapters_plotpy/__init__.py +54 -0
- datalab/adapters_plotpy/annotations.py +124 -0
- datalab/adapters_plotpy/base.py +110 -0
- datalab/adapters_plotpy/converters.py +86 -0
- datalab/adapters_plotpy/factories.py +80 -0
- datalab/adapters_plotpy/objects/__init__.py +0 -0
- datalab/adapters_plotpy/objects/base.py +197 -0
- datalab/adapters_plotpy/objects/image.py +157 -0
- datalab/adapters_plotpy/objects/scalar.py +565 -0
- datalab/adapters_plotpy/objects/signal.py +264 -0
- datalab/adapters_plotpy/roi/__init__.py +0 -0
- datalab/adapters_plotpy/roi/base.py +146 -0
- datalab/adapters_plotpy/roi/factory.py +93 -0
- datalab/adapters_plotpy/roi/image.py +207 -0
- datalab/adapters_plotpy/roi/signal.py +72 -0
- datalab/app.py +98 -0
- datalab/config.py +817 -0
- datalab/control/__init__.py +0 -0
- datalab/control/baseproxy.py +776 -0
- datalab/control/proxy.py +343 -0
- datalab/control/remote.py +1005 -0
- datalab/data/doc/DataLab_en.pdf +0 -0
- datalab/data/doc/DataLab_fr.pdf +0 -0
- datalab/data/icons/analysis/delete_results.svg +109 -0
- datalab/data/icons/analysis/fw1e2.svg +156 -0
- datalab/data/icons/analysis/fwhm.svg +156 -0
- datalab/data/icons/analysis/histogram.svg +49 -0
- datalab/data/icons/analysis/peak_detect.svg +160 -0
- datalab/data/icons/analysis/plot_results.svg +151 -0
- datalab/data/icons/analysis/show_results.svg +83 -0
- datalab/data/icons/analysis/stats.svg +49 -0
- datalab/data/icons/analysis.svg +120 -0
- datalab/data/icons/apply.svg +3 -0
- datalab/data/icons/check_all.svg +15 -0
- datalab/data/icons/collapse.svg +44 -0
- datalab/data/icons/collapse_selection.svg +63 -0
- datalab/data/icons/console.svg +101 -0
- datalab/data/icons/create/1d-normal.svg +8 -0
- datalab/data/icons/create/1d-poisson.svg +9 -0
- datalab/data/icons/create/1d-uniform.svg +8 -0
- datalab/data/icons/create/1d-zero.svg +57 -0
- datalab/data/icons/create/2d-gaussian.svg +56 -0
- datalab/data/icons/create/2d-normal.svg +38 -0
- datalab/data/icons/create/2d-poisson.svg +38 -0
- datalab/data/icons/create/2d-ramp.svg +90 -0
- datalab/data/icons/create/2d-sinc.svg +62 -0
- datalab/data/icons/create/2d-uniform.svg +38 -0
- datalab/data/icons/create/2d-zero.svg +13 -0
- datalab/data/icons/create/checkerboard.svg +39 -0
- datalab/data/icons/create/cosine.svg +12 -0
- datalab/data/icons/create/exponential.svg +55 -0
- datalab/data/icons/create/gaussian.svg +12 -0
- datalab/data/icons/create/grating.svg +29 -0
- datalab/data/icons/create/linear_chirp.svg +7 -0
- datalab/data/icons/create/logistic.svg +7 -0
- datalab/data/icons/create/lorentzian.svg +12 -0
- datalab/data/icons/create/planck.svg +12 -0
- datalab/data/icons/create/polynomial.svg +7 -0
- datalab/data/icons/create/pulse.svg +12 -0
- datalab/data/icons/create/ring.svg +18 -0
- datalab/data/icons/create/sawtooth.svg +7 -0
- datalab/data/icons/create/siemens.svg +35 -0
- datalab/data/icons/create/sinc.svg +12 -0
- datalab/data/icons/create/sine.svg +7 -0
- datalab/data/icons/create/square.svg +7 -0
- datalab/data/icons/create/square_pulse.svg +7 -0
- datalab/data/icons/create/step.svg +7 -0
- datalab/data/icons/create/step_pulse.svg +12 -0
- datalab/data/icons/create/triangle.svg +7 -0
- datalab/data/icons/create/voigt.svg +12 -0
- datalab/data/icons/edit/annotations.svg +72 -0
- datalab/data/icons/edit/annotations_copy.svg +114 -0
- datalab/data/icons/edit/annotations_delete.svg +83 -0
- datalab/data/icons/edit/annotations_edit.svg +98 -0
- datalab/data/icons/edit/annotations_export.svg +85 -0
- datalab/data/icons/edit/annotations_import.svg +85 -0
- datalab/data/icons/edit/annotations_paste.svg +100 -0
- datalab/data/icons/edit/copy_titles.svg +109 -0
- datalab/data/icons/edit/delete.svg +84 -0
- datalab/data/icons/edit/delete_all.svg +214 -0
- datalab/data/icons/edit/duplicate.svg +64 -0
- datalab/data/icons/edit/goto_source.svg +60 -0
- datalab/data/icons/edit/metadata.svg +60 -0
- datalab/data/icons/edit/metadata_add.svg +80 -0
- datalab/data/icons/edit/metadata_copy.svg +96 -0
- datalab/data/icons/edit/metadata_delete.svg +62 -0
- datalab/data/icons/edit/metadata_export.svg +68 -0
- datalab/data/icons/edit/metadata_import.svg +68 -0
- datalab/data/icons/edit/metadata_paste.svg +79 -0
- datalab/data/icons/edit/move_down.svg +55 -0
- datalab/data/icons/edit/move_up.svg +54 -0
- datalab/data/icons/edit/new_group.svg +76 -0
- datalab/data/icons/edit/recompute.svg +60 -0
- datalab/data/icons/edit/rename.svg +49 -0
- datalab/data/icons/edit.svg +16 -0
- datalab/data/icons/expand.svg +44 -0
- datalab/data/icons/expand_selection.svg +63 -0
- datalab/data/icons/fit/cdf_fit.svg +56 -0
- datalab/data/icons/fit/exponential_fit.svg +55 -0
- datalab/data/icons/fit/gaussian_fit.svg +62 -0
- datalab/data/icons/fit/interactive_fit.svg +101 -0
- datalab/data/icons/fit/linear_fit.svg +57 -0
- datalab/data/icons/fit/lorentzian_fit.svg +209 -0
- datalab/data/icons/fit/multigaussian_fit.svg +85 -0
- datalab/data/icons/fit/multilorentzian_fit.svg +85 -0
- datalab/data/icons/fit/piecewiseexponential_fit.svg +209 -0
- datalab/data/icons/fit/planckian_fit.svg +62 -0
- datalab/data/icons/fit/polynomial_fit.svg +59 -0
- datalab/data/icons/fit/sigmoid_fit.svg +56 -0
- datalab/data/icons/fit/sinusoidal_fit.svg +72 -0
- datalab/data/icons/fit/twohalfgaussian_fit.svg +63 -0
- datalab/data/icons/fit/voigt_fit.svg +57 -0
- datalab/data/icons/group.svg +56 -0
- datalab/data/icons/h5/h5array.svg +59 -0
- datalab/data/icons/h5/h5attrs.svg +75 -0
- datalab/data/icons/h5/h5browser.svg +133 -0
- datalab/data/icons/h5/h5file.svg +69 -0
- datalab/data/icons/h5/h5group.svg +49 -0
- datalab/data/icons/h5/h5scalar.svg +1 -0
- datalab/data/icons/help_pdf.svg +46 -0
- datalab/data/icons/history.svg +7 -0
- datalab/data/icons/image.svg +135 -0
- datalab/data/icons/io/fileopen_directory.svg +60 -0
- datalab/data/icons/io/fileopen_h5.svg +84 -0
- datalab/data/icons/io/fileopen_ima.svg +187 -0
- datalab/data/icons/io/fileopen_py.svg +123 -0
- datalab/data/icons/io/fileopen_sig.svg +138 -0
- datalab/data/icons/io/filesave_h5.svg +97 -0
- datalab/data/icons/io/filesave_ima.svg +200 -0
- datalab/data/icons/io/filesave_py.svg +136 -0
- datalab/data/icons/io/filesave_sig.svg +151 -0
- datalab/data/icons/io/import_text.svg +144 -0
- datalab/data/icons/io/save_to_directory.svg +134 -0
- datalab/data/icons/io.svg +84 -0
- datalab/data/icons/libre-camera-flash-off.svg +1 -0
- datalab/data/icons/libre-camera-flash-on.svg +1 -0
- datalab/data/icons/libre-gui-about.svg +1 -0
- datalab/data/icons/libre-gui-action-delete.svg +1 -0
- datalab/data/icons/libre-gui-add.svg +1 -0
- datalab/data/icons/libre-gui-arrow-down.svg +1 -0
- datalab/data/icons/libre-gui-arrow-left.svg +1 -0
- datalab/data/icons/libre-gui-arrow-right.svg +1 -0
- datalab/data/icons/libre-gui-arrow-up.svg +1 -0
- datalab/data/icons/libre-gui-close.svg +40 -0
- datalab/data/icons/libre-gui-cogs.svg +1 -0
- datalab/data/icons/libre-gui-globe.svg +1 -0
- datalab/data/icons/libre-gui-help.svg +1 -0
- datalab/data/icons/libre-gui-link.svg +1 -0
- datalab/data/icons/libre-gui-menu.svg +1 -0
- datalab/data/icons/libre-gui-pencil.svg +1 -0
- datalab/data/icons/libre-gui-plugin.svg +1 -0
- datalab/data/icons/libre-gui-questions.svg +1 -0
- datalab/data/icons/libre-gui-settings.svg +1 -0
- datalab/data/icons/libre-gui-unlink.svg +1 -0
- datalab/data/icons/libre-tech-ram.svg +1 -0
- datalab/data/icons/libre-toolbox.svg +1 -0
- datalab/data/icons/logs.svg +1 -0
- datalab/data/icons/markers.svg +74 -0
- datalab/data/icons/menu.svg +13 -0
- datalab/data/icons/new_ima.svg +148 -0
- datalab/data/icons/new_sig.svg +123 -0
- datalab/data/icons/operations/abs.svg +116 -0
- datalab/data/icons/operations/arithmetic.svg +123 -0
- datalab/data/icons/operations/average.svg +124 -0
- datalab/data/icons/operations/complex_from_magnitude_phase.svg +116 -0
- datalab/data/icons/operations/complex_from_real_imag.svg +124 -0
- datalab/data/icons/operations/constant.svg +116 -0
- datalab/data/icons/operations/constant_add.svg +109 -0
- datalab/data/icons/operations/constant_divide.svg +109 -0
- datalab/data/icons/operations/constant_multiply.svg +109 -0
- datalab/data/icons/operations/constant_subtract.svg +109 -0
- datalab/data/icons/operations/convert_dtype.svg +117 -0
- datalab/data/icons/operations/convolution.svg +46 -0
- datalab/data/icons/operations/deconvolution.svg +57 -0
- datalab/data/icons/operations/derivative.svg +127 -0
- datalab/data/icons/operations/difference.svg +52 -0
- datalab/data/icons/operations/division.svg +139 -0
- datalab/data/icons/operations/exp.svg +116 -0
- datalab/data/icons/operations/flip_horizontally.svg +69 -0
- datalab/data/icons/operations/flip_vertically.svg +74 -0
- datalab/data/icons/operations/im.svg +124 -0
- datalab/data/icons/operations/integral.svg +50 -0
- datalab/data/icons/operations/inverse.svg +143 -0
- datalab/data/icons/operations/log10.svg +109 -0
- datalab/data/icons/operations/phase.svg +116 -0
- datalab/data/icons/operations/power.svg +118 -0
- datalab/data/icons/operations/product.svg +124 -0
- datalab/data/icons/operations/profile.svg +379 -0
- datalab/data/icons/operations/profile_average.svg +399 -0
- datalab/data/icons/operations/profile_radial.svg +261 -0
- datalab/data/icons/operations/profile_segment.svg +262 -0
- datalab/data/icons/operations/quadratic_difference.svg +84 -0
- datalab/data/icons/operations/re.svg +124 -0
- datalab/data/icons/operations/rotate_left.svg +72 -0
- datalab/data/icons/operations/rotate_right.svg +72 -0
- datalab/data/icons/operations/signals_to_image.svg +314 -0
- datalab/data/icons/operations/sqrt.svg +110 -0
- datalab/data/icons/operations/std.svg +124 -0
- datalab/data/icons/operations/sum.svg +102 -0
- datalab/data/icons/play_demo.svg +9 -0
- datalab/data/icons/processing/axis_transform.svg +62 -0
- datalab/data/icons/processing/bandpass.svg +79 -0
- datalab/data/icons/processing/bandstop.svg +71 -0
- datalab/data/icons/processing/binning.svg +126 -0
- datalab/data/icons/processing/clip.svg +119 -0
- datalab/data/icons/processing/detrending.svg +173 -0
- datalab/data/icons/processing/distribute_on_grid.svg +769 -0
- datalab/data/icons/processing/edge_detection.svg +46 -0
- datalab/data/icons/processing/erase.svg +1 -0
- datalab/data/icons/processing/exposure.svg +143 -0
- datalab/data/icons/processing/fourier.svg +104 -0
- datalab/data/icons/processing/highpass.svg +59 -0
- datalab/data/icons/processing/interpolation.svg +71 -0
- datalab/data/icons/processing/level_adjustment.svg +70 -0
- datalab/data/icons/processing/lowpass.svg +60 -0
- datalab/data/icons/processing/morphology.svg +49 -0
- datalab/data/icons/processing/noise_addition.svg +114 -0
- datalab/data/icons/processing/noise_reduction.svg +38 -0
- datalab/data/icons/processing/normalize.svg +84 -0
- datalab/data/icons/processing/offset_correction.svg +131 -0
- datalab/data/icons/processing/resampling1d.svg +101 -0
- datalab/data/icons/processing/resampling2d.svg +240 -0
- datalab/data/icons/processing/reset_positions.svg +185 -0
- datalab/data/icons/processing/resize.svg +9 -0
- datalab/data/icons/processing/reverse_signal_x.svg +171 -0
- datalab/data/icons/processing/stability.svg +11 -0
- datalab/data/icons/processing/swap_x_y.svg +65 -0
- datalab/data/icons/processing/thresholding.svg +63 -0
- datalab/data/icons/processing/windowing.svg +45 -0
- datalab/data/icons/properties.svg +26 -0
- datalab/data/icons/reset.svg +9 -0
- datalab/data/icons/restore.svg +40 -0
- datalab/data/icons/roi/roi.svg +76 -0
- datalab/data/icons/roi/roi_coordinate.svg +78 -0
- datalab/data/icons/roi/roi_copy.svg +112 -0
- datalab/data/icons/roi/roi_delete.svg +81 -0
- datalab/data/icons/roi/roi_export.svg +87 -0
- datalab/data/icons/roi/roi_graphical.svg +78 -0
- datalab/data/icons/roi/roi_grid.svg +67 -0
- datalab/data/icons/roi/roi_ima.svg +188 -0
- datalab/data/icons/roi/roi_import.svg +87 -0
- datalab/data/icons/roi/roi_new.svg +81 -0
- datalab/data/icons/roi/roi_new_circle.svg +95 -0
- datalab/data/icons/roi/roi_new_polygon.svg +110 -0
- datalab/data/icons/roi/roi_new_rectangle.svg +70 -0
- datalab/data/icons/roi/roi_paste.svg +98 -0
- datalab/data/icons/roi/roi_sig.svg +124 -0
- datalab/data/icons/shapes.svg +134 -0
- datalab/data/icons/signal.svg +103 -0
- datalab/data/icons/table.svg +85 -0
- datalab/data/icons/table_unavailable.svg +102 -0
- datalab/data/icons/to_signal.svg +124 -0
- datalab/data/icons/tour/next.svg +44 -0
- datalab/data/icons/tour/previous.svg +44 -0
- datalab/data/icons/tour/rewind.svg +51 -0
- datalab/data/icons/tour/stop.svg +47 -0
- datalab/data/icons/tour/tour.svg +16 -0
- datalab/data/icons/uncheck_all.svg +78 -0
- datalab/data/icons/view/curve_antialiasing.svg +50 -0
- datalab/data/icons/view/new_window.svg +98 -0
- datalab/data/icons/view/refresh-auto.svg +57 -0
- datalab/data/icons/view/refresh-manual.svg +51 -0
- datalab/data/icons/view/reset_curve_styles.svg +96 -0
- datalab/data/icons/view/show_first.svg +55 -0
- datalab/data/icons/view/show_titles.svg +46 -0
- datalab/data/icons/visualization.svg +51 -0
- datalab/data/logo/DataLab-Banner-150.png +0 -0
- datalab/data/logo/DataLab-Banner-200.png +0 -0
- datalab/data/logo/DataLab-Banner2-100.png +0 -0
- datalab/data/logo/DataLab-Splash.png +0 -0
- datalab/data/logo/DataLab-watermark.png +0 -0
- datalab/data/logo/DataLab.svg +83 -0
- datalab/data/tests/reordering_test.h5 +0 -0
- datalab/data/tutorials/fabry_perot/fabry-perot1.jpg +0 -0
- datalab/data/tutorials/fabry_perot/fabry-perot2.jpg +0 -0
- datalab/data/tutorials/laser_beam/TEM00_z_13.jpg +0 -0
- datalab/data/tutorials/laser_beam/TEM00_z_18.jpg +0 -0
- datalab/data/tutorials/laser_beam/TEM00_z_23.jpg +0 -0
- datalab/data/tutorials/laser_beam/TEM00_z_30.jpg +0 -0
- datalab/data/tutorials/laser_beam/TEM00_z_35.jpg +0 -0
- datalab/data/tutorials/laser_beam/TEM00_z_40.jpg +0 -0
- datalab/data/tutorials/laser_beam/TEM00_z_45.jpg +0 -0
- datalab/data/tutorials/laser_beam/TEM00_z_50.jpg +0 -0
- datalab/data/tutorials/laser_beam/TEM00_z_55.jpg +0 -0
- datalab/data/tutorials/laser_beam/TEM00_z_60.jpg +0 -0
- datalab/data/tutorials/laser_beam/TEM00_z_65.jpg +0 -0
- datalab/data/tutorials/laser_beam/TEM00_z_70.jpg +0 -0
- datalab/data/tutorials/laser_beam/TEM00_z_75.jpg +0 -0
- datalab/data/tutorials/laser_beam/TEM00_z_80.jpg +0 -0
- datalab/env.py +542 -0
- datalab/gui/__init__.py +89 -0
- datalab/gui/actionhandler.py +1701 -0
- datalab/gui/docks.py +473 -0
- datalab/gui/h5io.py +150 -0
- datalab/gui/macroeditor.py +310 -0
- datalab/gui/main.py +2081 -0
- datalab/gui/newobject.py +217 -0
- datalab/gui/objectview.py +766 -0
- datalab/gui/panel/__init__.py +48 -0
- datalab/gui/panel/base.py +3254 -0
- datalab/gui/panel/image.py +157 -0
- datalab/gui/panel/macro.py +607 -0
- datalab/gui/panel/signal.py +164 -0
- datalab/gui/plothandler.py +800 -0
- datalab/gui/processor/__init__.py +84 -0
- datalab/gui/processor/base.py +2456 -0
- datalab/gui/processor/catcher.py +75 -0
- datalab/gui/processor/image.py +1214 -0
- datalab/gui/processor/signal.py +755 -0
- datalab/gui/profiledialog.py +333 -0
- datalab/gui/roieditor.py +633 -0
- datalab/gui/roigrideditor.py +208 -0
- datalab/gui/settings.py +612 -0
- datalab/gui/tour.py +908 -0
- datalab/h5/__init__.py +12 -0
- datalab/h5/common.py +314 -0
- datalab/h5/generic.py +580 -0
- datalab/h5/native.py +39 -0
- datalab/h5/utils.py +95 -0
- datalab/objectmodel.py +640 -0
- datalab/plugins/_readme_.txt +9 -0
- datalab/plugins/datalab_imageformats.py +175 -0
- datalab/plugins/datalab_testdata.py +190 -0
- datalab/plugins.py +355 -0
- datalab/tests/__init__.py +199 -0
- datalab/tests/backbone/__init__.py +1 -0
- datalab/tests/backbone/config_unit_test.py +170 -0
- datalab/tests/backbone/config_versioning_unit_test.py +34 -0
- datalab/tests/backbone/dictlistserial_app_test.py +38 -0
- datalab/tests/backbone/errorcatcher_unit_test.py +69 -0
- datalab/tests/backbone/errormsgbox_unit_test.py +50 -0
- datalab/tests/backbone/execenv_unit.py +262 -0
- datalab/tests/backbone/loadtest_gdi.py +147 -0
- datalab/tests/backbone/long_callback.py +96 -0
- datalab/tests/backbone/main_app_test.py +137 -0
- datalab/tests/backbone/memory_leak.py +43 -0
- datalab/tests/backbone/procisolation1_unit.py +128 -0
- datalab/tests/backbone/procisolation2_unit.py +171 -0
- datalab/tests/backbone/procisolation_unit_test.py +22 -0
- datalab/tests/backbone/profiling_app.py +27 -0
- datalab/tests/backbone/strings_unit_test.py +65 -0
- datalab/tests/backbone/title_formatting_unit_test.py +82 -0
- datalab/tests/conftest.py +131 -0
- datalab/tests/features/__init__.py +1 -0
- datalab/tests/features/applauncher/__init__.py +1 -0
- datalab/tests/features/applauncher/launcher1_app_test.py +28 -0
- datalab/tests/features/applauncher/launcher2_app_test.py +30 -0
- datalab/tests/features/common/__init__.py +1 -0
- datalab/tests/features/common/add_metadata_app_test.py +134 -0
- datalab/tests/features/common/add_metadata_unit_test.py +267 -0
- datalab/tests/features/common/annotations_management_unit_test.py +152 -0
- datalab/tests/features/common/auto_analysis_recompute_unit_test.py +240 -0
- datalab/tests/features/common/createobject_unit_test.py +50 -0
- datalab/tests/features/common/geometry_results_app_test.py +135 -0
- datalab/tests/features/common/interactive_processing_test.py +1109 -0
- datalab/tests/features/common/io_app_test.py +75 -0
- datalab/tests/features/common/large_results_app_test.py +187 -0
- datalab/tests/features/common/metadata_all_patterns_test.py +103 -0
- datalab/tests/features/common/metadata_app_test.py +139 -0
- datalab/tests/features/common/metadata_io_unit_test.py +60 -0
- datalab/tests/features/common/misc_app_test.py +236 -0
- datalab/tests/features/common/multiple_geometry_results_unit_test.py +122 -0
- datalab/tests/features/common/multiple_table_results_unit_test.py +64 -0
- datalab/tests/features/common/operation_modes_app_test.py +392 -0
- datalab/tests/features/common/plot_results_app_test.py +278 -0
- datalab/tests/features/common/reorder_app_test.py +75 -0
- datalab/tests/features/common/result_deletion_unit_test.py +96 -0
- datalab/tests/features/common/result_merged_label_unit_test.py +154 -0
- datalab/tests/features/common/result_shape_settings_unit_test.py +223 -0
- datalab/tests/features/common/roi_plotitem_unit_test.py +64 -0
- datalab/tests/features/common/roieditor_unit_test.py +102 -0
- datalab/tests/features/common/save_to_dir_app_test.py +163 -0
- datalab/tests/features/common/save_to_dir_unit_test.py +474 -0
- datalab/tests/features/common/stat_app_test.py +40 -0
- datalab/tests/features/common/stats_tools_unit_test.py +77 -0
- datalab/tests/features/common/table_results_app_test.py +52 -0
- datalab/tests/features/common/textimport_unit_test.py +131 -0
- datalab/tests/features/common/uuid_preservation_test.py +281 -0
- datalab/tests/features/common/worker_unit_test.py +402 -0
- datalab/tests/features/control/__init__.py +1 -0
- datalab/tests/features/control/connect_dialog.py +28 -0
- datalab/tests/features/control/embedded1_unit_test.py +304 -0
- datalab/tests/features/control/embedded2_unit_test.py +52 -0
- datalab/tests/features/control/remoteclient_app_test.py +219 -0
- datalab/tests/features/control/remoteclient_unit.py +75 -0
- datalab/tests/features/control/simpleclient_unit_test.py +321 -0
- datalab/tests/features/hdf5/__init__.py +1 -0
- datalab/tests/features/hdf5/h5browser1_unit_test.py +31 -0
- datalab/tests/features/hdf5/h5browser2_unit.py +55 -0
- datalab/tests/features/hdf5/h5browser_app_test.py +77 -0
- datalab/tests/features/hdf5/h5import_app_test.py +25 -0
- datalab/tests/features/hdf5/h5importer_app_test.py +34 -0
- datalab/tests/features/image/__init__.py +1 -0
- datalab/tests/features/image/annotations_app_test.py +28 -0
- datalab/tests/features/image/annotations_unit_test.py +80 -0
- datalab/tests/features/image/average_app_test.py +46 -0
- datalab/tests/features/image/background_dialog_test.py +70 -0
- datalab/tests/features/image/blobs_app_test.py +50 -0
- datalab/tests/features/image/contour_app_test.py +42 -0
- datalab/tests/features/image/contour_fabryperot_app_test.py +51 -0
- datalab/tests/features/image/denoise_app_test.py +31 -0
- datalab/tests/features/image/distribute_on_grid_app_test.py +95 -0
- datalab/tests/features/image/edges_app_test.py +31 -0
- datalab/tests/features/image/erase_app_test.py +21 -0
- datalab/tests/features/image/fft2d_app_test.py +27 -0
- datalab/tests/features/image/flatfield_app_test.py +40 -0
- datalab/tests/features/image/geometry_transform_unit_test.py +396 -0
- datalab/tests/features/image/imagetools_app_test.py +51 -0
- datalab/tests/features/image/imagetools_unit_test.py +27 -0
- datalab/tests/features/image/load_app_test.py +73 -0
- datalab/tests/features/image/morph_app_test.py +32 -0
- datalab/tests/features/image/offsetcorrection_app_test.py +30 -0
- datalab/tests/features/image/peak2d_app_test.py +53 -0
- datalab/tests/features/image/profile_app_test.py +73 -0
- datalab/tests/features/image/profile_dialog_test.py +56 -0
- datalab/tests/features/image/roi_app_test.py +98 -0
- datalab/tests/features/image/roi_circ_app_test.py +62 -0
- datalab/tests/features/image/roi_manipulation_app_test.py +268 -0
- datalab/tests/features/image/roigrid_unit_test.py +60 -0
- datalab/tests/features/image/side_by_side_app_test.py +52 -0
- datalab/tests/features/macro/__init__.py +1 -0
- datalab/tests/features/macro/macro_app_test.py +28 -0
- datalab/tests/features/macro/macroeditor_unit_test.py +102 -0
- datalab/tests/features/signal/__init__.py +1 -0
- datalab/tests/features/signal/baseline_dialog_test.py +53 -0
- datalab/tests/features/signal/deltax_dialog_unit_test.py +34 -0
- datalab/tests/features/signal/fft1d_app_test.py +26 -0
- datalab/tests/features/signal/filter_app_test.py +44 -0
- datalab/tests/features/signal/fitdialog_unit_test.py +50 -0
- datalab/tests/features/signal/interpolation_app_test.py +110 -0
- datalab/tests/features/signal/loadbigsignal_app_test.py +80 -0
- datalab/tests/features/signal/multiple_rois_unit_test.py +132 -0
- datalab/tests/features/signal/pulse_features_app_test.py +118 -0
- datalab/tests/features/signal/pulse_features_roi_app_test.py +55 -0
- datalab/tests/features/signal/roi_app_test.py +78 -0
- datalab/tests/features/signal/roi_manipulation_app_test.py +261 -0
- datalab/tests/features/signal/select_xy_cursor_unit_test.py +46 -0
- datalab/tests/features/signal/signalpeakdetection_dialog_test.py +33 -0
- datalab/tests/features/signal/signals_to_image_app_test.py +98 -0
- datalab/tests/features/signal/xarray_compat_app_test.py +128 -0
- datalab/tests/features/tour_unit_test.py +22 -0
- datalab/tests/features/utilities/__init__.py +1 -0
- datalab/tests/features/utilities/installconf_unit_test.py +21 -0
- datalab/tests/features/utilities/logview_app_test.py +21 -0
- datalab/tests/features/utilities/logview_error.py +24 -0
- datalab/tests/features/utilities/logview_unit_test.py +21 -0
- datalab/tests/features/utilities/memstatus_app_test.py +42 -0
- datalab/tests/features/utilities/settings_unit_test.py +88 -0
- datalab/tests/scenarios/__init__.py +1 -0
- datalab/tests/scenarios/beautiful_app.py +121 -0
- datalab/tests/scenarios/common.py +463 -0
- datalab/tests/scenarios/demo.py +212 -0
- datalab/tests/scenarios/example_app_test.py +47 -0
- datalab/tests/scenarios/scenario_h5_app_test.py +75 -0
- datalab/tests/scenarios/scenario_ima1_app_test.py +34 -0
- datalab/tests/scenarios/scenario_ima2_app_test.py +34 -0
- datalab/tests/scenarios/scenario_mac_app_test.py +58 -0
- datalab/tests/scenarios/scenario_sig1_app_test.py +36 -0
- datalab/tests/scenarios/scenario_sig2_app_test.py +35 -0
- datalab/utils/__init__.py +1 -0
- datalab/utils/conf.py +304 -0
- datalab/utils/dephash.py +105 -0
- datalab/utils/qthelpers.py +633 -0
- datalab/utils/strings.py +34 -0
- datalab/utils/tests.py +0 -0
- datalab/widgets/__init__.py +1 -0
- datalab/widgets/connection.py +138 -0
- datalab/widgets/filedialog.py +91 -0
- datalab/widgets/fileviewer.py +84 -0
- datalab/widgets/fitdialog.py +788 -0
- datalab/widgets/h5browser.py +1048 -0
- datalab/widgets/imagebackground.py +111 -0
- datalab/widgets/instconfviewer.py +175 -0
- datalab/widgets/logviewer.py +80 -0
- datalab/widgets/signalbaseline.py +90 -0
- datalab/widgets/signalcursor.py +208 -0
- datalab/widgets/signaldeltax.py +151 -0
- datalab/widgets/signalpeak.py +199 -0
- datalab/widgets/status.py +249 -0
- datalab/widgets/textimport.py +786 -0
- datalab/widgets/warningerror.py +223 -0
- datalab/widgets/wizard.py +286 -0
- datalab_platform-1.0.0.dist-info/METADATA +121 -0
- datalab_platform-1.0.0.dist-info/RECORD +494 -0
- datalab_platform-0.0.1.dev0.dist-info/METADATA +0 -67
- datalab_platform-0.0.1.dev0.dist-info/RECORD +0 -7
- {datalab_platform-0.0.1.dev0.dist-info → datalab_platform-1.0.0.dist-info}/WHEEL +0 -0
- {datalab_platform-0.0.1.dev0.dist-info → datalab_platform-1.0.0.dist-info}/entry_points.txt +0 -0
- {datalab_platform-0.0.1.dev0.dist-info → datalab_platform-1.0.0.dist-info}/licenses/LICENSE +0 -0
- {datalab_platform-0.0.1.dev0.dist-info → datalab_platform-1.0.0.dist-info}/top_level.txt +0 -0
datalab/gui/settings.py
ADDED
|
@@ -0,0 +1,612 @@
|
|
|
1
|
+
# Copyright (c) DataLab Platform Developers, BSD 3-Clause license, see LICENSE file.
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Settings
|
|
5
|
+
========
|
|
6
|
+
|
|
7
|
+
The :mod:`datalab.gui.settings` module provides the DataLab settings dialog
|
|
8
|
+
and related classes.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
# pylint: disable=invalid-name # Allows short reference names like x, y, ...
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
from typing import Any, Generator
|
|
16
|
+
|
|
17
|
+
import guidata.dataset as gds
|
|
18
|
+
from guidata.dataset import restore_dataset, update_dataset
|
|
19
|
+
from plotpy.styles import BaseImageParam
|
|
20
|
+
from qtpy import QtWidgets as QW
|
|
21
|
+
|
|
22
|
+
from datalab.config import Conf, _
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class MainSettings(gds.DataSet):
|
|
26
|
+
"""DataLab main settings"""
|
|
27
|
+
|
|
28
|
+
g0 = gds.BeginGroup(_("Settings for main window and general features"))
|
|
29
|
+
color_mode = gds.ChoiceItem(
|
|
30
|
+
_("Color mode"),
|
|
31
|
+
zip(Conf.main.color_mode.values, Conf.main.color_mode.values),
|
|
32
|
+
help=_("Color mode for the application"),
|
|
33
|
+
)
|
|
34
|
+
process_isolation_enabled = gds.BoolItem(
|
|
35
|
+
"",
|
|
36
|
+
_("Process isolation"),
|
|
37
|
+
help=_(
|
|
38
|
+
"With process isolation, each computation is run in a separate process,"
|
|
39
|
+
"<br>which prevents the application from freezing during long computations."
|
|
40
|
+
),
|
|
41
|
+
)
|
|
42
|
+
rpc_server_enabled = gds.BoolItem(
|
|
43
|
+
"",
|
|
44
|
+
_("RPC server"),
|
|
45
|
+
help=_(
|
|
46
|
+
"RPC server is used to communicate with external applications,"
|
|
47
|
+
"<br>like your own scripts (e.g. from Spyder or Jupyter) or other software."
|
|
48
|
+
),
|
|
49
|
+
)
|
|
50
|
+
available_memory_threshold = gds.IntItem(
|
|
51
|
+
_("Memory threshold"),
|
|
52
|
+
default=0,
|
|
53
|
+
unit=_("MB"),
|
|
54
|
+
help=_(
|
|
55
|
+
"Memory threshold below which a warning is displayed "
|
|
56
|
+
"before loading any new data"
|
|
57
|
+
),
|
|
58
|
+
)
|
|
59
|
+
plugins_enabled = gds.BoolItem(
|
|
60
|
+
"",
|
|
61
|
+
_("Third-party plugins"),
|
|
62
|
+
help=_("Disable third-party plugins at startup"),
|
|
63
|
+
)
|
|
64
|
+
plugins_path = gds.DirectoryItem(
|
|
65
|
+
_("Plugins path"),
|
|
66
|
+
allow_none=True,
|
|
67
|
+
help=_(
|
|
68
|
+
"Path to third-party plugins.<br><br>"
|
|
69
|
+
"DataLab will discover plugins in this path, "
|
|
70
|
+
"as well as in your PYTHONPATH."
|
|
71
|
+
),
|
|
72
|
+
)
|
|
73
|
+
v020_plugins_warning_ignore = gds.BoolItem(
|
|
74
|
+
_("Ignore compatibility issues warning"),
|
|
75
|
+
_("DataLab v0.20 plugins"),
|
|
76
|
+
help=_(
|
|
77
|
+
"If enabled, DataLab will not warn you about v0.20 plugins that are "
|
|
78
|
+
"no longer compatible with v1.0."
|
|
79
|
+
),
|
|
80
|
+
)
|
|
81
|
+
_g0 = gds.EndGroup("")
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
class ConsoleSettings(gds.DataSet):
|
|
85
|
+
"""DataLab console settings"""
|
|
86
|
+
|
|
87
|
+
g0 = gds.BeginGroup(
|
|
88
|
+
_("Settings for internal console, used for debugging or advanced users")
|
|
89
|
+
)
|
|
90
|
+
console_enabled = gds.BoolItem("", _("Console enabled"))
|
|
91
|
+
show_console_on_error = gds.BoolItem(
|
|
92
|
+
"",
|
|
93
|
+
_("Show console on error"),
|
|
94
|
+
help=_(
|
|
95
|
+
"If enabled, the console will be shown when an error occurs in the "
|
|
96
|
+
"application. This is useful for debugging purposes as it allows to "
|
|
97
|
+
"see the error traceback."
|
|
98
|
+
),
|
|
99
|
+
)
|
|
100
|
+
external_editor_path = gds.StringItem(_("External editor path"), "")
|
|
101
|
+
external_editor_args = gds.StringItem(_("External editor arguments"), "")
|
|
102
|
+
_g0 = gds.EndGroup("")
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
class IOSettings(gds.DataSet):
|
|
106
|
+
"""DataLab I/O settings"""
|
|
107
|
+
|
|
108
|
+
g0 = gds.BeginGroup(_("Settings for I/O operations"))
|
|
109
|
+
h5_clear_workspace = gds.BoolItem(
|
|
110
|
+
"",
|
|
111
|
+
_("Clear workspace before loading HDF5 file"),
|
|
112
|
+
help=_(
|
|
113
|
+
"If enabled, the current workspace will be cleared before loading a "
|
|
114
|
+
"new HDF5 file.\n"
|
|
115
|
+
"If disabled, when importing DataLab workspace files, only objects with "
|
|
116
|
+
"conflicting identifiers will have their processing history lost "
|
|
117
|
+
"(features like 'Show source' and 'Recompute' will not work for those "
|
|
118
|
+
"objects). Non-conflicting objects will preserve their processing history."
|
|
119
|
+
),
|
|
120
|
+
)
|
|
121
|
+
h5_clear_workspace_ask = gds.BoolItem("", _("Ask before clearing workspace"))
|
|
122
|
+
h5_fullpath_in_title = gds.BoolItem(
|
|
123
|
+
"",
|
|
124
|
+
_("HDF5 full path in title"),
|
|
125
|
+
help=_(
|
|
126
|
+
"If enabled, the full path of the HDF5 data set will be used as the title "
|
|
127
|
+
"for the signal/image object.<br>"
|
|
128
|
+
"If disabled, only the name of the data set will be used as the title."
|
|
129
|
+
),
|
|
130
|
+
)
|
|
131
|
+
h5_fname_in_title = gds.BoolItem(
|
|
132
|
+
"",
|
|
133
|
+
_("HDF5 file name in title"),
|
|
134
|
+
help=_(
|
|
135
|
+
"If enabled, the name of the HDF5 file will be used as a suffix in the "
|
|
136
|
+
"title of the signal/image object."
|
|
137
|
+
),
|
|
138
|
+
)
|
|
139
|
+
_g0 = gds.EndGroup("")
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
class ProcSettings(gds.DataSet):
|
|
143
|
+
"""DataLab processing settings"""
|
|
144
|
+
|
|
145
|
+
g0 = gds.BeginGroup(_("Settings for computations"))
|
|
146
|
+
operation_mode = gds.ChoiceItem(
|
|
147
|
+
_("Operation mode"),
|
|
148
|
+
zip(Conf.proc.operation_mode.values, Conf.proc.operation_mode.values),
|
|
149
|
+
help=_(
|
|
150
|
+
"Operation mode for computations taking <i>N</i> inputs:"
|
|
151
|
+
"<ul><li><b>single</b>: single operand mode</li>"
|
|
152
|
+
"<li><b>pairwise</b>: pairwise operation mode</li></ul>"
|
|
153
|
+
"<br>Computations taking <i>N</i> inputs are the ones where:"
|
|
154
|
+
"<ul><li>N(>=2) objects in %s 1 object out</li>"
|
|
155
|
+
"<li>N(>=1) objects + 1 object in %s N objects out</li></ul>"
|
|
156
|
+
)
|
|
157
|
+
% ("→", "→"),
|
|
158
|
+
)
|
|
159
|
+
use_signal_bounds = gds.BoolItem(
|
|
160
|
+
_("Use current signal bounds"),
|
|
161
|
+
_("New signals"),
|
|
162
|
+
help=_(
|
|
163
|
+
"If enabled, when creating a new signal, the xmin and xmax values will be "
|
|
164
|
+
"initialized from the current signal's bounds.<br>"
|
|
165
|
+
"If disabled, the default values from the New Signal dialog will be used."
|
|
166
|
+
),
|
|
167
|
+
)
|
|
168
|
+
use_image_dims = gds.BoolItem(
|
|
169
|
+
_("Use current image dimensions"),
|
|
170
|
+
_("New images"),
|
|
171
|
+
help=_(
|
|
172
|
+
"If enabled, when creating a new image, the width and height values will "
|
|
173
|
+
"be initialized from the current image's dimensions.<br>"
|
|
174
|
+
"If disabled, the default values from the New Image dialog will be used."
|
|
175
|
+
),
|
|
176
|
+
)
|
|
177
|
+
fft_shift_enabled = gds.BoolItem(
|
|
178
|
+
"",
|
|
179
|
+
_("FFT shift"),
|
|
180
|
+
help=_(
|
|
181
|
+
"Enable FFT shift to center the zero-frequency component in the frequency "
|
|
182
|
+
"spectrum for easier visualization and analysis."
|
|
183
|
+
),
|
|
184
|
+
)
|
|
185
|
+
auto_normalize_kernel = gds.BoolItem(
|
|
186
|
+
_("Auto-normalize convolution/deconvolution kernel"),
|
|
187
|
+
_("Convolution"),
|
|
188
|
+
help=_(
|
|
189
|
+
"If enabled, convolution and deconvolution kernels will be automatically "
|
|
190
|
+
"normalized for signal and image processing operations to preserve signal "
|
|
191
|
+
"energy and image intensity."
|
|
192
|
+
),
|
|
193
|
+
)
|
|
194
|
+
extract_roi_singleobj = gds.BoolItem(
|
|
195
|
+
_("Extract multiple ROIs in a single object"),
|
|
196
|
+
_("ROI extraction"),
|
|
197
|
+
help=_(
|
|
198
|
+
"If enabled, multiple ROIs will be extracted into a single object.<br>"
|
|
199
|
+
"If disabled, each ROI will be extracted into a separate object."
|
|
200
|
+
),
|
|
201
|
+
)
|
|
202
|
+
ignore_warnings = gds.BoolItem(
|
|
203
|
+
_("Ignore warnings during computations"),
|
|
204
|
+
_("Warnings"),
|
|
205
|
+
help=_("If enabled, warnings during computations will be ignored."),
|
|
206
|
+
)
|
|
207
|
+
xarray_compat_behavior = gds.ChoiceItem(
|
|
208
|
+
_("X-axis"),
|
|
209
|
+
zip(
|
|
210
|
+
Conf.proc.xarray_compat_behavior.values,
|
|
211
|
+
[_("Ask before interpolation"), _("Interpolate systematically")],
|
|
212
|
+
),
|
|
213
|
+
help=_(
|
|
214
|
+
"Behavior when X-axis arrays are incompatible in multi-signal computations:"
|
|
215
|
+
"<ul><li><b>Ask</b>: display confirmation dialog (default)</li>"
|
|
216
|
+
"<li><b>Interpolate</b>: automatically interpolate signals</li></ul>"
|
|
217
|
+
),
|
|
218
|
+
)
|
|
219
|
+
_g0 = gds.EndGroup("")
|
|
220
|
+
g1 = gds.BeginGroup(_("Settings for results management"))
|
|
221
|
+
keep_results = gds.BoolItem(
|
|
222
|
+
_("Keep results in metadata after computation"),
|
|
223
|
+
_("Keep results"),
|
|
224
|
+
help=_(
|
|
225
|
+
"If enabled, the results of a previous analysis will be kept in object's "
|
|
226
|
+
"metadata after the computation.<br>"
|
|
227
|
+
"If disabled, the results will be removed from the object's metadata."
|
|
228
|
+
"<br><br>"
|
|
229
|
+
"This option is disabled by default because keeping analysis results may "
|
|
230
|
+
"be confusing as those results could be outdated following the "
|
|
231
|
+
"computation."
|
|
232
|
+
),
|
|
233
|
+
)
|
|
234
|
+
show_result_dialog = gds.BoolItem(
|
|
235
|
+
_("Show results dialog automatically after processing"),
|
|
236
|
+
_("Show results"),
|
|
237
|
+
help=_(
|
|
238
|
+
"If enabled, the results dialog will be shown automatically after each "
|
|
239
|
+
"processing operation producing results.<br>"
|
|
240
|
+
"If disabled, the results dialog will not be shown automatically."
|
|
241
|
+
),
|
|
242
|
+
)
|
|
243
|
+
_g1 = gds.EndGroup("")
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
class ImageDefaultSettings(BaseImageParam):
|
|
247
|
+
"""Image visualization default settings"""
|
|
248
|
+
|
|
249
|
+
_multiselection = True # Hide label (not clean because it's not the intended use)
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
# pylint:disable=unused-argument
|
|
253
|
+
def edit_default_image_settings(
|
|
254
|
+
dataset: gds.DataSet, item: gds.DataItem, value: Any, parent: QW.QWidget
|
|
255
|
+
) -> bool:
|
|
256
|
+
"""Edit default image settings
|
|
257
|
+
|
|
258
|
+
Args:
|
|
259
|
+
dataset: dataset
|
|
260
|
+
item: Data item
|
|
261
|
+
value: Value
|
|
262
|
+
parent: Parent widget
|
|
263
|
+
|
|
264
|
+
Returns:
|
|
265
|
+
True if the settings were edited
|
|
266
|
+
"""
|
|
267
|
+
param = ImageDefaultSettings(_("Default image visualization settings"))
|
|
268
|
+
ima_def_dict = Conf.view.get_def_dict("ima")
|
|
269
|
+
update_dataset(param, ima_def_dict)
|
|
270
|
+
if param.edit(parent=parent):
|
|
271
|
+
restore_dataset(param, ima_def_dict)
|
|
272
|
+
Conf.view.set_def_dict("ima", ima_def_dict)
|
|
273
|
+
return True
|
|
274
|
+
return False
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
# pylint:disable=unused-argument
|
|
278
|
+
def edit_dataset_settings(
|
|
279
|
+
dataset: gds.DataSet, item: gds.DataItem, param: gds.DataSet, parent: QW.QWidget
|
|
280
|
+
) -> gds.DataSet:
|
|
281
|
+
"""Edit dataset-like settings
|
|
282
|
+
|
|
283
|
+
Args:
|
|
284
|
+
dataset: dataset
|
|
285
|
+
item: Data item
|
|
286
|
+
param: The DataSet instance from config, or None if not set
|
|
287
|
+
parent: Parent widget
|
|
288
|
+
|
|
289
|
+
Returns:
|
|
290
|
+
The modified dataset, or None if cancelled
|
|
291
|
+
"""
|
|
292
|
+
assert param is not None, "Should not be None"
|
|
293
|
+
param.set_title(_("Visualization settings"))
|
|
294
|
+
param.edit(parent=parent)
|
|
295
|
+
return param
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
class ViewSettings(gds.DataSet):
|
|
299
|
+
"""DataLab Visualization settings"""
|
|
300
|
+
|
|
301
|
+
_view_tabs = gds.BeginTabGroup("")
|
|
302
|
+
|
|
303
|
+
g0 = gds.BeginGroup(_("Common"))
|
|
304
|
+
plot_toolbar_position = gds.ImageChoiceItem(
|
|
305
|
+
_("Plot toolbar position"),
|
|
306
|
+
(
|
|
307
|
+
("top", _("Top (above plot)"), "libre-gui-arrow-up.svg"),
|
|
308
|
+
("bottom", _("Bottom (below plot)"), "libre-gui-arrow-down.svg"),
|
|
309
|
+
("left", _("Left (of plot)"), "libre-gui-arrow-left.svg"),
|
|
310
|
+
("right", _("Right (of plot)"), "libre-gui-arrow-right.svg"),
|
|
311
|
+
),
|
|
312
|
+
)
|
|
313
|
+
ignore_title_insertion_msg = gds.BoolItem(
|
|
314
|
+
"",
|
|
315
|
+
_("Ignore title insertion message"),
|
|
316
|
+
help=_(
|
|
317
|
+
"Ignore information message when inserting object title as annotation label"
|
|
318
|
+
),
|
|
319
|
+
default=False,
|
|
320
|
+
)
|
|
321
|
+
_g0 = gds.EndGroup("")
|
|
322
|
+
|
|
323
|
+
g1 = gds.BeginGroup(_("Signals")).set_prop("display", icon="signal.svg")
|
|
324
|
+
_prop_ads = gds.ValueProp(False)
|
|
325
|
+
sig_linewidth = gds.FloatItem(
|
|
326
|
+
_("Default line width"),
|
|
327
|
+
default=1.0,
|
|
328
|
+
min=0.1,
|
|
329
|
+
help=_("Default line width for curves representing signals"),
|
|
330
|
+
)
|
|
331
|
+
sig_linewidth_perfs_threshold = gds.IntItem(
|
|
332
|
+
_("Performance threshold"),
|
|
333
|
+
default=1000,
|
|
334
|
+
min=100,
|
|
335
|
+
help=_(
|
|
336
|
+
"Number of points threshold for line width limitation.\n"
|
|
337
|
+
"For signals with more than this number of points, "
|
|
338
|
+
"line width is automatically limited to 1.0 for performance reasons.\n\n"
|
|
339
|
+
"That's because the Qt raster engine experiences significant rendering "
|
|
340
|
+
"slowdowns with thick lines on large datasets."
|
|
341
|
+
),
|
|
342
|
+
)
|
|
343
|
+
sig_autodownsampling = gds.BoolItem(
|
|
344
|
+
"",
|
|
345
|
+
_("Use auto downsampling"),
|
|
346
|
+
help=_("Use auto downsampling for large signals"),
|
|
347
|
+
).set_prop("display", store=_prop_ads)
|
|
348
|
+
sig_autodownsampling_maxpoints = gds.IntItem(
|
|
349
|
+
_("Downsampling max points"),
|
|
350
|
+
default=10000,
|
|
351
|
+
min=1000,
|
|
352
|
+
help=_("Maximum number of points for downsampling"),
|
|
353
|
+
).set_prop("display", active=_prop_ads)
|
|
354
|
+
sig_autoscale_margin_percent = gds.FloatItem(
|
|
355
|
+
_("Autoscale margin"),
|
|
356
|
+
unit=_("%"),
|
|
357
|
+
default=0.2,
|
|
358
|
+
min=0.0,
|
|
359
|
+
max=50.0,
|
|
360
|
+
help=_(
|
|
361
|
+
"Percentage of margin to add around data when auto-scaling signal "
|
|
362
|
+
"plots.<br>A value of 0.2% adds a small margin for better "
|
|
363
|
+
"visualization.<br>Set to 0% for no margin (exact data bounds)."
|
|
364
|
+
),
|
|
365
|
+
)
|
|
366
|
+
sig_datetime_format_s = gds.StringItem(
|
|
367
|
+
_("DateTime format (s/min/h)"),
|
|
368
|
+
default="%H:%M:%S",
|
|
369
|
+
help=_(
|
|
370
|
+
"Format string for datetime X-axis labels when using standard time "
|
|
371
|
+
"units (s, min, h).<br>Uses Python's strftime format codes "
|
|
372
|
+
"(e.g., %H:%M:%S for hours:minutes:seconds)."
|
|
373
|
+
),
|
|
374
|
+
)
|
|
375
|
+
sig_datetime_format_ms = gds.StringItem(
|
|
376
|
+
_("DateTime format (ms/μs/ns)"),
|
|
377
|
+
default="%H:%M:%S.%f",
|
|
378
|
+
help=_(
|
|
379
|
+
"Format string for datetime X-axis labels when using sub-second time "
|
|
380
|
+
"units (ms, μs, ns).<br>Uses Python's strftime format codes "
|
|
381
|
+
"(e.g., %H:%M:%S.%f for hours:minutes:seconds.microseconds)."
|
|
382
|
+
),
|
|
383
|
+
)
|
|
384
|
+
sig_shape_param = gds.ButtonItem(
|
|
385
|
+
_("Results: edit shape styles"), edit_dataset_settings, icon="shapes.svg"
|
|
386
|
+
)
|
|
387
|
+
sig_marker_param = gds.ButtonItem(
|
|
388
|
+
_("Results: edit marker styles"), edit_dataset_settings, icon="markers.svg"
|
|
389
|
+
)
|
|
390
|
+
_g1 = gds.EndGroup("")
|
|
391
|
+
|
|
392
|
+
g2 = gds.BeginGroup(_("Images")).set_prop("display", icon="image.svg")
|
|
393
|
+
ima_aspect_ratio_1_1 = gds.BoolItem(
|
|
394
|
+
"",
|
|
395
|
+
_("Lock aspect ratio to 1:1"),
|
|
396
|
+
help=_(
|
|
397
|
+
"If enabled, the aspect ratio of the image will be locked to 1:1.<br>"
|
|
398
|
+
"If disabled, the aspect ratio will be determined by the physical pixel "
|
|
399
|
+
"size (this is the default and recommended setting)."
|
|
400
|
+
),
|
|
401
|
+
)
|
|
402
|
+
ima_eliminate_outliers = gds.FloatItem(
|
|
403
|
+
_("Eliminate outliers"),
|
|
404
|
+
unit=_("%"),
|
|
405
|
+
default=2.0,
|
|
406
|
+
min=0.0,
|
|
407
|
+
max=100.0,
|
|
408
|
+
help=_(
|
|
409
|
+
"Eliminate a percentage of the highest and lowest values<br>"
|
|
410
|
+
"of the image histogram - <i>recommanded values are below 1%</i>"
|
|
411
|
+
),
|
|
412
|
+
)
|
|
413
|
+
ima_autoscale_margin_percent = gds.FloatItem(
|
|
414
|
+
_("Autoscale margin"),
|
|
415
|
+
unit=_("%"),
|
|
416
|
+
default=0.2,
|
|
417
|
+
min=0.0,
|
|
418
|
+
max=50.0,
|
|
419
|
+
help=_(
|
|
420
|
+
"Percentage of margin to add around data when auto-scaling image "
|
|
421
|
+
"plots.<br>A value of 0.2% adds a small margin for better "
|
|
422
|
+
"visualization.<br>Set to 0% for no margin (exact data bounds)."
|
|
423
|
+
),
|
|
424
|
+
)
|
|
425
|
+
ima_defaults = gds.ButtonItem(
|
|
426
|
+
_("Default image visualization settings"),
|
|
427
|
+
edit_default_image_settings,
|
|
428
|
+
icon="image.svg",
|
|
429
|
+
default=False,
|
|
430
|
+
)
|
|
431
|
+
ima_shape_param = gds.ButtonItem(
|
|
432
|
+
_("Results: edit shape styles"), edit_dataset_settings, icon="shapes.svg"
|
|
433
|
+
)
|
|
434
|
+
ima_marker_param = gds.ButtonItem(
|
|
435
|
+
_("Results: edit marker styles"), edit_dataset_settings, icon="markers.svg"
|
|
436
|
+
)
|
|
437
|
+
_g2 = gds.EndGroup("")
|
|
438
|
+
|
|
439
|
+
g3 = gds.BeginGroup(_("Results")).set_prop("display", icon="show_results.svg")
|
|
440
|
+
max_shapes_to_draw = gds.IntItem(
|
|
441
|
+
_("Maximum shapes to draw"),
|
|
442
|
+
default=1000,
|
|
443
|
+
min=1,
|
|
444
|
+
help=_("Maximum number of geometry shapes to draw on plot."),
|
|
445
|
+
)
|
|
446
|
+
max_cells_in_label = gds.IntItem(
|
|
447
|
+
_("Maximum cells in label"),
|
|
448
|
+
default=100,
|
|
449
|
+
min=1,
|
|
450
|
+
help=_(
|
|
451
|
+
"Maximum number of table cells (rows × columns) to display "
|
|
452
|
+
"in merged result label on plot."
|
|
453
|
+
),
|
|
454
|
+
)
|
|
455
|
+
max_cols_in_label = gds.IntItem(
|
|
456
|
+
_("Maximum columns in label"),
|
|
457
|
+
default=15,
|
|
458
|
+
min=1,
|
|
459
|
+
help=_("Maximum number of columns to display in merged result label."),
|
|
460
|
+
)
|
|
461
|
+
show_result_label = gds.BoolItem(
|
|
462
|
+
_("Show the merged result label by default"),
|
|
463
|
+
_("Result label"),
|
|
464
|
+
default=True,
|
|
465
|
+
help=_(
|
|
466
|
+
"Show the merged result label on the plot by default. "
|
|
467
|
+
"Can be toggled per-object using the checkbox in the Properties panel."
|
|
468
|
+
),
|
|
469
|
+
)
|
|
470
|
+
_g3 = gds.EndGroup("")
|
|
471
|
+
|
|
472
|
+
_end_view_tabs = gds.EndTabGroup("")
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
# Generator yielding (param, section, option) tuples from configuration dictionary
|
|
476
|
+
def _iter_conf(
|
|
477
|
+
paramdict: dict[str, gds.DataSet],
|
|
478
|
+
) -> Generator[tuple[gds.DataSet, str, str], None, None]:
|
|
479
|
+
"""Iterate over configuration parameters"""
|
|
480
|
+
confdict = Conf.to_dict()
|
|
481
|
+
for section_name, section in confdict.items():
|
|
482
|
+
if section_name in paramdict:
|
|
483
|
+
for option in section:
|
|
484
|
+
param = paramdict[section_name]
|
|
485
|
+
if hasattr(param, option):
|
|
486
|
+
yield param, section_name, option
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
def conf_to_datasets(paramdict: dict[str, gds.DataSet]) -> None:
|
|
490
|
+
"""Convert DataLab configuration to datasets"""
|
|
491
|
+
for param, section, option in _iter_conf(paramdict):
|
|
492
|
+
value = getattr(getattr(Conf, section), option).get()
|
|
493
|
+
# ConfigParser automatically unescapes %% to % when reading, but to be safe
|
|
494
|
+
# we ensure datetime format strings are properly unescaped for display
|
|
495
|
+
if option in ("sig_datetime_format_s", "sig_datetime_format_ms"):
|
|
496
|
+
value = value.replace("%%", "%")
|
|
497
|
+
setattr(param, option, value)
|
|
498
|
+
|
|
499
|
+
|
|
500
|
+
def datasets_to_conf(paramdict: dict[str, gds.DataSet]) -> None:
|
|
501
|
+
"""Convert datasets to DataLab configuration"""
|
|
502
|
+
for param, section, option in _iter_conf(paramdict):
|
|
503
|
+
value = getattr(param, option)
|
|
504
|
+
# Escape % characters for datetime format strings (ConfigParser requirement)
|
|
505
|
+
if option in ("sig_datetime_format_s", "sig_datetime_format_ms"):
|
|
506
|
+
value = value.replace("%", "%%")
|
|
507
|
+
getattr(getattr(Conf, section), option).set(value)
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
RESTART_OPTIONS = (
|
|
511
|
+
("process_isolation_enabled", _("Process isolation enable status")),
|
|
512
|
+
("rpc_server_enabled", _("RPC server enable status")),
|
|
513
|
+
("console_enabled", _("Console enable status")),
|
|
514
|
+
("plugins_enabled", _("Third-party plugins support")),
|
|
515
|
+
("plugins_path", _("Third-party plugins path")),
|
|
516
|
+
)
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
def get_restart_items_values(paramdict: dict[str, gds.DataSet]) -> list:
|
|
520
|
+
"""Get restart items values"""
|
|
521
|
+
values = []
|
|
522
|
+
for option, _name in RESTART_OPTIONS:
|
|
523
|
+
for param, _section, _option in _iter_conf(paramdict):
|
|
524
|
+
if option == _option:
|
|
525
|
+
values.append(getattr(param, option))
|
|
526
|
+
return values
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
def get_all_values(paramdict: dict[str, gds.DataSet]) -> list:
|
|
530
|
+
"""Get all values"""
|
|
531
|
+
values = []
|
|
532
|
+
for param, _section, _option in _iter_conf(paramdict):
|
|
533
|
+
value = getattr(param, _option)
|
|
534
|
+
if isinstance(value, gds.DataSet):
|
|
535
|
+
# For dataset-like options, get a serializable representation
|
|
536
|
+
value = gds.dataset_to_json(value)
|
|
537
|
+
values.append(value)
|
|
538
|
+
return values
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
def get_all_options(paramdict: dict[str, gds.DataSet]) -> list:
|
|
542
|
+
"""Get all options"""
|
|
543
|
+
options = []
|
|
544
|
+
for _param, _section, _option in _iter_conf(paramdict):
|
|
545
|
+
options.append(_option)
|
|
546
|
+
return options
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
def create_dataset_dict() -> dict[str, gds.DataSet]:
|
|
550
|
+
"""Create a dictionary of datasets for each settings tab, populate it from Conf."""
|
|
551
|
+
paramdict = {
|
|
552
|
+
"main": MainSettings(_("General"), icon="libre-gui-settings.svg"),
|
|
553
|
+
"proc": ProcSettings(_("Processing"), icon="libre-tech-ram.svg"),
|
|
554
|
+
"view": ViewSettings(_("Visualization"), icon="visualization.svg"),
|
|
555
|
+
"io": IOSettings(_("I/O"), icon="io.svg"),
|
|
556
|
+
"console": ConsoleSettings(_("Console"), icon="console.svg"),
|
|
557
|
+
}
|
|
558
|
+
conf_to_datasets(paramdict)
|
|
559
|
+
return paramdict
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
def edit_settings(parent: QW.QWidget) -> list[str]:
|
|
563
|
+
"""Edit DataLab settings
|
|
564
|
+
|
|
565
|
+
Args:
|
|
566
|
+
parent: Parent widget
|
|
567
|
+
|
|
568
|
+
Returns:
|
|
569
|
+
List of changed option names
|
|
570
|
+
"""
|
|
571
|
+
paramdict = create_dataset_dict()
|
|
572
|
+
before = get_restart_items_values(paramdict)
|
|
573
|
+
all_values_before = get_all_values(paramdict)
|
|
574
|
+
|
|
575
|
+
params = gds.DataSetGroup(paramdict.values(), title=_("Settings"))
|
|
576
|
+
changed_options = []
|
|
577
|
+
if params.edit(parent=parent):
|
|
578
|
+
after = get_restart_items_values(paramdict)
|
|
579
|
+
if before != after:
|
|
580
|
+
# List the options that were changed
|
|
581
|
+
changed = [
|
|
582
|
+
item[1]
|
|
583
|
+
for item, value in zip(RESTART_OPTIONS, before)
|
|
584
|
+
if value != after[RESTART_OPTIONS.index(item)]
|
|
585
|
+
]
|
|
586
|
+
# Show a message box to inform the user that a restart is required
|
|
587
|
+
QW.QMessageBox.information(
|
|
588
|
+
parent,
|
|
589
|
+
_("Restart required"),
|
|
590
|
+
_(
|
|
591
|
+
"The following options have been changed:\n\n"
|
|
592
|
+
"- %s\n\n"
|
|
593
|
+
"A restart is required for these changes to take effect."
|
|
594
|
+
)
|
|
595
|
+
% "\n- ".join(changed),
|
|
596
|
+
)
|
|
597
|
+
datasets_to_conf(paramdict)
|
|
598
|
+
all_values_after = get_all_values(paramdict)
|
|
599
|
+
all_options = get_all_options(paramdict)
|
|
600
|
+
if all_values_before != all_values_after:
|
|
601
|
+
changed_options = [
|
|
602
|
+
option
|
|
603
|
+
for option, value in zip(all_options, all_values_before)
|
|
604
|
+
if value != all_values_after[all_options.index(option)]
|
|
605
|
+
]
|
|
606
|
+
|
|
607
|
+
# Check for image default settings changes
|
|
608
|
+
for vis_defaults in ("ima_defaults",):
|
|
609
|
+
if getattr(paramdict["view"], vis_defaults):
|
|
610
|
+
changed_options.append(vis_defaults)
|
|
611
|
+
|
|
612
|
+
return changed_options
|