-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] European Merging Function tutorial in pypowsybl #418
Comments
Thanks for this first draft!
|
@annetill Yes, as I began to work on a prototype I asked myself the same thing about CGMESControlAreas and I am not sure what is best. Concerning the PEVF file, do we need to provide something for the user to load it ? (ie something similar to the DataExchanges object in the tutorial ?) Or can we simply let him handle it on its own ? I don't know the PEVF format. Concerning NetworkArea and Scalable do you mean it would be a good idea to expose them in python ? My idea was simply to create them on the fly on java side in the call to build_computation_areas because they are necessary for BalanceComputationArea building, but the python user would simply retrieve handles to java BalanceComputationArea objects and not NetworkArea/Scalable. |
Any updates on this? On PEVF/CGMA files, I would recommend not to handle that part, rather take input of dict {"area_id/HVDC_id": value} Example implementation to convert IEC schedules to json -> https://github.com/Baltic-RCC/EMF/blob/286fb31bd68289d7dc4a622b95b891d36825d54d/emf/common/converters/iec_schedule_to_ndjson.py#L27 |
European Merging Function tutorial in pypowsybl
A feature : To expose what is necessary to be able to run the EMF tutorial from powsybl-tutotial in pypowsybl.
All necessary API are not exposed in pypowsybl, the following elements are missing :
All necessary API should be exposed to be able to execute the same process as in powsybl-tutorial with a more user friendly approach.
Design
BalanceComputationParameters
The implementation can rely on loadflow.Parameters and add the neccesary members :
class BalanceComputationParameters:
def __init__(self, loadflowparameters: LoadFlow.Parameters, threshold: float, maxNumberIterations: int)
BalanceComputation
In a similar way than LoadFlow class, we can have a BalanceComputation object with a run method that will take a list of BalanceComputionAreas, a merged network, and a BalanceComputationParameters and return a BalanceComputionResult object
class BalanceComputation:
def run(self, network: Network, computationAreas: List[BalanceComputationAreas], parameters: BalanceComputationParameters) -> BalanceComputationResult
BalanceComputationArea
Add a method to BalanceComputation object that will create the list of computation areas in a similar way than what is done in igmPreprocessing and prepareFictitiousArea methods in the tutorial
Need as a parameter : MergedNetwork, List of CGMESControlAreas, Dict of NetPositions (controlAreaId -> floats). This should return a list of objects wrapping a java handle (BalanceComputationArea).
class BalanceComputation:
def build_computation_areas(self, network : Network, cgmesControlAreas : list[CGMESControlAreas], netPositions :dict[String, float]) -> list[BalanceComputationArea]
In the java tutorial CGMESControlAreas are retrieved from each individual networks unmerged. To do something similar here we can add a function to the the Network class the wrap the following Java code :
CgmesControlArea controlArea = network.getExtension(CgmesControlAreas.class).getCgmesControlAreas().iterator().next();
The CgmesControlArea can be retrieved and stored on python side as a java handle directly, or in a simple object wrapping the handle.
Net positions
In the tutorial net positions seem to be retrieved from a DataExchanges object that is built from an xml files. I am not sure we need to provide a way to retrieve the net positions from a similar file here. We can simply let the user load its net positions himself ?
BalanceComputationResult
Add a simple object to store the status, iteration count, and maybe the map of areas to scaling factors as a dict ?
Merged network serialization to xml cgmes
Just add a new member function to the network class to do this ?
Process overview in pypowsybl
The text was updated successfully, but these errors were encountered: