nova-trame 1.1.0__py3-none-any.whl → 1.2.0.dev0__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.
Potentially problematic release.
This version of nova-trame might be problematic. Click here for more details.
- nova/trame/view/components/input_field.py +7 -2
- nova/trame/view/components/ornl/neutron_data_selector.py +14 -1
- {nova_trame-1.1.0.dist-info → nova_trame-1.2.0.dev0.dist-info}/METADATA +1 -1
- {nova_trame-1.1.0.dist-info → nova_trame-1.2.0.dev0.dist-info}/RECORD +7 -7
- {nova_trame-1.1.0.dist-info → nova_trame-1.2.0.dev0.dist-info}/WHEEL +0 -0
- {nova_trame-1.1.0.dist-info → nova_trame-1.2.0.dev0.dist-info}/entry_points.txt +0 -0
- {nova_trame-1.1.0.dist-info → nova_trame-1.2.0.dev0.dist-info}/licenses/LICENSE +0 -0
|
@@ -170,7 +170,8 @@ class InputField:
|
|
|
170
170
|
- file
|
|
171
171
|
- input
|
|
172
172
|
- otp
|
|
173
|
-
- radio
|
|
173
|
+
- radio - Produces a radio button group. Note that this accepts an additional parameter items that expects \
|
|
174
|
+
a list of dictionaries with the following format: { title: 'Item 1', value: 'item_1' }.
|
|
174
175
|
- range-slider
|
|
175
176
|
- select - Produces a dropdown menu. This menu can have items automatically populated if the v_model is \
|
|
176
177
|
connected to a Pydantic field that uses an Enum type. Otherwise, you must specify the items parameter \
|
|
@@ -244,7 +245,11 @@ class InputField:
|
|
|
244
245
|
case "otp":
|
|
245
246
|
input = vuetify.VOtpInput(**kwargs)
|
|
246
247
|
case "radio":
|
|
247
|
-
|
|
248
|
+
items = kwargs.pop("items", None)
|
|
249
|
+
if isinstance(items, tuple):
|
|
250
|
+
items = items[0]
|
|
251
|
+
with vuetify.VRadioGroup(**kwargs) as input:
|
|
252
|
+
vuetify.VRadio(v_for=f"item in {items}", label=("item.title",), value=("item.value",))
|
|
248
253
|
case "range-slider":
|
|
249
254
|
input = vuetify.VRangeSlider(**kwargs)
|
|
250
255
|
case "select":
|
|
@@ -36,6 +36,7 @@ class NeutronDataSelector(DataSelector):
|
|
|
36
36
|
facility: Union[str, Tuple] = "",
|
|
37
37
|
instrument: Union[str, Tuple] = "",
|
|
38
38
|
experiment: Union[str, Tuple] = "",
|
|
39
|
+
show_experiment_filters: Union[bool, Tuple] = True,
|
|
39
40
|
extensions: Union[List[str], Tuple, None] = None,
|
|
40
41
|
projection: Union[List[str], Tuple, None] = None,
|
|
41
42
|
subdirectory: Union[str, Tuple] = "",
|
|
@@ -66,6 +67,9 @@ class NeutronDataSelector(DataSelector):
|
|
|
66
67
|
The instrument to restrict data selection to. Please use the instrument acronym (e.g. CG-2).
|
|
67
68
|
experiment : Union[str, Tuple], optional
|
|
68
69
|
The experiment to restrict data selection to.
|
|
70
|
+
show_experiment_filters : Union[bool, Tuple], optional
|
|
71
|
+
If false, then the facility, instrument, and experiment selection widgets will be hidden from the user. This
|
|
72
|
+
is only intended to be used when all of these parameters are fixed or controlled by external widgets.
|
|
69
73
|
extensions : Union[List[str], Tuple], optional
|
|
70
74
|
A list of file extensions to restrict selection to. If unset, then all files will be shown.
|
|
71
75
|
projection : Union[List[str], Tuple], optional
|
|
@@ -105,6 +109,15 @@ class NeutronDataSelector(DataSelector):
|
|
|
105
109
|
self._data_source = data_source
|
|
106
110
|
self._projection = projection
|
|
107
111
|
|
|
112
|
+
# This is passed to a v_if, which requires a Trame binding to function.
|
|
113
|
+
if isinstance(show_experiment_filters, bool):
|
|
114
|
+
if show_experiment_filters:
|
|
115
|
+
self._show_experiment_filters = ("true",)
|
|
116
|
+
else:
|
|
117
|
+
self._show_experiment_filters = ("false",)
|
|
118
|
+
else:
|
|
119
|
+
self._show_experiment_filters = show_experiment_filters
|
|
120
|
+
|
|
108
121
|
self._state_name = f"nova__dataselector_{self._next_id}_state"
|
|
109
122
|
self._facilities_name = f"nova__neutrondataselector_{self._next_id}_facilities"
|
|
110
123
|
self._selected_facility_name = (
|
|
@@ -157,7 +170,7 @@ class NeutronDataSelector(DataSelector):
|
|
|
157
170
|
super().create_ui(**kwargs)
|
|
158
171
|
|
|
159
172
|
with self._layout.filter:
|
|
160
|
-
with GridLayout(columns=3):
|
|
173
|
+
with GridLayout(v_if=self._show_experiment_filters, columns=3):
|
|
161
174
|
column_span = 3
|
|
162
175
|
if isinstance(self._facility, tuple) or not self._facility:
|
|
163
176
|
column_span -= 1
|
|
@@ -10,9 +10,9 @@ nova/trame/view/components/__init__.py,sha256=60BeS69aOrFnkptjuD17rfPE1f4Z35iBH5
|
|
|
10
10
|
nova/trame/view/components/data_selector.py,sha256=yQSxlotZX21pEZsKJKFEVQytN5PbjUCBMHPsROa4tjI,19127
|
|
11
11
|
nova/trame/view/components/execution_buttons.py,sha256=Br6uAmE5bY67TTYc5ZTHECNJ_RJqKmv17HAKPpQtbeg,4576
|
|
12
12
|
nova/trame/view/components/file_upload.py,sha256=WOaFXeNNwN0DYZJr-W6vWdBiTpr7m-lq3WKJaHmeMe8,4560
|
|
13
|
-
nova/trame/view/components/input_field.py,sha256=
|
|
13
|
+
nova/trame/view/components/input_field.py,sha256=viP6iP3aKkx-nwC6VYLCQYvV8yEVC817cuWezcp9cpc,17823
|
|
14
14
|
nova/trame/view/components/ornl/__init__.py,sha256=HnxzzSsxw0vQSDCVFfWsAxx1n3HnU37LMuQkfiewmSU,90
|
|
15
|
-
nova/trame/view/components/ornl/neutron_data_selector.py,sha256=
|
|
15
|
+
nova/trame/view/components/ornl/neutron_data_selector.py,sha256=tul0a7B26HBvre5JkMpMP4oHvfmkJu3fcDfegzIvyFY,17935
|
|
16
16
|
nova/trame/view/components/progress_bar.py,sha256=zhbJwPy_HPQ8YL-ISN8sCRUQ7qY6qqo9wiV59BmvL8I,3038
|
|
17
17
|
nova/trame/view/components/remote_file_input.py,sha256=mcz_bmI2rD8gdmIOKLhlzfj-XoWBwC99T9ZgQORaKqE,14674
|
|
18
18
|
nova/trame/view/components/tool_outputs.py,sha256=IbYV4VjrkWAE354Bh5KH76SPsxGLIkOXChijS4-ce_Y,2408
|
|
@@ -40,8 +40,8 @@ nova/trame/view_model/ornl/neutron_data_selector.py,sha256=PcnUUNN3S1i-Tc9G4ZZP6
|
|
|
40
40
|
nova/trame/view_model/progress_bar.py,sha256=6AUKHF3hfzbdsHqNEnmHRgDcBKY5TT8ywDx9S6ovnsc,2854
|
|
41
41
|
nova/trame/view_model/remote_file_input.py,sha256=zWOflmCDJYYR_pacHphwzricV667GSRokh-mlxpBAOo,3646
|
|
42
42
|
nova/trame/view_model/tool_outputs.py,sha256=ev6LY7fJ0H2xAJn9f5ww28c8Kpom2SYc2FbvFcoN4zg,829
|
|
43
|
-
nova_trame-1.
|
|
44
|
-
nova_trame-1.
|
|
45
|
-
nova_trame-1.
|
|
46
|
-
nova_trame-1.
|
|
47
|
-
nova_trame-1.
|
|
43
|
+
nova_trame-1.2.0.dev0.dist-info/METADATA,sha256=rmzqk2-yPsR0rvZpWlVS-MISfB6NcEfMJsMMgNOd1Yw,2101
|
|
44
|
+
nova_trame-1.2.0.dev0.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
45
|
+
nova_trame-1.2.0.dev0.dist-info/entry_points.txt,sha256=J2AmeSwiTYZ4ZqHHp9HO6v4MaYQTTBPbNh6WtoqOT58,42
|
|
46
|
+
nova_trame-1.2.0.dev0.dist-info/licenses/LICENSE,sha256=Iu5QiDbwNbREg75iYaxIJ_V-zppuv4QFuBhAW-qiAlM,1061
|
|
47
|
+
nova_trame-1.2.0.dev0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|