Skip to content

Implemented unit conversion support for KeyValueStoreSolver#30

Open
tombonfert wants to merge 6 commits into
mainfrom
feature/unit_conversion
Open

Implemented unit conversion support for KeyValueStoreSolver#30
tombonfert wants to merge 6 commits into
mainfrom
feature/unit_conversion

Conversation

@tombonfert
Copy link
Copy Markdown
Collaborator

@tombonfert tombonfert commented May 21, 2026

  • Added unit_conversion_table parameter to MeasurementDBConfig and updated related methods to handle unit conversions.
  • Modified load_blob methods across various cache classes to accept uses_alias parameter for compatibility with unit conversion logic.
  • Updated SolverConfig to include unit conversion mappings and properties.
  • Introduced unit conversion tests to validate functionality and ensure correct behavior when using aliased selectors.
  • Enhanced documentation and comments for clarity on unit conversion processes.

Summary

Changes

Test Plan

  • Unit tests added/updated
  • Manual testing completed
  • Documentation updated (if applicable)

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • No new linter warnings introduced

- Added `unit_conversion_table` parameter to `MeasurementDBConfig` and updated related methods to handle unit conversions.
- Modified `load_blob` methods across various cache classes to accept `uses_alias` parameter for compatibility with unit conversion logic.
- Updated `SolverConfig` to include unit conversion mappings and properties.
- Introduced unit conversion tests to validate functionality and ensure correct behavior when using aliased selectors.
- Enhanced documentation and comments for clarity on unit conversion processes.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

❌ Patch coverage is 94.28571% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.20%. Comparing base (778ef1f) to head (4311b71).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ne/analyze/query/solvers/key_value_store_solver.py 92.72% 3 Missing and 1 partial ⚠️
src/impulse_query_engine/measurement_db.py 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #30      +/-   ##
==========================================
+ Coverage   86.03%   86.20%   +0.16%     
==========================================
  Files          52       52              
  Lines        4061     4154      +93     
  Branches      483      493      +10     
==========================================
+ Hits         3494     3581      +87     
- Misses        473      477       +4     
- Partials       94       96       +2     
Files with missing lines Coverage Δ
..._engine/analyze/metadata/time_series_expression.py 73.68% <100.00%> (ø)
..._query_engine/analyze/query/solvers/blob_solver.py 41.81% <100.00%> (ø)
...query_engine/analyze/query/solvers/delta_solver.py 73.88% <100.00%> (ø)
..._query_engine/analyze/query/solvers/empty_cache.py 88.88% <100.00%> (ø)
...query_engine/analyze/query/solvers/series_cache.py 80.00% <100.00%> (ø)
...uery_engine/analyze/query/solvers/solver_config.py 100.00% <100.00%> (ø)
src/impulse_reporting/config/config_parser.py 97.33% <100.00%> (+0.01%) ⬆️
src/impulse_reporting/core/report.py 88.73% <ø> (ø)
src/impulse_query_engine/measurement_db.py 78.66% <60.00%> (-1.34%) ⬇️
...ne/analyze/query/solvers/key_value_store_solver.py 91.91% <92.72%> (-0.03%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Added `unit_conversion_table` parameter to relevant configuration sections, detailing its role in converting time-series values during `solve()`.
- Enhanced documentation across multiple files to clarify the usage of `source_unit` and `target_unit` columns in the `channel_mapping` table.
- Updated `KeyValueStoreSolver` documentation to reflect changes in unit conversion handling and its integration with aliased selectors.
- Improved clarity on the configuration and functionality of unit conversion within the impulse framework.
…tation and code

- Introduced `JoinKey` class to define custom join keys for alias resolution between `channel_mapping` and `channel_metrics`.
- Updated `ChannelMappingConfig` to include an optional `join_keys` attribute, allowing for flexible alias-resolution configurations.
- Enhanced `SolverConfig` to support the new `ChannelMappingConfig` and its properties.
- Improved documentation to clarify the usage of `join_keys` and internal column names related to channel mapping.
- Added unit tests to validate the behavior of configurable join keys and their integration with the `KeyValueStoreSolver`.
- Removed the field validator for channel mapping coercion, simplifying the handling of `ChannelMappingConfig`.
- Updated tests to ensure compatibility with the new configuration, replacing instances of `TableConfig` with `ChannelMappingConfig` where applicable.
- Enhanced unit tests to validate the behavior of the updated channel mapping configuration and its integration with the `KeyValueStoreSolver`.
- Modified the `unit_conversion.csv` file to add an `is_base` column, indicating whether each unit is a base unit for its group.
- Updated entries for speed and rotation units to reflect their base status, enhancing clarity for unit conversion processes.
@tombonfert tombonfert marked this pull request as ready for review May 23, 2026 15:10
@tombonfert tombonfert requested a review from a team as a code owner May 23, 2026 15:10
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.

1 participant