Skip to content

Node injection sensor deprecation: future behavior if experimental#1434

Open
mgovers wants to merge 1 commit into
mainfrom
pgm/feature/node-injection-sensor-experimental-cpp
Open

Node injection sensor deprecation: future behavior if experimental#1434
mgovers wants to merge 1 commit into
mainfrom
pgm/feature/node-injection-sensor-experimental-cpp

Conversation

@mgovers

@mgovers mgovers commented Jun 12, 2026

Copy link
Copy Markdown
Member

Part of #1334

Add future behavior for deprecation of node injection sensor as an experimental feature.
This is a step towards introducing a feature toggle for merging nodes on links, but it does not yet introduce the feature toggle.

Signed-off-by: Martijn Govers <martijn.govers@alliander.com>
@mgovers mgovers self-assigned this Jun 12, 2026
@mgovers mgovers added the feature New feature or request label Jun 12, 2026
@sonarqubecloud

Copy link
Copy Markdown

@figueroa1395 figueroa1395 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ready to approve after small remarks are resolved.

if (std::ranges::any_of(state_.components.template citer<CT>(), [](auto const& sensor) {
return sensor.get_terminal_type() == MeasuredTerminalType::node;
})) {
throw InvalidMeasuredTerminalType{MeasuredTerminalType::node, CT::name};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's abusing the notation, but would it make sense to do something like

Suggested change
throw InvalidMeasuredTerminalType{MeasuredTerminalType::node, CT::name};
throw InvalidMeasuredTerminalType{std::format("Deprecation error: {}", MeasuredTerminalType::node), CT::name};

Just to further distinguish it a bit more without introducing anything else? Like a small convention for these rare deprecation errors.


void check_no_future_deprecations(Options const& /*options*/, ConstDataset const* /*batch_dataset*/) const {
ModelType::run_functor_with_all_component_types_return_void([this]<typename CT>() {
if constexpr (requires(CT c) { c.get_terminal_type(); }) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

At first I didn't realize how would this check distinguish flow sensors from voltage sensors and realized that get_terminal_type is only part of the former. Can you add a short comment for easy pinpoint?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants