Skip to content

Set default pv values for scanning, filename, and filepath setup + Workbench 3d loading fix#78

Merged
Osayi-ANL merged 4 commits into
mainfrom
dev
May 22, 2026
Merged

Set default pv values for scanning, filename, and filepath setup + Workbench 3d loading fix#78
Osayi-ANL merged 4 commits into
mainfrom
dev

Conversation

@Osayi-ANL
Copy link
Copy Markdown
Collaborator

@Osayi-ANL Osayi-ANL commented May 21, 2026

  • ScanOn:Value, FilePath:Value, FileName:Value are hardcoded in settings.py -- No longer need to use
  • IOC PREFIX prefix's ScanOn:Value, FilePath:Value, FileName:Value
  • HDF5 saves POSITION back into h5 file
  • Workbench 3D view loads dataset -- no error

Test Plan

  • If present in config, remove ScanOn:Value, FilePath:Value, FileName:Value from METADATA.CA and run the metadata associator and do a scan -- still works
  • Start and stop a scan. Check the saved h5 file structure and see that POSITION is now under the HKL tree section
  • Open workbench, go to 3D View and load dataset -- no error

Osayi-ANL added 2 commits May 21, 2026 11:19
remove: SCAN_FLAG_PV from being used, already using SCAN_FLAG
fix: pvareader to use app_settings.SCAN_FLAG
@Osayi-ANL Osayi-ANL requested a review from pecomyint May 21, 2026 17:13
Copy link
Copy Markdown
Collaborator

@pecomyint pecomyint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's good:

  • IOC_PREFIX concept is architecturally sound and the EPICS naming is correct
  • Fallback hierarchy (explicit config → IOC_PREFIX + suffix → bare suffix) is clean
  • POSITION simplification in hdf5_writer is reasonable (needs testing)

What needs fixing before merge:

  1. Wire up the consumers — pva_reader.py:665-666 and scan_view.py:428-429, 452-453 still read FILE_PATH/FILE_NAME from METADATA_CA dict. They need to switch to app_settings. FILE_PATH / app_settings.FILE_NAME, otherwise removing those keys from TOML breaks file location silently.
  2. Remove duplicate import — import dashpva.settings (line 17 of hdf5_writer.py) is unused.
  3. Fix import ordering — run ruff check --fix on the 3 changed files.
  4. Clean up dead motor_pos_values — lines 201-207 in hdf5_writer.py build a dict that nothing uses anymore.
  5. Consider renaming FILE_PATH / FILE_NAME → FILE_PATH_PV / FILE_NAME_PV to avoid ambiguity with filesystem paths.

…app_settings, to stop pulling from METADATA_CA dict

remove: unused `import dashpva.settings` in hdf5_writer, to drop duplicate import
fix: import ordering across 3 changed files w/ ruff, to satisfy lint
remove: dead motor_pos_values dict in hdf5_writer, to drop unused code
rename: FILE_PATH/FILE_NAME → FILE_PATH_PV/FILE_NAME_PV
change: METADATA.CA to commented placeholders in all configs
add: ROI/STATS to DEFAULT_PROFILE_DATA seed and TOMLs that lost them, to restore canonical sections
add: IOC_PREFIX to aps_9id_eiger16m and aps_9id_pilatus, to align with other configs
fix: HKL 'detector:' placeholders to 'ioc:' in sample_config and seed defaults so the's no confusion with prefixes
remove: # NAME / # SPEC_MOTOR_NAME comments from aps_8id_eiger4m, to clean up dead lines
@Osayi-ANL Osayi-ANL requested a review from pecomyint May 22, 2026 17:18
@Osayi-ANL
Copy link
Copy Markdown
Collaborator Author

  • Cleaned up toml files

Copy link
Copy Markdown
Collaborator

@pecomyint pecomyint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ready merge. Some minor non-blocking suggestions to do before merging

  1. seed_profile_defaults_sql.py:222 — json.dumps(DEFAULT_PROFILE_DATA) uses the module-level dict directly instead of get_default_profile_data() (the deep-copy wrapper defined on the same file). Not a bug since json.dumps is read-only, but inconsistent with the file's own API.

  2. Typos propagated from original TOML: INPLANE_REFERENCE_DIRECITON and SAMPLE_SURFACE_NORMAL_DIRECITON in DEFAULT_PROFILE_DATA — pre-existing typos from sample_config.toml, not introduced by this PR.
    *** DIRECITON → DIRECTION (the T and I are swapped).

  3. config_section inconsistency: test helper _insert_profile uses '' (empty string) while seed_profile_defaults uses NULL for the same field. Doesn't affect reads since queries filter on config_type + config_key only.

fix: test_seed_defaults.py insert NULL instead of empty str
@Osayi-ANL Osayi-ANL merged commit 44ba9fe into main May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants