Node injection sensor deprecation: future behavior if experimental#1434
Open
mgovers wants to merge 1 commit into
Open
Node injection sensor deprecation: future behavior if experimental#1434mgovers wants to merge 1 commit into
mgovers wants to merge 1 commit into
Conversation
Signed-off-by: Martijn Govers <martijn.govers@alliander.com>
|
figueroa1395
left a comment
Member
There was a problem hiding this comment.
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}; |
Member
There was a problem hiding this comment.
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(); }) { |
Member
There was a problem hiding this comment.
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?
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.



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.