pytxs 0.0.2__tar.gz → 0.2.0__tar.gz

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.
Files changed (83) hide show
  1. {pytxs-0.0.2/pytxs.egg-info → pytxs-0.2.0}/PKG-INFO +25 -10
  2. {pytxs-0.0.2 → pytxs-0.2.0}/README.rst +16 -3
  3. {pytxs-0.0.2 → pytxs-0.2.0}/pyproject.toml +12 -6
  4. {pytxs-0.0.2 → pytxs-0.2.0/pytxs.egg-info}/PKG-INFO +25 -10
  5. {pytxs-0.0.2 → pytxs-0.2.0}/pytxs.egg-info/SOURCES.txt +1 -0
  6. {pytxs-0.0.2 → pytxs-0.2.0}/pytxs.egg-info/requires.txt +4 -2
  7. {pytxs-0.0.2 → pytxs-0.2.0}/txs/_version.py +3 -3
  8. {pytxs-0.0.2 → pytxs-0.2.0}/txs/analysis/plot.py +5 -5
  9. {pytxs-0.0.2 → pytxs-0.2.0}/txs/app/MainWindow.py +52 -6
  10. {pytxs-0.0.2 → pytxs-0.2.0}/txs/app/PlotHeatmap.py +1 -1
  11. {pytxs-0.0.2 → pytxs-0.2.0}/txs/app/ProcessWorker.py +0 -1
  12. {pytxs-0.0.2 → pytxs-0.2.0}/txs/app/__main__.py +1 -1
  13. {pytxs-0.0.2 → pytxs-0.2.0}/txs/app/mainwindow.ui +48 -3
  14. {pytxs-0.0.2 → pytxs-0.2.0}/txs/app/plot.py +3 -1
  15. {pytxs-0.0.2 → pytxs-0.2.0}/txs/app/utils.py +0 -1
  16. {pytxs-0.0.2 → pytxs-0.2.0}/txs/azav.py +0 -2
  17. pytxs-0.2.0/txs/blissdata.py +259 -0
  18. {pytxs-0.0.2 → pytxs-0.2.0}/txs/datared.py +338 -108
  19. {pytxs-0.0.2 → pytxs-0.2.0}/txs/heating.py +0 -8
  20. {pytxs-0.0.2 → pytxs-0.2.0}/txs/live.py +10 -0
  21. {pytxs-0.0.2 → pytxs-0.2.0}/txs/plot.py +88 -26
  22. {pytxs-0.0.2 → pytxs-0.2.0}/txs/tests/test_azav.py +2 -1
  23. pytxs-0.2.0/txs/tests/test_datared.py +300 -0
  24. {pytxs-0.0.2 → pytxs-0.2.0}/txs/utils.py +290 -143
  25. pytxs-0.0.2/txs/tests/test_datared.py +0 -27
  26. {pytxs-0.0.2 → pytxs-0.2.0}/.flake8 +0 -0
  27. {pytxs-0.0.2 → pytxs-0.2.0}/LICENSE.rst +0 -0
  28. {pytxs-0.0.2 → pytxs-0.2.0}/MANIFEST.in +0 -0
  29. {pytxs-0.0.2 → pytxs-0.2.0}/docs/Makefile +0 -0
  30. {pytxs-0.0.2 → pytxs-0.2.0}/docs/fig/fig_plot_diffs.png +0 -0
  31. {pytxs-0.0.2 → pytxs-0.2.0}/docs/fig/fig_setup_beamline.png +0 -0
  32. {pytxs-0.0.2 → pytxs-0.2.0}/docs/fig/fig_txs_plot_abs.png +0 -0
  33. {pytxs-0.0.2 → pytxs-0.2.0}/docs/fig/fig_txs_plot_azim_regroup.png +0 -0
  34. {pytxs-0.0.2 → pytxs-0.2.0}/docs/make.bat +0 -0
  35. {pytxs-0.0.2 → pytxs-0.2.0}/docs/source/analysis.rst +0 -0
  36. {pytxs-0.0.2 → pytxs-0.2.0}/docs/source/conf.py +0 -0
  37. {pytxs-0.0.2 → pytxs-0.2.0}/docs/source/datared.rst +0 -0
  38. {pytxs-0.0.2 → pytxs-0.2.0}/docs/source/help.rst +0 -0
  39. {pytxs-0.0.2 → pytxs-0.2.0}/docs/source/import.rst +0 -0
  40. {pytxs-0.0.2 → pytxs-0.2.0}/docs/source/index.rst +0 -0
  41. {pytxs-0.0.2 → pytxs-0.2.0}/docs/source/license.rst +0 -0
  42. {pytxs-0.0.2 → pytxs-0.2.0}/docs/source/mask.rst +0 -0
  43. {pytxs-0.0.2 → pytxs-0.2.0}/docs/source/reference/analysis/index.rst +0 -0
  44. {pytxs-0.0.2 → pytxs-0.2.0}/docs/source/reference/analysis/plot.rst +0 -0
  45. {pytxs-0.0.2 → pytxs-0.2.0}/docs/source/reference/analysis/svd.rst +0 -0
  46. {pytxs-0.0.2 → pytxs-0.2.0}/docs/source/reference/analysis/utils.rst +0 -0
  47. {pytxs-0.0.2 → pytxs-0.2.0}/docs/source/reference/azav.rst +0 -0
  48. {pytxs-0.0.2 → pytxs-0.2.0}/docs/source/reference/common.rst +0 -0
  49. {pytxs-0.0.2 → pytxs-0.2.0}/docs/source/reference/corr.rst +0 -0
  50. {pytxs-0.0.2 → pytxs-0.2.0}/docs/source/reference/datared.rst +0 -0
  51. {pytxs-0.0.2 → pytxs-0.2.0}/docs/source/reference/datasets.rst +0 -0
  52. {pytxs-0.0.2 → pytxs-0.2.0}/docs/source/reference/heating.rst +0 -0
  53. {pytxs-0.0.2 → pytxs-0.2.0}/docs/source/reference/live.rst +0 -0
  54. {pytxs-0.0.2 → pytxs-0.2.0}/docs/source/reference/plot.rst +0 -0
  55. {pytxs-0.0.2 → pytxs-0.2.0}/docs/source/reference/utils.rst +0 -0
  56. {pytxs-0.0.2 → pytxs-0.2.0}/docs/source/reference.rst +0 -0
  57. {pytxs-0.0.2 → pytxs-0.2.0}/pytxs.egg-info/dependency_links.txt +0 -0
  58. {pytxs-0.0.2 → pytxs-0.2.0}/pytxs.egg-info/entry_points.txt +0 -0
  59. {pytxs-0.0.2 → pytxs-0.2.0}/pytxs.egg-info/top_level.txt +0 -0
  60. {pytxs-0.0.2 → pytxs-0.2.0}/requirements-dev.txt +0 -0
  61. {pytxs-0.0.2 → pytxs-0.2.0}/setup.cfg +0 -0
  62. {pytxs-0.0.2 → pytxs-0.2.0}/setup.py +0 -0
  63. {pytxs-0.0.2 → pytxs-0.2.0}/txs/__init__.py +0 -0
  64. {pytxs-0.0.2 → pytxs-0.2.0}/txs/analysis/__init__.py +0 -0
  65. {pytxs-0.0.2 → pytxs-0.2.0}/txs/analysis/svd.py +0 -0
  66. {pytxs-0.0.2 → pytxs-0.2.0}/txs/analysis/utils.py +0 -0
  67. {pytxs-0.0.2 → pytxs-0.2.0}/txs/app/PlotBase.py +0 -0
  68. {pytxs-0.0.2 → pytxs-0.2.0}/txs/app/__init__.py +0 -0
  69. {pytxs-0.0.2 → pytxs-0.2.0}/txs/app/actions.py +0 -0
  70. {pytxs-0.0.2 → pytxs-0.2.0}/txs/app/tests/test_ProcessWorker.py +0 -0
  71. {pytxs-0.0.2 → pytxs-0.2.0}/txs/app/txs.svg +0 -0
  72. {pytxs-0.0.2 → pytxs-0.2.0}/txs/app/widgets.py +0 -0
  73. {pytxs-0.0.2 → pytxs-0.2.0}/txs/common.py +0 -0
  74. {pytxs-0.0.2 → pytxs-0.2.0}/txs/corr.py +0 -0
  75. {pytxs-0.0.2 → pytxs-0.2.0}/txs/datasets.py +0 -0
  76. {pytxs-0.0.2 → pytxs-0.2.0}/txs/detectors/__init__.py +0 -0
  77. {pytxs-0.0.2 → pytxs-0.2.0}/txs/detectors/jungfrau.py +0 -0
  78. {pytxs-0.0.2 → pytxs-0.2.0}/txs/tests/conftest.py +0 -0
  79. {pytxs-0.0.2 → pytxs-0.2.0}/txs/tests/test_corr.py +0 -0
  80. {pytxs-0.0.2 → pytxs-0.2.0}/txs/tests/test_datasets.py +0 -0
  81. {pytxs-0.0.2 → pytxs-0.2.0}/txs/tests/test_utils.py +0 -0
  82. {pytxs-0.0.2 → pytxs-0.2.0}/txs/xes.py +0 -0
  83. {pytxs-0.0.2 → pytxs-0.2.0}/versioneer.py +0 -0
@@ -1,30 +1,32 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: pytxs
3
- Version: 0.0.2
3
+ Version: 0.2.0
4
4
  Summary: time-resolved x-ray scattering
5
5
  Author-email: Matteo Levantino <matteo.levantino@esrf.fr>
6
- License: MIT
6
+ License-Expression: MIT
7
7
  Project-URL: Homepage, https://gitlab.esrf.fr/levantin/txs
8
8
  Classifier: Intended Audience :: Science/Research
9
9
  Classifier: Topic :: Scientific/Engineering :: Physics
10
- Classifier: License :: OSI Approved :: MIT License
11
10
  Classifier: Programming Language :: Python :: 3
12
- Requires-Python: >=3.8
11
+ Requires-Python: >=3.10
13
12
  Description-Content-Type: text/x-rst
14
13
  License-File: LICENSE.rst
15
14
  Requires-Dist: numpy>=1.10
15
+ Requires-Dist: scipy
16
+ Requires-Dist: matplotlib
17
+ Requires-Dist: python-dateutil
16
18
  Requires-Dist: h5py>3.0
17
19
  Requires-Dist: tqdm
18
20
  Requires-Dist: packaging
19
21
  Requires-Dist: fabio
20
- Requires-Dist: packaging
21
22
  Requires-Dist: pyFAI
22
23
  Requires-Dist: xraydb>=4.3.4
23
24
  Requires-Dist: datastorage
24
25
  Provides-Extra: gui
25
26
  Requires-Dist: PyQt5>=5.14; extra == "gui"
26
27
  Requires-Dist: matplotlib; extra == "gui"
27
- Requires-Dist: silx; extra == "gui"
28
+ Requires-Dist: silx[full_no_qt]; extra == "gui"
29
+ Dynamic: license-file
28
30
 
29
31
  ====
30
32
  txs
@@ -41,13 +43,26 @@ You can run txs on all major platforms. For download and installation:
41
43
 
42
44
  .. code-block:: bash
43
45
 
44
- pip install git+https://gitlab.esrf.fr/levantin/txs.git
46
+ pip install pytxs
47
+
48
+ For installing a specific version (e.g. version 0.0.2):
49
+
50
+ .. code-block:: bash
51
+
52
+ pip install "pytxs==0.0.2"
53
+
54
+ For staying on the 0.x versions (before the reorganization of the dataset
55
+ handling in version 1.0, e.g. for scripts using ``txs.BlissDataset``):
56
+
57
+ .. code-block:: bash
58
+
59
+ pip install "pytxs<1"
45
60
 
46
- For installing a specific version (e.g. version 0.1.0):
61
+ or, from the repository:
47
62
 
48
63
  .. code-block:: bash
49
64
 
50
- pip install git+https://gitlab.esrf.fr/levantin/txs.git@0.1.0
65
+ pip install git+https://gitlab.esrf.fr/levantin/txs.git@v0.2.0
51
66
 
52
67
  For upgrading txs to the last version/commit:
53
68
 
@@ -13,13 +13,26 @@ You can run txs on all major platforms. For download and installation:
13
13
 
14
14
  .. code-block:: bash
15
15
 
16
- pip install git+https://gitlab.esrf.fr/levantin/txs.git
16
+ pip install pytxs
17
17
 
18
- For installing a specific version (e.g. version 0.1.0):
18
+ For installing a specific version (e.g. version 0.0.2):
19
19
 
20
20
  .. code-block:: bash
21
21
 
22
- pip install git+https://gitlab.esrf.fr/levantin/txs.git@0.1.0
22
+ pip install "pytxs==0.0.2"
23
+
24
+ For staying on the 0.x versions (before the reorganization of the dataset
25
+ handling in version 1.0, e.g. for scripts using ``txs.BlissDataset``):
26
+
27
+ .. code-block:: bash
28
+
29
+ pip install "pytxs<1"
30
+
31
+ or, from the repository:
32
+
33
+ .. code-block:: bash
34
+
35
+ pip install git+https://gitlab.esrf.fr/levantin/txs.git@v0.2.0
23
36
 
24
37
  For upgrading txs to the last version/commit:
25
38
 
@@ -1,5 +1,5 @@
1
1
  [build-system]
2
- requires = ["setuptools", "versioneer[toml]==0.29"]
2
+ requires = ["setuptools>=77", "versioneer[toml]==0.29"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
@@ -7,24 +7,26 @@ name = "pytxs"
7
7
  dynamic = ["version"]
8
8
  description = "time-resolved x-ray scattering"
9
9
  readme = "README.rst"
10
- license = {text = "MIT"}
10
+ license = "MIT"
11
+ license-files = ["LICENSE.rst"]
11
12
  classifiers = [
12
13
  "Intended Audience :: Science/Research",
13
14
  "Topic :: Scientific/Engineering :: Physics",
14
- "License :: OSI Approved :: MIT License",
15
15
  "Programming Language :: Python :: 3",
16
16
  ]
17
17
  authors = [
18
18
  {name = "Matteo Levantino", email = "matteo.levantino@esrf.fr"},
19
19
  ]
20
- requires-python = ">=3.8"
20
+ requires-python = ">=3.10"
21
21
  dependencies = [
22
22
  "numpy>=1.10",
23
+ "scipy",
24
+ "matplotlib",
25
+ "python-dateutil",
23
26
  "h5py>3.0",
24
27
  "tqdm",
25
28
  "packaging",
26
29
  "fabio",
27
- "packaging",
28
30
  "pyFAI",
29
31
  "xraydb>=4.3.4",
30
32
  "datastorage",
@@ -34,7 +36,11 @@ dependencies = [
34
36
  txs = "txs.app.__main__:main"
35
37
 
36
38
  [project.optional-dependencies]
37
- gui = ["PyQt5>=5.14", "matplotlib", "silx"]
39
+ gui = [
40
+ "PyQt5 >= 5.14",
41
+ "matplotlib",
42
+ "silx[full_no_qt]",
43
+ ]
38
44
 
39
45
  [project.urls]
40
46
  Homepage = "https://gitlab.esrf.fr/levantin/txs"
@@ -1,30 +1,32 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: pytxs
3
- Version: 0.0.2
3
+ Version: 0.2.0
4
4
  Summary: time-resolved x-ray scattering
5
5
  Author-email: Matteo Levantino <matteo.levantino@esrf.fr>
6
- License: MIT
6
+ License-Expression: MIT
7
7
  Project-URL: Homepage, https://gitlab.esrf.fr/levantin/txs
8
8
  Classifier: Intended Audience :: Science/Research
9
9
  Classifier: Topic :: Scientific/Engineering :: Physics
10
- Classifier: License :: OSI Approved :: MIT License
11
10
  Classifier: Programming Language :: Python :: 3
12
- Requires-Python: >=3.8
11
+ Requires-Python: >=3.10
13
12
  Description-Content-Type: text/x-rst
14
13
  License-File: LICENSE.rst
15
14
  Requires-Dist: numpy>=1.10
15
+ Requires-Dist: scipy
16
+ Requires-Dist: matplotlib
17
+ Requires-Dist: python-dateutil
16
18
  Requires-Dist: h5py>3.0
17
19
  Requires-Dist: tqdm
18
20
  Requires-Dist: packaging
19
21
  Requires-Dist: fabio
20
- Requires-Dist: packaging
21
22
  Requires-Dist: pyFAI
22
23
  Requires-Dist: xraydb>=4.3.4
23
24
  Requires-Dist: datastorage
24
25
  Provides-Extra: gui
25
26
  Requires-Dist: PyQt5>=5.14; extra == "gui"
26
27
  Requires-Dist: matplotlib; extra == "gui"
27
- Requires-Dist: silx; extra == "gui"
28
+ Requires-Dist: silx[full_no_qt]; extra == "gui"
29
+ Dynamic: license-file
28
30
 
29
31
  ====
30
32
  txs
@@ -41,13 +43,26 @@ You can run txs on all major platforms. For download and installation:
41
43
 
42
44
  .. code-block:: bash
43
45
 
44
- pip install git+https://gitlab.esrf.fr/levantin/txs.git
46
+ pip install pytxs
47
+
48
+ For installing a specific version (e.g. version 0.0.2):
49
+
50
+ .. code-block:: bash
51
+
52
+ pip install "pytxs==0.0.2"
53
+
54
+ For staying on the 0.x versions (before the reorganization of the dataset
55
+ handling in version 1.0, e.g. for scripts using ``txs.BlissDataset``):
56
+
57
+ .. code-block:: bash
58
+
59
+ pip install "pytxs<1"
45
60
 
46
- For installing a specific version (e.g. version 0.1.0):
61
+ or, from the repository:
47
62
 
48
63
  .. code-block:: bash
49
64
 
50
- pip install git+https://gitlab.esrf.fr/levantin/txs.git@0.1.0
65
+ pip install git+https://gitlab.esrf.fr/levantin/txs.git@v0.2.0
51
66
 
52
67
  For upgrading txs to the last version/commit:
53
68
 
@@ -43,6 +43,7 @@ pytxs.egg-info/top_level.txt
43
43
  txs/__init__.py
44
44
  txs/_version.py
45
45
  txs/azav.py
46
+ txs/blissdata.py
46
47
  txs/common.py
47
48
  txs/corr.py
48
49
  txs/datared.py
@@ -1,9 +1,11 @@
1
1
  numpy>=1.10
2
+ scipy
3
+ matplotlib
4
+ python-dateutil
2
5
  h5py>3.0
3
6
  tqdm
4
7
  packaging
5
8
  fabio
6
- packaging
7
9
  pyFAI
8
10
  xraydb>=4.3.4
9
11
  datastorage
@@ -11,4 +13,4 @@ datastorage
11
13
  [gui]
12
14
  PyQt5>=5.14
13
15
  matplotlib
14
- silx
16
+ silx[full_no_qt]
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2025-02-13T13:28:37+0100",
11
+ "date": "2026-12-01T10:20:33+0100",
12
12
  "dirty": false,
13
13
  "error": null,
14
- "full-revisionid": "24e648122c414e8688b55a1226869b6253b8d56f",
15
- "version": "0.0.2"
14
+ "full-revisionid": "eb0bd752421b95c221006dc5516a7775121a0d18",
15
+ "version": "0.2.0"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -74,11 +74,11 @@ def plot_dataset(
74
74
 
75
75
  ax.axhline(idx * incr, ls=":", alpha=0.2)
76
76
 
77
- ax.set_xlabel("q [$\\rm \AA^{-1}$]")
77
+ ax.set_xlabel("q [$\\rm \\AA^{-1}$]")
78
78
  ax.set_ylabel(f"{ylabel}S(q)")
79
79
  ax.legend(loc=2, bbox_to_anchor=(1, 1))
80
80
  ax.set_title(
81
- f"$\\rm \Delta t$ = {t_key}\n" +
81
+ f"$\\rm \\Delta t$ = {t_key}\n" +
82
82
  "semi-transparent -> " if heating is not None else "" +
83
83
  "no heating removal" if heating is not None else ""
84
84
  )
@@ -184,8 +184,8 @@ def plot_svd_analysis(
184
184
 
185
185
  lines.append(line_group)
186
186
 
187
- ax[0].set_xlabel("q [$\\rm \AA^{-1}$]")
188
- ax[0].set_ylabel(f'$\\rm {ylabel}\Delta S(q)$ ')
187
+ ax[0].set_xlabel("q [$\\rm \\AA^{-1}$]")
188
+ ax[0].set_ylabel(f'$\\rm {ylabel}\\Delta S(q)$ ')
189
189
  ax[0].grid(alpha=0.2)
190
190
  if keep_lims:
191
191
  ax[0].set_xlim(ax0_lims[0])
@@ -206,7 +206,7 @@ def plot_svd_analysis(
206
206
  # savgol_filter(val, 15, 3) + incr * idx
207
207
  )
208
208
  ax[1].axhline(incr * idx, color='black', ls=':', alpha=0.2)
209
- ax[1].set_xlabel("q [$\\rm \AA^{-1}$]")
209
+ ax[1].set_xlabel("q [$\\rm \\AA^{-1}$]")
210
210
  ax[1].set_ylabel(f'{ylabel}U vectors\n[arb. units]')
211
211
  ax[1].grid(alpha=0.2)
212
212
  if keep_lims:
@@ -28,7 +28,6 @@ from txs.utils import load_mask
28
28
 
29
29
  from .utils import FileCompleter
30
30
 
31
-
32
31
  _logger = logging.getLogger(__name__)
33
32
 
34
33
 
@@ -164,6 +163,22 @@ class MainWindow(qt.QMainWindow):
164
163
  self.style().standardIcon(qt.QStyle.SP_MessageBoxWarning)
165
164
  )
166
165
 
166
+ if qt.BINDING == "PyQt5":
167
+ self.menuView.setEnabled(False)
168
+
169
+ self._colorSchemeActionGroup = qt.QActionGroup(self)
170
+ self._colorSchemeActionGroup.setExclusive(True)
171
+ self._colorSchemeActionGroup.addAction(self.darkModeAction)
172
+ self._colorSchemeActionGroup.addAction(self.lightModeAction)
173
+ self._colorSchemeActionGroup.addAction(self.defaultModeAction)
174
+
175
+ self.darkModeAction.setData("dark")
176
+ self.darkModeAction.toggled.connect(self._colorSchemeActionToggled)
177
+ self.lightModeAction.setData("light")
178
+ self.lightModeAction.toggled.connect(self._colorSchemeActionToggled)
179
+ self.defaultModeAction.setData("default")
180
+ self.defaultModeAction.toggled.connect(self._colorSchemeActionToggled)
181
+
167
182
  self.openAction.triggered.connect(self._openData)
168
183
  self.errorAction.triggered.connect(self._errorActionClicked)
169
184
  self.inputBrowseButton.clicked.connect(self._openData)
@@ -201,14 +216,34 @@ class MainWindow(qt.QMainWindow):
201
216
 
202
217
  # Disable wheel interaction for widgets inside the scroll area
203
218
  wheelEventFilter = WheelEventFilter(self)
204
- wheelEventFilter.filter(
205
- self.parametersScrollArea.findChildren(
206
- (qt.QComboBox, qt.QDoubleSpinBox, qt.QSpinBox)
207
- )
208
- )
219
+ for widgetClass in (qt.QComboBox, qt.QDoubleSpinBox, qt.QSpinBox):
220
+ wheelEventFilter.filter(self.parametersScrollArea.findChildren(widgetClass))
209
221
 
210
222
  self.resize(800, 600)
211
223
 
224
+ def _colorSchemeActionToggled(self, checked: bool = True):
225
+ if not checked:
226
+ return
227
+
228
+ colorScheme = self.sender().data()
229
+ styleHints = qt.QApplication.instance().styleHints()
230
+
231
+ if not hasattr(qt.QStyleHints, "setColorScheme"): # PySide6 >= 6.5
232
+ _logger.warning("Color scheme not supported")
233
+ return
234
+
235
+ if colorScheme == "dark":
236
+ styleHints.setColorScheme(qt.Qt.ColorScheme.Dark)
237
+ elif colorScheme == "light":
238
+ styleHints.setColorScheme(qt.Qt.ColorScheme.Light)
239
+ elif colorScheme == "default":
240
+ if hasattr(qt.QStyleHints, "unsetColorScheme"): # PySide6 >= 6.8
241
+ styleHints.unsetColorScheme()
242
+ else:
243
+ _logger.warning("Color scheme not supported")
244
+ else:
245
+ _logger.warning("Invalid color scheme")
246
+
212
247
  def _openData(self):
213
248
  # Use current input folder's parent folder as dialog's default directory
214
249
  currentFolder = self.getInputFolder()
@@ -585,6 +620,10 @@ class MainWindow(qt.QMainWindow):
585
620
  def closeEvent(self, event):
586
621
  settings = qt.QSettings()
587
622
  settings.setValue("version", self._SETTINGS_VERSION_STR)
623
+ settings.setValue(
624
+ "application/colorscheme",
625
+ self._colorSchemeActionGroup.checkedAction().data(),
626
+ )
588
627
  settings.setValue("mainwindow/geometry", self.geometry())
589
628
  settings.setValue("mainwindow/fullscreen", self.isFullScreen())
590
629
  settings.setValue("mainwindow/splitter/sizes", self.splitter.sizes())
@@ -614,6 +653,13 @@ class MainWindow(qt.QMainWindow):
614
653
  settings.clear()
615
654
  return
616
655
 
656
+ colorScheme = settings.value("application/colorscheme", "default")
657
+ if qt.BINDING != "PyQt5":
658
+ for action in self._colorSchemeActionGroup.actions():
659
+ if action.data() == colorScheme:
660
+ action.setChecked(True)
661
+ break
662
+
617
663
  for key, func in {
618
664
  "mainwindow/geometry": self.setGeometry,
619
665
  "mainwindow/fullscreen": lambda ison: self._setFullScreen(ison == "true"),
@@ -172,7 +172,7 @@ class PlotNormalizedHeatmap(PlotHeatmap):
172
172
  def _currentTextChanged(self, text: str):
173
173
  # Set data to update displayed data with new normalization
174
174
  x, data = self.getData(copy=False)
175
- if x.size == 0 or data.size== 0:
175
+ if x.size == 0 or data.size == 0:
176
176
  return # No data
177
177
  self.setData(x, data, copy=False)
178
178
 
@@ -14,7 +14,6 @@ import traceback
14
14
  from silx.gui import qt
15
15
  from silx.gui.utils.concurrent import submitToQtMainThread
16
16
 
17
-
18
17
  _logger = logging.getLogger(__name__)
19
18
 
20
19
 
@@ -12,7 +12,6 @@ from silx.gui import qt
12
12
 
13
13
  from .MainWindow import MainWindow
14
14
 
15
-
16
15
  logging.basicConfig()
17
16
 
18
17
 
@@ -78,6 +77,7 @@ def main():
78
77
  app.setOrganizationName("ESRF")
79
78
  app.setOrganizationDomain("esrf.fr")
80
79
  app.setApplicationName("txs")
80
+ app.setDesktopFileName("eu.esrf.txs")
81
81
  qt.QSettings.setDefaultFormat(qt.QSettings.IniFormat)
82
82
 
83
83
  if options.clearSettings:
@@ -134,8 +134,8 @@
134
134
  <rect>
135
135
  <x>0</x>
136
136
  <y>0</y>
137
- <width>306</width>
138
- <height>1791</height>
137
+ <width>320</width>
138
+ <height>1881</height>
139
139
  </rect>
140
140
  </property>
141
141
  <layout class="QVBoxLayout" name="verticalLayout_2">
@@ -1994,7 +1994,7 @@
1994
1994
  <x>0</x>
1995
1995
  <y>0</y>
1996
1996
  <width>800</width>
1997
- <height>24</height>
1997
+ <height>23</height>
1998
1998
  </rect>
1999
1999
  </property>
2000
2000
  <widget class="QMenu" name="menuFile">
@@ -2005,7 +2005,16 @@
2005
2005
  <addaction name="separator"/>
2006
2006
  <addaction name="quitAction"/>
2007
2007
  </widget>
2008
+ <widget class="QMenu" name="menuView">
2009
+ <property name="title">
2010
+ <string>View</string>
2011
+ </property>
2012
+ <addaction name="darkModeAction"/>
2013
+ <addaction name="lightModeAction"/>
2014
+ <addaction name="defaultModeAction"/>
2015
+ </widget>
2008
2016
  <addaction name="menuFile"/>
2017
+ <addaction name="menuView"/>
2009
2018
  </widget>
2010
2019
  <widget class="QToolBar" name="toolBar">
2011
2020
  <property name="sizePolicy">
@@ -2066,6 +2075,42 @@ or check messages in the console</string>
2066
2075
  <bool>false</bool>
2067
2076
  </property>
2068
2077
  </action>
2078
+ <action name="darkModeAction">
2079
+ <property name="checkable">
2080
+ <bool>true</bool>
2081
+ </property>
2082
+ <property name="text">
2083
+ <string>Dark mode</string>
2084
+ </property>
2085
+ <property name="toolTip">
2086
+ <string>Use dark color scheme</string>
2087
+ </property>
2088
+ </action>
2089
+ <action name="lightModeAction">
2090
+ <property name="checkable">
2091
+ <bool>true</bool>
2092
+ </property>
2093
+ <property name="text">
2094
+ <string>Light mode</string>
2095
+ </property>
2096
+ <property name="toolTip">
2097
+ <string>Use light color scheme</string>
2098
+ </property>
2099
+ </action>
2100
+ <action name="defaultModeAction">
2101
+ <property name="checkable">
2102
+ <bool>true</bool>
2103
+ </property>
2104
+ <property name="checked">
2105
+ <bool>true</bool>
2106
+ </property>
2107
+ <property name="text">
2108
+ <string>Default color mode</string>
2109
+ </property>
2110
+ <property name="toolTip">
2111
+ <string>Use current system color scheme</string>
2112
+ </property>
2113
+ </action>
2069
2114
  </widget>
2070
2115
  <customwidgets>
2071
2116
  <customwidget>
@@ -11,6 +11,8 @@ from silx.gui.plot import actions, items
11
11
  from silx.gui.plot.LegendSelector import LegendIcon
12
12
  from silx.gui.plot.tools.PositionInfo import PositionInfo
13
13
 
14
+ from txs.utils import t2str_display
15
+
14
16
  from . import utils
15
17
  from .PlotBase import PlotBase
16
18
 
@@ -45,7 +47,7 @@ class _LegendWidget(qt.QWidget):
45
47
 
46
48
  def setInfo(self, info: str):
47
49
  """Set extra information displayed with the curve legend"""
48
- legend = self.getCurve().getName()
50
+ legend = t2str_display(self.getCurve().getName())
49
51
  if info:
50
52
  legend = f"{legend} ({info})"
51
53
  self.__label.setText(legend)
@@ -8,7 +8,6 @@ from packaging.version import Version
8
8
  import numpy as np
9
9
  from silx.gui import qt
10
10
 
11
-
12
11
  # Numpy v1/v2 array's copy argument compatibility
13
12
  NP_OPTIONAL_COPY = False if np.version.version.startswith("1.") else None
14
13
 
@@ -27,8 +27,6 @@ plt.ion()
27
27
  pyfai_methods = ("numpy", "cython", "bbox", "splitpixel", "lut", "csr",
28
28
  "nosplit_csr", "full_csr", "lut_ocl", "csr_ocl")
29
29
 
30
- CALIBRANTS = ['AgBe']
31
-
32
30
 
33
31
  def get_poni(center, pixel, distance, tilt=0, tilt_plane_rotation=0):
34
32
  """