Logging message enhancement
- Skip InitChecker logging and limiter adjust for offline devices.
- When reading files, issue a warning only once per model for the following cases: 1) a NumParam value does not meet the expected criteria, or 2) unused data is detected.
I'm not sure why it's better to show the warning message only once for nonconforming inputs.
In the input stage, when we add one device, GEN 1 with inertia H = 0, for example, this should trigger one message so that the user will be able to identify and fix it.
When the second device GEN 2 with H = 0 is added, shouldn't this message be displayed again?
A useful enhancement would be to show which device violated the property constraint. I didn't do it, because in order to do it, one parameter needs to access its owner and then access the idx field, which looked messy to me. Maybe we can revisit it.
I add a notebook to explain this, https://github.com/CURENT/demo/blob/master/demo/logging/logging.ipynb:
- Property violation and auto correction is triggered ONLY in file loading stage, for PSS/E and JSON files.
- Property violation and auto correction is not triggered for XLSX file.
It seems that when add a model manually after file loading, the property violation is not triggered.
Indeed this is a very marginal feature, but I can handle this if helpful "which device violated the property constraint"
In this example, in Input 8, I think a warning is desired, because it will immediately alert the user to input issues. Suppressing the message creates the possibility of omission. There should be a warning to each violation, although I agree the information should be more rich. Regards, Hantao Cui
On Thu, May 1, 2025, 11:06 PM Jinning Wang @.***> wrote:
jinningwang left a comment (CURENT/andes#606) https://github.com/CURENT/andes/pull/606#issuecomment-2846214936
I add a notebook to explain this, https://github.com/CURENT/demo/blob/master/demo/logging/logging.ipynb:
- Property violation and auto correction is triggered ONLY in file loading stage, for PSS/E and JSON files.
- Property violation and auto correction is not triggered for XLSX file.
It seems that when add a model manually after file loading, the property violation is not triggered.
Indeed this is a very marginal feature, but I can handle this if helpful "which device violated the property constraint"
— Reply to this email directly, view it on GitHub https://github.com/CURENT/andes/pull/606#issuecomment-2846214936, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSNZA65JPFJOADPJNZF6NL24LOKRAVCNFSM6AAAAAB4AX3NL6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQNBWGIYTIOJTGY . You are receiving this because you commented.Message ID: @.***>
Thank you for your comment. I agree with your opinion and plan to implement the following enhancements:
- Individual Check by Default: This will perform a check on a single device input by default. When reading from a file, this will be turned off, and a model-level check will be conducted instead. Additionally, when users add new devices one by one, this check should be triggered automatically when calling
NumParam.add - Model-Level Check: This will perform a check on all devices within a model, identifying which devices have violations and providing the idxes. This one should be triggered automatically after adding all devices from case file.
Change 1 involves System.add, ModelData.add, and NumParam.add
Change 2 involves the three file parsing modules.
Let me know if I miss anything.
When reading from a file, this will be turned off, and a model-level check will be conducted instead
Turning off the warning is not a great idea because some warnings are due to user omissions that need attention. The proposed change falls under the category of "fail silently" and is generally advised against. If the goal is to make the program less verbose, we can store all the warning messages somewhere and output a message at the end like this:
```There are warnings during the data parsing. To see all the warnings, do system.show_warnings()
(you can decide where to place the function.)
In that output, then provide more information regarding which parameter of which device trigger the warning, and the exact reason.
Let me know if this makes sense and if you'd like to proceed.
Agree with you, but we might skip this feature for now.
Now in this PR I only skip the InitChecker logging and limiter adjust for offline devices.