Repository navigation
[Experimental] PGM CLI implementation - #1297
TonyXiang8787 wants to merge 56 commits into
Conversation
mgovers
left a comment
There was a problem hiding this comment.
i don't have time to do a full review but this is at least some input
|
|
Signed-off-by: Tony Xiang <19280867+TonyXiang8787@users.noreply.github.com>
266f4e8 to
bcedee0
Compare
Signed-off-by: Martijn Govers <martijn.govers@alliander.com>
Signed-off-by: Tony Xiang <19280867+TonyXiang8787@users.noreply.github.com>
Removed the GitHub release job from the CI workflow. Signed-off-by: Tony Xiang <19280867+TonyXiang8787@users.noreply.github.com>
Signed-off-by: Tony Xiang <19280867+TonyXiang8787@users.noreply.github.com>
Signed-off-by: Tony Xiang <19280867+TonyXiang8787@users.noreply.github.com>
Signed-off-by: Tony Xiang <19280867+TonyXiang8787@users.noreply.github.com>
Signed-off-by: Tony Xiang <19280867+TonyXiang8787@users.noreply.github.com>
0571786 to
dd4c74a
Compare
Signed-off-by: Tony Xiang <19280867+TonyXiang8787@users.noreply.github.com>
Signed-off-by: Tony Xiang <19280867+TonyXiang8787@users.noreply.github.com>
Signed-off-by: Tony Xiang <19280867+TonyXiang8787@users.noreply.github.com>
Signed-off-by: Tony Xiang <19280867+TonyXiang8787@users.noreply.github.com>
figueroa1395
left a comment
There was a problem hiding this comment.
Some initial comments/questions
Signed-off-by: Tony Xiang <19280867+TonyXiang8787@users.noreply.github.com>
Signed-off-by: Tony Xiang <19280867+TonyXiang8787@users.noreply.github.com>
Signed-off-by: Tony Xiang <19280867+TonyXiang8787@users.noreply.github.com>
Signed-off-by: Tony Xiang <19280867+TonyXiang8787@users.noreply.github.com>
Signed-off-by: Tony Xiang <19280867+TonyXiang8787@users.noreply.github.com>
Signed-off-by: Tony Xiang <19280867+TonyXiang8787@users.noreply.github.com>
Signed-off-by: Tony Xiang <19280867+TonyXiang8787@users.noreply.github.com>
Signed-off-by: Tony Xiang <19280867+TonyXiang8787@users.noreply.github.com>
figueroa1395
left a comment
There was a problem hiding this comment.
Some additional things:
- I tested the CLI locally on Mac and it works for me.
- Should we consider running the validation tests cases via the CLI in the nightly (or weekly or whatever)? Probably as a follow up if yes.
There was a problem hiding this comment.
You forgot to add cli-11 to the MacOS build guide on the package installation part.
Also, should we mention somewhere that after uv sync one can just do uv run power-grid-model -h for the CLI? Or is it obvious?
| {"minimum", PGM_short_circuit_voltage_scaling_minimum}, | ||
| {"maximum", PGM_short_circuit_voltage_scaling_maximum}, |
| app.add_option("--oc,--output-component", output_components, | ||
| "Filter output to only include specified components (can be specified multiple times)"); | ||
| std::vector<std::string> output_attributes; | ||
| app.add_option("--oa,--output-attribute", output_attributes, |
There was a problem hiding this comment.
"--oa" and "--oc" maybe a bit much?
| app.add_option("-i,--input", options.input_file, "Input file path")->required()->check(CLI::ExistingFile); | ||
| app.add_option("-b,--batch-update", options.batch_update_file, | ||
| "Batch update file path. Can be specified multiple times.\n" | ||
| "If multiple files are specified, the core will intepret them as the cartesian product of all " |
There was a problem hiding this comment.
"core" is jargon
| "If multiple files are specified, the core will intepret them as the cartesian product of all " | |
| "If multiple files are specified, it will interpret them as the cartesian product of all " |
| }, | ||
| CLI::ignore_case)); | ||
| app.add_flag("--sym,--symmetric-calculation,!--asym,!--asymmetric-calculation", options.symmetric_calculation, | ||
| "Use symmetric calculation (1) or not (0)"); |
There was a problem hiding this comment.
What does the 0 and 1 explanation mean? It's confusing.
| CLI::ignore_case)); | ||
| app.add_flag("--sym,--symmetric-calculation,!--asym,!--asymmetric-calculation", options.symmetric_calculation, | ||
| "Use symmetric calculation (1) or not (0)"); | ||
| app.add_option("--error-tolerance", options.error_tolerance, "Error tolerance for iterative calculations"); |
There was a problem hiding this comment.
Mention that the tolerance is in p.u.?
There was a problem hiding this comment.
In https://power-grid-model--1297.org.readthedocs.build/en/1297/api_reference/cli-reference.html, the numbers referring to the options aren't organized, we should probably organize them so the should like
--calculation-method ENUM:value in {default->-128,iec60909->newton_raphson->1,iterative_linear->2,iterative_current->3,,linear_current->4,iec60909->5} OR {-128,1,2,3,4,5}
instead of
--calculation-method ENUM:value in {default->-128,iec60909->5,iterative_current->3,iterative_linear->2,linear_current->4,newton_raphson->1} OR {-128,5,3,2,4,1}
This is just one example but something similar happens with most.
Signed-off-by: Tony Xiang <19280867+TonyXiang8787@users.noreply.github.com>
|





This PR attempts to implement a PGM command line interface as native executable which links to the C-API. The executable can be invoked in Python as a Python shim.
Check list
Local test guide
Test install
Run the following at any working folder
Test editable
Checkout this branch, then do a round of build and test.