-
Notifications
You must be signed in to change notification settings - Fork 4
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
Gromet Wiring Detector PR #732
Conversation
…ted json_to_gromet for new metadata
@titomeister - You mentioned Metadata types that don't have an is_metadatum field. These should be handled by these lines skema/skema/program_analysis/JSON2GroMEt/json2gromet.py Lines 52 to 68 in d5f4c61
. If this no longer works though let me know and we can figure something else out. |
@vincentraymond-ua So the issue I was running into is that the code would break on the if-else statement that is directly before this chunk of code. skema/skema/program_analysis/JSON2GroMEt/json2gromet.py Lines 47 to 50 in d5f4c61
Currently there is temporary handling for the metadata types that don't have an is_metadatum field, but I know there's something better. Whether that involves just adding the is_metadatum field to those metadata types or something else. The current handling can be seen here skema/skema/program_analysis/JSON2GroMEt/json2gromet.py Lines 35 to 38 in d5f4c61
Basically, the metadata types that don't have an is_metadatum field get added to the gromet map on line 38. I figured that is okay for the moment, since I believe those metadata types don't appear in the GroMEt JSON at all. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@titomeister - Looks good! Eventually it would be nice to integrate with Justin's fn_preprocessor so that this shows up in the model coverage reports as well.
This PR adds a new script `skema/program_analysis/gromet_wire_diagnosis.py` that can be used to do some simple analysis and error detecting in the wires of GroMEt FNs. It currently checks the ports of all types of wires, and detects whether the ports are out of bounds (in either negative or positive indices) within their respective port tables. It also attempts to find the most relevant SourceCodeReference metadata that is associated with the wires and displays the line number information contained within it. ## Summary of Changes - Adds `skema/program_analysis/gromet_wire_diagnosis.py` script - Modifies `skema/program_analysis/JSON2GroMEt/json2gromet.py` script so that it can ingest newer GroMEt JSON that uses the updated Gromet metadata fields. - Fixes a small issue with the incorrect SourceCodeReference metadata type being used in `skema/program_analysis/CAST2FN/ann_cast/to_gromet_pass.py` - Adds a test script `skema/program_analysis/tests/test_wiring_diagnosis.py` that can test the consistency of the individual wire checker utility without needing a GroMEt JSON. ### Potential Next steps - Need to determine more things that can be easily analyzed in a GroMEt JSON - Come up with a more robust way of determining what line numbers go with the wires. - Determine what to do with the Metadata fields that don't have an "is_metadatum" field attached to them. (NOTE: A solution to this has been currently proposed.) Resolves #697 --------- Co-authored-by: Vincent Raymond <[email protected]> 97f7e50
This PR adds a new script
skema/program_analysis/gromet_wire_diagnosis.py
that can be used to do some simple analysis and error detecting in the wires of GroMEt FNs. It currently checks the ports of all types of wires, and detects whether the ports are out of bounds (in either negative or positive indices) within their respective port tables. It also attempts to find the most relevant SourceCodeReference metadata that is associated with the wires and displays the line number information contained within it.Summary of Changes
skema/program_analysis/gromet_wire_diagnosis.py
scriptskema/program_analysis/JSON2GroMEt/json2gromet.py
script so that it can ingest newer GroMEt JSON that uses the updated Gromet metadata fields.skema/program_analysis/CAST2FN/ann_cast/to_gromet_pass.py
skema/program_analysis/tests/test_wiring_diagnosis.py
that can test the consistency of the individual wire checker utility without needing a GroMEt JSON.Potential Next steps
Resolves #697