powsybl-core icon indicating copy to clipboard operation
powsybl-core copied to clipboard

[Network Validation] Proposition for delayed validations (use cases and specifications)

Open miovd opened this issue 3 years ago • 0 comments

  • Do you want to request a feature or report a bug? Feature

  • What is the current behavior? Strict validation is enforced:

  • at the creation of a network component (when the add method is called)
  • when a network component is updated (when a network component's setter is called)
  • What is the expected behavior? In some cases, we can have:
  • networks in a transitory state: it does not contain all the needed information for all network components at the same time (can be the case real-time asynchronous information for example)
  • slightly faulty networks (min>max, missing field that can be 0, etc)
  • incomplete networks (can be the case for state estimation for example)
  • What do we need?
  • A mechanism for at least switch checks from WARN to THROW_EXCEPTION and vice versa*
  • A method that returns a boolean to check if a network is valid or not

public class Network {
....
/**
 * Run all the checks and if one fails, returns false. If all succeed, return true.
 */
boolean isValid();
...
}
  • A method that generate a report of all issues/inconsistencies of an invalid network

public class Network {
....
/**
 * Generate logs about issues of inconsistencies of the network. If there is none, does nothing.
 */
void reportValidity();
...
}
  • A method that run all the checks of the network at once

public class Network {
....
/**
 * Throw an exception if the network is invalid
 */
void checkValidity();
...
}
  • Optional: a mechanism to do simple fixes (? to be specified)

There is also the question of if we need to allow users to create a totally custom network validation but as we do not have use case for that, we might not consider it.

  • Please tell us about your environment:

    • PowSyBl Version: 4.3.1
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, spectrum, etc)*

@mathbagu @berthaultval @marifunf Please feel free to specify your use case if my description was not precise enough.

*PR #1789 has been opened for an idea of what can be done and/or a basis for discussion for this point in particular.

Any feedback is appreciated!

miovd avatar Jul 26 '21 11:07 miovd