Skip to content

Ewoks show: difference between default_inputs and pydantic model defaults should be made visible #306

Description

@woutdenolf

It happened at ID16b where the default pydantic model caused confusion.

example
╒═════════════════════════════════╤════════════════════════════════╤══════════════════════════════════════════╤════════════════════════════════╤════════════════════════════╤══════╤════════════════════╕
│ Name                            │ Value                          │ Description                              │ Examples                       │ Task identifier            │   Id │ Label              │
╞═════════════════════════════════╪════════════════════════════════╪══════════════════════════════════════════╪════════════════════════════════╪════════════════════════════╪══════╪════════════════════╡
│ filename                        │ '/data/id16b/inhouse1/id16b260 │ Bliss dataset HDF5 file name.            │ • '/data/dataset.h5'           │ PickScan                   │    0 │ Pick scan          │
│                                 │ 3/id16b/20260301/RAW_DATA/ewok │                                          │                                │                            │      │                    │
│                                 │ sfluo_test/ewoksfluo_test_0001 │                                          │                                │                            │      │                    │
│                                 │ /ewoksfluo_test_0001.h5'       │                                          │                                │                            │      │                    │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ scan_number                     │ 4                              │ Scan number.                             │ • 1                            │ PickScan                   │    0 │ Pick scan          │
│                                 │                                │                                          │ • 2                            │                            │      │                    │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ detector_names                  │ ['fxb_det0', 'fxb_det1']       │ NXdetector group name.                   │ • ['fx_nano_det0',             │ FitSingleScanMultiDetector │    1 │ Fit: 1 scan, N det │
│                                 │                                │                                          │   'fx_nano_det1']              │                            │      │                    │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ output_root_uri                 │ '/data/id16b/inhouse1/id16b260 │ Target HDF5 file URI with optional data  │ • '/results/dataset.h5'        │ FitSingleScanMultiDetector │    1 │ Fit: 1 scan, N det │
│                                 │ 3/id16b/20260301/PROCESSED_DAT │ path.                                    │ • '/results/dataset.h5::/1.1'  │                            │      │                    │
│                                 │ A/ewoksfluo_test/ewoksfluo_tes │                                          │ • '/results/dataset.h5::/1.1/f │                            │      │                    │
│                                 │ t_0001/ewoksfluo_test_0001_xrf │                                          │   it'                          │                            │      │                    │
│                                 │ .h5::/4.1'                     │                                          │                                │                            │      │                    │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ output_root_group               │ None                           │ Optional group underneath                │                                │ FitSingleScanMultiDetector │    1 │ Fit: 1 scan, N det │
│                                 │                                │ ``output_root_uri``.                     │                                │                            │      │                    │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ configs                         │ ['/data/visitor/es1889/id16b/2 │ PyMca configuration                      │ • ['/config/det0.cfg',         │ FitSingleScanMultiDetector │    1 │ Fit: 1 scan, N det │
│                                 │ 0260306/PROCESSED_DATA/FLAB_L3 │                                          │   '/config/det1.cfg']          │                            │      │                    │
│                                 │ _el0.cfg', '/data/visitor/es18 │                                          │ • [{'peaks': {}, 'fit': {}},   │                            │      │                    │
│                                 │ 89/id16b/20260306/PROCESSED_DA │                                          │   {'peaks': {}, 'fit': {}}]    │                            │      │                    │
│                                 │ TA/FLAB_L3_el1.cfg']           │                                          │                                │                            │      │                    │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ xrf_spectra_uri_template        │ 'instrument/{}/data'           │ HDF5 group URI template of an XRF        │                                │ FitSingleScanMultiDetector │    1 │ Fit: 1 scan, N det │
│                                 │                                │ detector relative to `bliss_scan_uri`.   │                                │                            │      │                    │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ process_uri_template            │ None                           │ DEPRECATED                               │                                │ FitSingleScanMultiDetector │    1 │ Fit: 1 scan, N det │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ energy_name                     │ 'mdcm_virtual_energy'          │                                          │                                │ FitSingleScanMultiDetector │    1 │ Fit: 1 scan, N det │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ energy_uri_template             │ 'instrument/positioners_start/ │                                          │                                │ FitSingleScanMultiDetector │    1 │ Fit: 1 scan, N det │
│                                 │ {}'                            │                                          │                                │                            │      │                    │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ quantification                  │ False                          │                                          │                                │ FitSingleScanMultiDetector │    1 │ Fit: 1 scan, N det │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ energy_multiplier               │ None                           │                                          │                                │ FitSingleScanMultiDetector │    1 │ Fit: 1 scan, N det │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ fast_fitting                    │ True                           │                                          │                                │ FitSingleScanMultiDetector │    1 │ Fit: 1 scan, N det │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ diagnostics                     │ True                           │                                          │                                │ FitSingleScanMultiDetector │    1 │ Fit: 1 scan, N det │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ figuresofmerit                  │ None                           │                                          │                                │ FitSingleScanMultiDetector │    1 │ Fit: 1 scan, N det │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ output_root_group               │ None                           │ Optional group underneath                │                                │ SumXrfResults              │    2 │ Sum Fit Results    │
│                                 │                                │ ``output_root_uri``.                     │                                │                            │      │                    │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ detector_normalization_template │ '<instrument/fscan_parameters/ │ Expression to evaluate and multiply each │                                │ SumXrfResults              │    2 │ Sum Fit Results    │
│                                 │ fast_step_time>/<instrument/{} │ spectrum with before summing. HDF5 URI's │                                │                            │      │                    │
│                                 │ /live_time>'                   │ <...> are relative to                    │                                │                            │      │                    │
│                                 │                                │ ``bliss_scan_uris``.                     │                                │                            │      │                    │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ output_root_group               │ None                           │ Optional group underneath                │                                │ RegridXrfResults           │    3 │ Regrid             │
│                                 │                                │ ``output_root_uri``.                     │                                │                            │      │                    │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ positioners                     │ None                           │                                          │                                │ RegridXrfResults           │    3 │ Regrid             │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ positioner_uri_template         │ 'measurement/{}'               │                                          │                                │ RegridXrfResults           │    3 │ Regrid             │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ ignore_positioners              │ []                             │                                          │                                │ RegridXrfResults           │    3 │ Regrid             │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ interpolate                     │ 'nearest'                      │                                          │                                │ RegridXrfResults           │    3 │ Regrid             │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ resolution                      │ None                           │                                          │                                │ RegridXrfResults           │    3 │ Regrid             │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ axes_units                      │ {'samy': 'mm', 'samz': 'mm',   │ Axes units to be used when missing.      │ • {'nsy': 'mm', 'nsz': 'mm',   │ RegridXrfResults           │    3 │ Regrid             │
│                                 │ 'sampy': 'um', 'sampz': 'um'}  │                                          │   'nspy': 'um', 'nspz': 'um'}  │                            │      │                    │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ output_root_group               │ None                           │ Optional group underneath                │                                │ NormalizeXrfResults        │    4 │ Normalize          │
│                                 │                                │ ``output_root_uri``.                     │                                │                            │      │                    │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ normalization_expression        │ None                           │ Arithmetic expression to be used for     │                                │ NormalizeXrfResults        │    4 │ Normalize          │
│                                 │                                │ normalization.                           │                                │                            │      │                    │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ counter_normalization_template  │ 'np.nanmean(<instrument/{}/dat │ Arithmetic expression to be used for     │                                │ NormalizeXrfResults        │    4 │ Normalize          │
│                                 │ a>)/<instrument/{}/data>'      │ normalization. HDF5 URI's <...> are      │                                │                            │      │                    │
│                                 │                                │ relative to ``bliss_scan_uris``.         │                                │                            │      │                    │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ counter_name                    │ 'If'                           │ To be used in                            │                                │ NormalizeXrfResults        │    4 │ Normalize          │
│                                 │                                │ ``counter_normalization_template``.      │                                │                            │      │                    │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ detector_normalization_template │ '1./<instrument/{}/live_time>' │ Arithmetic expression to be used for     │                                │ NormalizeXrfResults        │    4 │ Normalize          │
│                                 │                                │ normalization. HDF5 URI's <...> are      │                                │                            │      │                    │
│                                 │                                │ relative to ``bliss_scan_uris``.         │                                │                            │      │                    │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ detector_name                   │ None                           │ To be used in                            │                                │ NormalizeXrfResults        │    4 │ Normalize          │
│                                 │                                │ ``detector_normalization_template``.     │                                │                            │      │                    │
├─────────────────────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────┼────────────────────────────┼──────┼────────────────────┤
│ output_root_group               │ None                           │ Optional group underneath                │                                │ ExtractRawCounters         │    5 │ Raw Counters       │
│                                 │                                │ ``output_root_uri``.                     │                                │                            │      │                    │
╘═════════════════════════════════╧════════════════════════════════╧══════════════════════════════════════════╧════════════════════════════════╧════════════════════════════╧══════╧════════════════════╛

In this case detector_normalization_template appears in SumXrfResults and NormalizeXrfResults. There will be no detector normalization in NormalizeXrfResults because it is already done in SumXrfResults. So blissoda does not feel the need to set the parameter of NormalizeXrfResults in which case it falls back to the default in the pydantic model. This will confuse users.

  • SumXrfResults: '<instrument/fscan_parameters/fast_step_time>/<instrument/{}/live_time>'
  • NormalizeXrfResults (DEFAULT): '1./<instrument/{}/live_time>'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions