Include pipeline settings in the NWB epochs table#2
Conversation
- Enable flattening of ezmsg Settings objects into flat key-value dictionaries for NWB metadata storage - Extend NWBSinkSettings to accept an optional settings field for embedding configuration metadata - Implement _prep_settings() and updated epoch/trial insertion logic to store flattened settings as epoch columns - Replace hardcoded column data IO configuration with dynamic iteration over all table columns for robustness
…lity - Rename settings intervals table from "settings_intervals" to "pipeline_settings" - Track component that triggered settings transition via `_settings_prev_component` - Remove "label" column; use "updated_component" instead for clarity - Add `_configure_appendable_table()` helper for consistent HDF5 data IO setup - Make close() idempotent after settings activation Add tests for: - Settings persistence on shutdown - Late-created settings materialization - Event appendability after reopen - Double-close safety - None settings serialization
…zation - Rename settings intervals terminology to "settings table" throughout (writer.py: _settings_intervals_name → _settings_table_name, _get_settings_intervals → _get_settings_table, etc.) - Improve sanitize_settings_value() to properly serialize complex types (lists, dicts) as JSON strings while preserving primitive types - Add test_setting field to NWBSinkSettings for list serialization testing - Update tests to use flatten_component_settings() and verify list/None serialization behavior
…ctures - Flatten ezmsg Settings, dataclasses, mappings, and sequences into NWB-compatible dotted key/value pairs - Sanitize settings values to preserve arrays, NumPy types, enums, paths, and sets where possible - Rename settings methods: initialize_settings_state → initialize_settings, update_settings_state → update_settings - Add settings table schema validation and improved column configuration for appendable tables - Improve docstrings and inline comments for NWB file preparation and flushing logic - Add tests for dataclass flattening, edge case sanitization, and list settings updates
- Add shape detection methods for settings columns - Add _rotate_file() to consolidate rotation logic - Trigger rotation in _apply_settings_update() on shape mismatch - Update _copy_nwb() to accept settings state params - Add tests for list, scalar, and rank change scenarios
|
Recent commits refactor NWB settings logging to use upcoming ezmsg built-in features to query graph settings (see ezmsg core PR #234). This expands support for settings logging to include all settings included in the running pipeline. This is accomplished by the Note that settings logging is attempted by default. If it fails, it reports a warning that settings logging cannot proceed, then continues with standard NWB file storage (without logging settings). Remaining to-dos prior to marking this PR as ready for review:
|
This PR adds a feature to store pipeline settings into the NWB epochs table. If the
pipeline_settingssetting in theNWBSinkSettingsclass is set to anez.Settingsinstance, it will create a flattened dictionary of the configurable settings in the instance and automatically add them to the epochs table each time a new entry is added.I thought this would be the most convenient way to store the settings, since
get_epoch()[setting](pseudocode) from the NWB file seems like a pretty easy interface. Definitely open to feedback on that though, as the settings can be added to the NWB file in a number of ways.Quick pipeline to test with an Orion source: