Skip to content

Refactor Microgrid Examples to Facilitate Code Reuse - #551

Merged
nkoukpaizan merged 12 commits into
developfrom
abdou/microgrid_refactor
Sep 1, 2026
Merged

Refactor Microgrid Examples to Facilitate Code Reuse#551
nkoukpaizan merged 12 commits into
developfrom
abdou/microgrid_refactor

Conversation

@abdourahmanbarry

@abdourahmanbarry abdourahmanbarry commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Description

In this pull request, we separated the construction of the microgrid network from the examples to improve code reuse.

This is the first of four stacked pull requests that split PR #492 into smaller, more manageable chunks.

Proposed changes

Two functions, buildScaleMicrogridNetwork and assembleSystem, were introduced to build the microgrid network and add the components of the network to SystemPowerElectronicsModel, respectively. These functions are then used to replace the network construction and the system model assembly code in all examples. This helps facilitate code reuse as more examples rely on this model.

Checklist

  • All tests pass.
  • Code compiles cleanly with flags -Wall -Wpedantic -Wconversion -Wextra.
  • The new code follows GridKit™ style guidelines.
  • There are unit tests for the new code.
  • The new code is documented.
  • The feature branch is rebased with respect to the target branch.
  • The CHANGELOG.md has been updated to reflect the changes. If this is a minor PR that is part of a larger fix already included in the file, state so.

@abdourahmanbarry abdourahmanbarry self-assigned this Aug 26, 2026
@abdourahmanbarry abdourahmanbarry changed the title Abdou/microgrid refactor Refactor Microgrid Examples to Facilitate Code Reuse Aug 26, 2026
Comment thread examples/PowerElectronics/Microgrid/Microgrid.cpp Outdated
Comment thread examples/PowerElectronics/PowerElectronicsExamplesHelper/MicrogridNetwork.hpp Outdated
Comment thread examples/PowerElectronics/PowerElectronicsExamplesHelper/MicrogridNetwork.hpp Outdated
Comment thread examples/PowerElectronics/ExamplesHelper/MicrogridNetwork.hpp
Comment thread examples/PowerElectronics/PowerElectronicsExamplesHelper/MicrogridNetwork.hpp Outdated
Comment thread examples/PowerElectronics/ScaleMicrogrid/CMakeLists.txt Outdated
@abdourahmanbarry
abdourahmanbarry force-pushed the abdou/microgrid_refactor branch 2 times, most recently from 8b19f1b to 44e9da0 Compare August 28, 2026 19:19
Comment thread examples/PowerElectronics/ScaleMicrogrid/ScaleMicrogrid.cpp Outdated
Comment thread examples/PowerElectronics/ExamplesHelper/CMakeLists.txt
Comment thread examples/PowerElectronics/ScaleMicrogrid/CMakeLists.txt Outdated
Comment thread examples/PowerElectronics/ScaleMicrogrid/CMakeLists.txt
@abdourahmanbarry
abdourahmanbarry force-pushed the abdou/microgrid_refactor branch from 2fe4b2e to c8e99a3 Compare August 31, 2026 14:22
Comment thread examples/PowerElectronics/ExamplesHelper/SystemAssembler.hpp Outdated
@nkoukpaizan
nkoukpaizan dismissed alexander-novo’s stale review September 1, 2026 15:26

I believe all review comments and suggestions have been addressed.

@nkoukpaizan
nkoukpaizan disabled auto-merge September 1, 2026 15:29
@nkoukpaizan
nkoukpaizan merged commit af5a66c into develop Sep 1, 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.

3 participants