Integrate KPI calculation into simulator-worker#63
Open
jarsarasty wants to merge 2 commits intomainfrom
Open
Conversation
a713153 to
685a0eb
Compare
5617f0c to
2122d49
Compare
There was a problem hiding this comment.
Pull request overview
This PR integrates KPI calculation functionality into the simulator-worker by adding the kpi-calculator package from PyPI. The integration adds KPI computation to the simulation workflow while maintaining graceful error handling to ensure simulations can complete even if KPI calculation fails.
Changes:
- Added kpi-calculator>=0.1.1 dependency and updated urllib3 to 2.6.3
- Integrated KPI calculation into simulator_worker.py after simulation completion
- Added convert_simulator_to_kpi_format utility function to transform simulator output format to KPI calculator format
- Added comprehensive integration tests for KPI functionality
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Added kpi-calculator dependency and updated pytest configuration to include new test file |
| dev-requirements.txt | Updated urllib3 dependency version |
| src/simulator_worker/simulator_worker.py | Integrated KPI calculation workflow with error handling |
| src/simulator_worker/utils.py | Added utility function to convert simulator DataFrame format to KPI calculator format |
| unit_test/test_kpi_integration.py | Added comprehensive integration tests for KPI functionality |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2122d49 to
7ae989c
Compare
- Update dependency from kpi-calculator>=0.1.1 to >=0.2.0 - Use load_from_esdl_string() method for loading ESDL content from string instead of file path (new in v0.2.0)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR integrates the KPI calculator functionality into the simulator-worker using the published PyPI package.
Changes
Dependencies
kpi-calculator>=0.2.0from PyPI to pyproject.tomlKPI Integration
simulator_worker.pyload_from_esdl_string()method (new in v0.2.0) to load ESDL directly from string content without temp filesutils.pyfor converting simulator output format to KPI calculator formatTesting
test_kpi_integration.pywith integration tests. End-to-end integration test (requires InfluxDB, skipped in CI)convert_simulator_to_kpi_formatutility function