Skip to content

Integrate kpi-calculator from PyPI#63

Open
jarsarasty wants to merge 1 commit intomainfrom
feature/kpi-calculator-integration
Open

Integrate kpi-calculator from PyPI#63
jarsarasty wants to merge 1 commit intomainfrom
feature/kpi-calculator-integration

Conversation

@jarsarasty
Copy link
Copy Markdown

@jarsarasty jarsarasty commented Oct 16, 2025

  • Adds kpi-calculator>=0.4.1 as a dependency
  • Uses calculate_kpis_from_simulator and build_esdl_string_with_kpis to compute KPIs and embed the results into the output ESDL string
  • Supports optional workflow config parameters: system_lifetime (years), discount_rate (%), and round_up_replacement (bool, default True for MESIDO optimizer compatibility)
  • KPI failure is non-fatal: any exception is logged and the simulation result is returned without KPIs
  • Adds an integration test

@jarsarasty jarsarasty marked this pull request as draft October 16, 2025 08:51
@jarsarasty jarsarasty marked this pull request as ready for review October 16, 2025 11:25
@jarsarasty jarsarasty force-pushed the feature/kpi-calculator-integration branch 3 times, most recently from a713153 to 685a0eb Compare January 8, 2026 12:41
@jarsarasty jarsarasty marked this pull request as draft January 9, 2026 09:16
@jarsarasty jarsarasty force-pushed the feature/kpi-calculator-integration branch 9 times, most recently from 5617f0c to 2122d49 Compare January 15, 2026 10:57
@jarsarasty jarsarasty requested a review from Copilot January 15, 2026 10:59
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@jarsarasty jarsarasty force-pushed the feature/kpi-calculator-integration branch from 2122d49 to 7ae989c Compare January 15, 2026 14:56
@jarsarasty jarsarasty marked this pull request as ready for review January 15, 2026 15:01
@jarsarasty jarsarasty marked this pull request as draft January 15, 2026 16:02
@jarsarasty jarsarasty marked this pull request as ready for review January 29, 2026 15:49
@jarsarasty jarsarasty force-pushed the feature/kpi-calculator-integration branch from 969737b to 5ee1199 Compare February 25, 2026 16:27
@jarsarasty jarsarasty force-pushed the feature/kpi-calculator-integration branch from 5ee1199 to 85a8e8c Compare March 18, 2026 11:42
@jarsarasty jarsarasty changed the title Integrate KPI calculation into simulator-worker Integrate kpi-calculator from PyPI Mar 18, 2026
@jarsarasty jarsarasty force-pushed the feature/kpi-calculator-integration branch from 85a8e8c to 6c4befb Compare March 18, 2026 11:56
@jarsarasty jarsarasty force-pushed the feature/kpi-calculator-integration branch from 6c4befb to 770dfb1 Compare March 19, 2026 16:06
@jarsarasty
Copy link
Copy Markdown
Author

This PR is now updated with the new pre-release of the KPI calculator.

@jarsarasty jarsarasty force-pushed the feature/kpi-calculator-integration branch from 770dfb1 to 3615575 Compare March 19, 2026 16:15
@jarsarasty jarsarasty force-pushed the feature/kpi-calculator-integration branch 2 times, most recently from b2d21ae to 4e5a900 Compare April 13, 2026 08:10
…imulator worker

- Bump kpi-calculator to 0.4.1
- Pass simulation results to calculate_kpis_from_simulator
- Embed KPI results in output ESDL via build_esdl_string_with_kpis
- Support optional system_lifetime, discount_rate, and round_up_replacement config params
- Add end-to-end integration test verifying CAPEX, OPEX, and energy KPIs
@jarsarasty jarsarasty force-pushed the feature/kpi-calculator-integration branch from 4e5a900 to 6c6f6e0 Compare April 13, 2026 09:23
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