@@ -71,37 +71,29 @@ def load(self):
71
71
Column ,
72
72
Menu ,
73
73
MenuItemHistogram ,
74
- MenuItemOption ,
75
74
MenuItemPeriodicTable ,
76
75
MenuItemTerms ,
76
+ MenuSizeEnum ,
77
77
SearchQuantities ,
78
78
)
79
79
80
80
schema = "pynxtools.nomad.schema.Root"
81
81
82
- nxdefs_inheriting_from_sensorscan = [
83
- "NXsensor_scan" ,
84
- "NXiv_temp" ,
85
- "NXspm" ,
86
- "NXsts" ,
87
- "NXafm" ,
88
- "NXstm" ,
89
- ]
90
82
91
- nxsensor_scan_app = AppEntryPoint (
92
- name = "NXsensor_scan App" ,
93
- description = "App for NXsensor_scan and inheriting from it classes ." ,
83
+ nexus_app = AppEntryPoint (
84
+ name = "NeXus App" ,
85
+ description = "Simple Generic NeXus app ." ,
94
86
app = App (
95
87
# Label of the App
96
- label = "Simple Scan " ,
88
+ label = "NeXus " ,
97
89
# Path used in the URL, must be unique
98
- path = "nxsensor_scan " ,
90
+ path = "nexusapp " ,
99
91
# Used to categorize apps in the explore menu
100
92
category = "Experiment" ,
101
93
# Brief description used in the app menu
102
- description = "Search simple scan experiments (NXsensor_scan and inheriting classes), including output of NOMAD CAMELS " ,
94
+ description = "A simple search app customized for generic NeXus data. " ,
103
95
# Longer description that can also use markdown
104
- readme = "This page allows to search for generic experimental entries corresponding to NXsensor_scan and inheriting from it classes, including output of NOMAD CAMELS . It is similar to the entries search, but with reduced filter set, modified menu on the left and different shown columns. The dashboard directly shows useful interactive statistics about the data" ,
96
+ readme = "This page allows to search for generic NeXus Experiment Entries . It is similar to the entries search, but with reduced filter set, modified menu on the left and different shown columns. The dashboard directly shows useful interactive statistics about the data" ,
105
97
# If you want to use quantities from a custom schema, you need to load
106
98
# the search quantities from it first here. Note that you can use a glob
107
99
# syntax to load the entire package, or just a single schema from a
@@ -147,25 +139,19 @@ def load(self):
147
139
search_quantity = f"data.ENTRY[*].definition__field#{ schema } " ,
148
140
selected = True ,
149
141
),
150
- Column (
151
- title = "Protocol" ,
152
- search_quantity = f"data.ENTRY[*].NOTE[?name=='protocol'].file_name__field#{ schema } #str" ,
153
- selected = False ,
154
- ),
155
142
],
156
143
# Dictionary of search filters that are always enabled for queries made
157
144
# within this app. This is especially important to narrow down the
158
145
# results to the wanted subset.
159
- filters_locked = {
160
- f"data.ENTRY.definition__field#{ schema } " : nxdefs_inheriting_from_sensorscan ,
161
- },
162
- # filters_locked={"section_defs.definition_qualified_name": [schema]},
146
+ filters_locked = {"section_defs.definition_qualified_name" : [schema ]},
163
147
# Controls the menu shown on the left
164
148
menu = Menu (
149
+ size = MenuSizeEnum .MD ,
165
150
title = "Menu" ,
166
151
items = [
167
152
Menu (
168
153
title = "Elements" ,
154
+ size = MenuSizeEnum .XXL ,
169
155
items = [
170
156
MenuItemPeriodicTable (
171
157
search_quantity = "results.material.elements" ,
@@ -180,13 +166,42 @@ def load(self):
180
166
width = 6 ,
181
167
options = 0 ,
182
168
),
169
+ MenuItemTerms (
170
+ search_quantity = "results.material.chemical_formula_reduced" ,
171
+ width = 6 ,
172
+ options = 0 ,
173
+ ),
174
+ MenuItemTerms (
175
+ search_quantity = "results.material.chemical_formula_anonymous" ,
176
+ width = 6 ,
177
+ options = 0 ,
178
+ ),
183
179
MenuItemHistogram (
184
180
x = "results.material.n_elements" ,
185
181
),
186
182
],
187
183
),
184
+ Menu (
185
+ title = "Experiment type" ,
186
+ size = MenuSizeEnum .LG ,
187
+ items = [
188
+ MenuItemTerms (
189
+ title = "Entry Type" ,
190
+ search_quantity = f"entry_type" ,
191
+ width = 12 ,
192
+ options = 12 ,
193
+ ),
194
+ MenuItemTerms (
195
+ title = "NeXus Class" ,
196
+ search_quantity = f"data.ENTRY.definition__field#{ schema } " ,
197
+ width = 12 ,
198
+ options = 12 ,
199
+ ),
200
+ ],
201
+ ),
188
202
Menu (
189
203
title = "Instruments" ,
204
+ size = MenuSizeEnum .LG ,
190
205
items = [
191
206
MenuItemTerms (
192
207
title = "Model" ,
@@ -204,6 +219,7 @@ def load(self):
204
219
),
205
220
Menu (
206
221
title = "Samples" ,
222
+ size = MenuSizeEnum .LG ,
207
223
items = [
208
224
MenuItemTerms (
209
225
title = "Name" ,
@@ -220,222 +236,96 @@ def load(self):
220
236
],
221
237
),
222
238
Menu (
223
- title = "Authors" ,
239
+ title = "Authors / Origin" ,
240
+ size = MenuSizeEnum .LG ,
224
241
items = [
225
242
MenuItemTerms (
226
- title = "Name " ,
243
+ title = "Entry Author " ,
227
244
search_quantity = f"data.ENTRY.USER.name__field#{ schema } " ,
228
245
width = 12 ,
229
- options = 12 ,
246
+ options = 5 ,
230
247
),
231
248
MenuItemTerms (
232
- title = "Affiliation " ,
233
- search_quantity = f"data.ENTRY.USER.affiliation__field #{ schema } " ,
249
+ title = "User ID / Entry Author " ,
250
+ search_quantity = f"data.ENTRY.userID.name__field #{ schema } #str " ,
234
251
width = 12 ,
235
- options = 12 ,
252
+ options = 5 ,
236
253
),
237
- ],
238
- ),
239
- Menu (
240
- title = "Protocols (NOMAD CAMELS)" ,
241
- items = [
242
254
MenuItemTerms (
243
- title = "CAMELS files " ,
244
- search_quantity = f"data.ENTRY.PROCESS.program__field# { schema } " ,
255
+ title = "Upload Author " ,
256
+ search_quantity = f"authors.name " ,
245
257
width = 12 ,
246
- options = {
247
- "NOMAD CAMELS" : MenuItemOption (
248
- label = "NOMAD CAMELS entries only" ,
249
- ),
250
- },
251
- show_header = False ,
252
- show_input = False ,
258
+ options = 5 ,
253
259
),
254
260
MenuItemTerms (
255
- title = "Protocols (only for CAMELS files) " ,
256
- search_quantity = f"data.ENTRY.NOTE.file_name__field #{ schema } #str " ,
261
+ title = "Affiliation " ,
262
+ search_quantity = f"data.ENTRY.USER.affiliation__field #{ schema } " ,
257
263
width = 12 ,
258
- options = 12 ,
264
+ options = 5 ,
259
265
),
260
266
],
261
267
),
268
+ MenuItemHistogram (
269
+ title = "Start Time" ,
270
+ x = f"data.ENTRY.start_time#{ schema } " ,
271
+ autorange = True ,
272
+ ),
273
+ MenuItemHistogram (
274
+ title = "Upload Creation Time" ,
275
+ x = f"upload_create_time" ,
276
+ autorange = True ,
277
+ ),
262
278
],
263
279
),
264
280
# Controls the default dashboard shown in the search interface
265
281
dashboard = {
266
282
"widgets" : [
267
283
{
268
- "type" : "histogram" ,
269
- "show_input" : False ,
270
- "autorange" : True ,
271
- "nbins" : 30 ,
284
+ "type" : "periodic_table" ,
272
285
"scale" : "linear" ,
273
- "quantity" : f"data.ENTRY.start_time#{ schema } " ,
274
- "title" : "Start Time" ,
286
+ "quantity" : f"results.material.elements" ,
275
287
"layout" : {
276
- "lg" : {"minH" : 3 , "minW" : 3 , "h" : 6 , "w" : 10 , "y" : 0 , "x" : 0 }
288
+ "lg" : {"minH" : 3 , "minW" : 3 , "h" : 7 , "w" : 10 , "y" : 0 , "x" : 0 }
277
289
},
278
290
},
279
291
{
280
292
"type" : "terms" ,
281
- "show_input" : False ,
293
+ "show_input" : True ,
282
294
"scale" : "linear" ,
283
295
"quantity" : f"entry_type" ,
284
296
"title" : "Entry Type" ,
285
297
"layout" : {
286
- "lg" : {"minH" : 3 , "minW" : 3 , "h" : 6 , "w" : 5 , "y" : 6 , "x" : 0 }
298
+ "lg" : {"minH" : 3 , "minW" : 3 , "h" : 7 , "w" : 4 , "y" : 0 , "x" : 10 }
287
299
},
288
300
},
289
301
{
290
302
"type" : "terms" ,
291
- "show_input" : False ,
303
+ "show_input" : True ,
292
304
"scale" : "linear" ,
293
- "quantity" : f"data.ENTRY.SAMPLE.sample_id__field #{ schema } " ,
294
- "title" : "Sample ID " ,
305
+ "quantity" : f"data.ENTRY.definition__field #{ schema } " ,
306
+ "title" : "NeXus Class " ,
295
307
"layout" : {
296
- "lg" : {"minH" : 3 , "minW" : 3 , "h" : 12 , "w" : 4 , "y" : 0 , "x" : 14 }
308
+ "lg" : {"minH" : 3 , "minW" : 3 , "h" : 7 , "w" : 4 , "y" : 0 , "x" : 14 }
297
309
},
298
310
},
299
311
{
300
312
"type" : "terms" ,
301
- "show_input" : False ,
313
+ "show_input" : True ,
302
314
"scale" : "linear" ,
303
315
"quantity" : f"data.ENTRY.USER.name__field#{ schema } " ,
304
316
"title" : "Author" ,
305
317
"layout" : {
306
- "lg" : {"minH" : 3 , "minW" : 3 , "h" : 6 , "w" : 5 , "y" : 6 , "x" : 5 }
318
+ "lg" : {"minH" : 3 , "minW" : 3 , "h" : 7 , "w" : 4 , "y" : 0 , "x" : 18 }
307
319
},
308
320
},
309
321
{
310
322
"type" : "terms" ,
311
- "show_input" : False ,
323
+ "show_input" : True ,
312
324
"scale" : "linear" ,
313
325
"quantity" : f"data.ENTRY.SAMPLE.name__field#{ schema } " ,
314
326
"title" : "Sample" ,
315
327
"layout" : {
316
- "lg" : {"minH" : 3 , "minW" : 3 , "h" : 12 , "w" : 4 , "y" : 0 , "x" : 10 }
317
- },
318
- },
319
- ]
320
- },
321
- ),
322
- )
323
-
324
- nexus_app = AppEntryPoint (
325
- name = "NexusApp" ,
326
- description = "Simple Generic NeXus app." ,
327
- app = App (
328
- # Label of the App
329
- label = "NeXus" ,
330
- # Path used in the URL, must be unique
331
- path = "nexusapp" ,
332
- # Used to categorize apps in the explore menu
333
- category = "Experiment" ,
334
- # Brief description used in the app menu
335
- description = "A simple search app customized for generic NeXus data." ,
336
- # Longer description that can also use markdown
337
- readme = "This is a simple App to support basic search for NeXus based Experiment Entries." ,
338
- # If you want to use quantities from a custom schema, you need to load
339
- # the search quantities from it first here. Note that you can use a glob
340
- # syntax to load the entire package, or just a single schema from a
341
- # package.
342
- search_quantities = SearchQuantities (
343
- include = [f"*#{ schema } " ],
344
- ),
345
- # Controls which columns are shown in the results table
346
- columns = [
347
- Column (quantity = "entry_id" , selected = True ),
348
- Column (quantity = f"entry_type" , selected = True ),
349
- Column (
350
- title = "definition" ,
351
- quantity = f"data.ENTRY[*].definition__field#{ schema } " ,
352
- selected = True ,
353
- ),
354
- Column (
355
- title = "start_time" ,
356
- quantity = f"data.ENTRY[*].start_time__field#{ schema } " ,
357
- selected = True ,
358
- ),
359
- Column (
360
- title = "title" ,
361
- quantity = f"data.ENTRY[*].title__field#{ schema } " ,
362
- selected = True ,
363
- ),
364
- ],
365
- # Dictionary of search filters that are always enabled for queries made
366
- # within this app. This is especially important to narrow down the
367
- # results to the wanted subset. Any available search filter can be
368
- # targeted here. This example makes sure that only entries that use
369
- # MySchema are included.
370
- filters_locked = {"section_defs.definition_qualified_name" : [schema ]},
371
- # Controls the menu shown on the left
372
- menu = Menu (
373
- title = "Material" ,
374
- items = [
375
- Menu (
376
- title = "elements" ,
377
- items = [
378
- MenuItemPeriodicTable (
379
- quantity = "results.material.elements" ,
380
- ),
381
- MenuItemTerms (
382
- quantity = "results.material.chemical_formula_hill" ,
383
- width = 6 ,
384
- options = 0 ,
385
- ),
386
- MenuItemTerms (
387
- quantity = "results.material.chemical_formula_iupac" ,
388
- width = 6 ,
389
- options = 0 ,
390
- ),
391
- MenuItemHistogram (
392
- x = "results.material.n_elements" ,
393
- ),
394
- ],
395
- )
396
- ],
397
- ),
398
- # Controls the default dashboard shown in the search interface
399
- dashboard = {
400
- "widgets" : [
401
- {
402
- "type" : "histogram" ,
403
- "show_input" : False ,
404
- "autorange" : True ,
405
- "nbins" : 30 ,
406
- "scale" : "linear" ,
407
- "quantity" : f"data.ENTRY.start_time__field#{ schema } " ,
408
- "title" : "Start Time" ,
409
- "layout" : {
410
- "lg" : {"minH" : 3 , "minW" : 3 , "h" : 4 , "w" : 12 , "y" : 0 , "x" : 0 }
411
- },
412
- },
413
- {
414
- "type" : "terms" ,
415
- "show_input" : False ,
416
- "scale" : "linear" ,
417
- "quantity" : f"entry_type" ,
418
- "title" : "Entry Type" ,
419
- "layout" : {
420
- "lg" : {"minH" : 3 , "minW" : 3 , "h" : 8 , "w" : 4 , "y" : 0 , "x" : 12 }
421
- },
422
- },
423
- {
424
- "type" : "terms" ,
425
- "show_input" : False ,
426
- "scale" : "linear" ,
427
- "quantity" : f"data.ENTRY.definition__field#{ schema } " ,
428
- "title" : "Definition" ,
429
- "layout" : {
430
- "lg" : {"minH" : 3 , "minW" : 3 , "h" : 8 , "w" : 4 , "y" : 0 , "x" : 16 }
431
- },
432
- },
433
- {
434
- "type" : "periodic_table" ,
435
- "scale" : "linear" ,
436
- "quantity" : f"results.material.elements" ,
437
- "layout" : {
438
- "lg" : {"minH" : 3 , "minW" : 3 , "h" : 4 , "w" : 12 , "y" : 4 , "x" : 0 }
328
+ "lg" : {"minH" : 3 , "minW" : 3 , "h" : 7 , "w" : 4 , "y" : 0 , "x" : 22 }
439
329
},
440
330
},
441
331
]
0 commit comments