Skip to content

Jd/add monitored components table#1672

Merged
jd-lara merged 8 commits into
mainfrom
jd/add_monitored_components_table
May 13, 2026
Merged

Jd/add monitored components table#1672
jd-lara merged 8 commits into
mainfrom
jd/add_monitored_components_table

Conversation

@jd-lara
Copy link
Copy Markdown
Member

@jd-lara jd-lara commented May 4, 2026

Copy link
Copy Markdown
Contributor

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 adds first-class support for an Outage “monitored components” list (stored as device UUIDs), including a public API for manipulating that list, validation when attaching outages to a System, and tests to cover constructor/setter behavior and JSON round-tripping.

Changes:

  • Added monitored_components::Vector{Base.UUID} to the three built-in Outage concrete types, plus constructors that accept UUIDs or Devices.
  • Introduced and exported a public API to get/set/clear/add/remove monitored component UUIDs on outages.
  • Added runchecks-time validation in add_supplemental_attribute! to ensure referenced UUIDs resolve to Devices, and added extensive tests (including JSON round-trip).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/outages.jl Adds monitored_components storage to outage types and implements the public mutation/query API.
src/base.jl Adds runchecks-time validation for Outage.monitored_components when attaching outages as supplemental attributes.
src/PowerSystems.jl Exports the new monitored-components public API functions.
test/test_outages.jl Adds tests for monitored-components behavior (constructors, mutators, validation, and JSON round-trip).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/outages.jl Outdated
Comment thread src/outages.jl
@jd-lara
Copy link
Copy Markdown
Member Author

jd-lara commented May 5, 2026

This PR passes the tests
image

WIth the correct IS branch

@jd-lara jd-lara self-assigned this May 5, 2026
Copy link
Copy Markdown
Contributor

@daniel-thom daniel-thom left a comment

Choose a reason for hiding this comment

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

I can see why this design is a pragmatic solution. I do wonder if it would be better to extend the existing component/attribute design with the SQLite association table. We could either create a new table or add a column to the existing table to denote this new relationship.

Comment thread src/outages.jl Outdated
"""
function add_monitored_component!(value::Outage, x::Union{Base.UUID, Device})
uuid = _as_uuid(x)
if !(uuid in value.monitored_components)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How many components can be in this container? Just noting that building a system will slow down as the number of components and attributes grow because of the choice of Vector over Set.

@jd-lara jd-lara merged commit 535d3de into main May 13, 2026
7 of 10 checks passed
@jd-lara jd-lara deleted the jd/add_monitored_components_table branch May 13, 2026 06:43
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