Skip to content
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

Itm 482 json to yaml #31

Merged
merged 13 commits into from
Jul 3, 2024
Merged

Itm 482 json to yaml #31

merged 13 commits into from
Jul 3, 2024

Conversation

kaitlyn-sharo
Copy link
Contributor

@kaitlyn-sharo kaitlyn-sharo commented Jul 1, 2024

To test, move some of the freeform jsons from the sim into this directory, specifically Desert.json, Urban.json, Submarine.json, and Jungle.json. Run python3 freeform_json_to_yaml.py -i [INPUT_FILE] -o [OUTPUT_PATH], and then run the validator on that output file (of course, check it over manually too). As an additional check, see how the output compares to the freeform yamls that Darren manually generated (see the server repo for files like metrics-adept-eval-freeform-desert.yaml).

Currently, this will only work on freeform scenarios in one of the 4 main environments.

To test the main unstructured data, add a narrativeSection element with additionalInfo to one of the jsons before running. The unstructured state data should copy the first additionalInfo found in the narrativeSection array. Otherwise, it will be "TODO" to tell the user to manually update it once the file is generated.

Also includes a minor validator bug fix.

Copy link
Contributor

@nextcen-dgemoets nextcen-dgemoets left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really great work as usual, Obi-wan.

I think if there is no bloodPool in the sim, then there should be no severity in the YAML. Thoughts?

In the submarine file, for Richard it generated an unstructured of

"Male, about 56 years old, in a sittingGround position.  andHas
        several puncture injuries."

Same for William and Christopher in the Urban file.

I also got, Has a collapse on his left chest.

A few other notes in the individual comments.

test.yaml Outdated Show resolved Hide resolved
freeform_json_to_yaml.py Show resolved Hide resolved
freeform_json_to_yaml.py Outdated Show resolved Hide resolved
freeform_json_to_yaml.py Outdated Show resolved Hide resolved
freeform_json_to_yaml.py Outdated Show resolved Hide resolved
freeform_json_to_yaml.py Outdated Show resolved Hide resolved
freeform_json_to_yaml.py Outdated Show resolved Hide resolved
freeform_json_to_yaml.py Outdated Show resolved Hide resolved
freeform_json_to_yaml.py Outdated Show resolved Hide resolved
freeform_json_to_yaml.py Show resolved Hide resolved
Copy link
Contributor

@nextcen-dgemoets nextcen-dgemoets left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of great changes. A few more comments below.

freeform_json_to_yaml.py Show resolved Hide resolved
freeform_json_to_yaml.py Outdated Show resolved Hide resolved
freeform_json_to_yaml.py Show resolved Hide resolved
freeform_json_to_yaml.py Outdated Show resolved Hide resolved
freeform_json_to_yaml.py Outdated Show resolved Hide resolved
freeform_json_to_yaml.py Show resolved Hide resolved
freeform_json_to_yaml.py Show resolved Hide resolved
@kaitlyn-sharo kaitlyn-sharo requested a review from Anchita14 July 3, 2024 15:11
@nextcen-dgemoets nextcen-dgemoets self-requested a review July 3, 2024 17:59
Copy link
Contributor

@nextcen-dgemoets nextcen-dgemoets left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're there-- great work!

We should probably endeavor to update this as we update the validator, but that's a problem for another day.

@nextcen-dgemoets
Copy link
Contributor

Hmm, I just noticed that the generated YAML from "PI Meeting Urban.json" yields, "Scene 0 is unreachable."

@kaitlyn-sharo
Copy link
Contributor Author

kaitlyn-sharo commented Jul 3, 2024

Hmm, I just noticed that the generated YAML from "PI Meeting Urban.json" yields, "Scene 0 is unreachable."

It looks like all of them do. I wonder if there's only one scene if branches don't get created. That would be a problem with the other branch, not this one

@nextcen-dgemoets
Copy link
Contributor

Hmm, I just noticed that the generated YAML from "PI Meeting Urban.json" yields, "Scene 0 is unreachable."

It looks like all of them do. I wonder if there's only one scene if branches don't get created. That would be a problem with the other branch, not this one

Oh you're right-- good. On my machine, there's a little pause before it emitted the unreachable warning, and I guess I missed it (purple on black). Okay, then it's not a question for this ticket, but could be something we look at in the validator.

@kaitlyn-sharo
Copy link
Contributor Author

Hmm, I just noticed that the generated YAML from "PI Meeting Urban.json" yields, "Scene 0 is unreachable."

It looks like all of them do. I wonder if there's only one scene if branches don't get created. That would be a problem with the other branch, not this one

Oh you're right-- good. On my machine, there's a little pause before it emitted the unreachable warning, and I guess I missed it (purple on black). Okay, then it's not a question for this ticket, but could be something we look at in the validator.

Just pushed the validator fix to the other branch

@kaitlyn-sharo kaitlyn-sharo merged commit 5e350e9 into main Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants