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

low-diff-minimal-enum-descriptions #867

Closed
wants to merge 6 commits into from

Conversation

turbomam
Copy link
Member

@turbomam turbomam commented Oct 4, 2024

No description provided.

@turbomam
Copy link
Member Author

turbomam commented Oct 4, 2024

try diff assets/mixs-schema-formatting-variants/original-regenerated.yaml assets/mixs-schema-formatting-variants/mixs_with_enum_descriptions.yaml

@turbomam
Copy link
Member Author

turbomam commented Oct 4, 2024

also closes

@turbomam
Copy link
Member Author

turbomam commented Oct 8, 2024

reducing verbose collection forms and removing inferrable metaslot values:

yq eval '(.. | select(has("from_schema")) | .from_schema) style="" | del(.. | select(has("from_schema")).from_schema)' original-regenerated.yaml  |\
    yq eval '.prefixes |= map_values(.prefix_reference)' |\
    yq eval '.settings |= map_values(.setting_value)'  |\
    yq eval 'del(.classes.[].name)' |\
    yq eval 'del(.classes.[].slot_usage.[].name)'  |\
    yq eval 'del(.enums.[].name)'  |\
    yq eval 'del(.enums.[].permissible_values.[].text)' |\
    yq eval 'del(.slots.[].domain)'  |\
    yq eval 'del(.slots.[].name)' |\
    yq eval 'del(.source_file)'  |\
    yq eval 'del(.subsets.[].name)' | cat > original-regenerated-reduced.yaml

@turbomam
Copy link
Member Author

turbomam commented Oct 8, 2024

do some of these operations change the ordering within dicts or lists?

@turbomam
Copy link
Member Author

turbomam commented Oct 8, 2024

which step adds { } to keys without values? any yq step?

@turbomam
Copy link
Member Author

turbomam commented Oct 8, 2024

yamllint original-regenerated-reduced.yaml 
original-regenerated-reduced.yaml
  1:1       warning  missing document start "---"  (document-start)
  2:519     error    line too long (533 > 518 characters)  (line-length)
  3468:519  error    line too long (940 > 518 characters)  (line-length)
  3925:519  error    line too long (686 > 518 characters)  (line-length)
  4161:519  error    line too long (1423 > 518 characters)  (line-length)
  5280:519  error    line too long (1020 > 518 characters)  (line-length)
  5946:519  error    line too long (543 > 518 characters)  (line-length)
  5963:519  error    line too long (543 > 518 characters)  (line-length)
  6611:519  error    line too long (550 > 518 characters)  (line-length)
  6820:519  error    line too long (601 > 518 characters)  (line-length)
  6917:519  error    line too long (651 > 518 characters)  (line-length)
  6975:519  error    line too long (635 > 518 characters)  (line-length)
  7273:519  error    line too long (520 > 518 characters)  (line-length)
  7822:519  error    line too long (542 > 518 characters)  (line-length)
  7874:519  error    line too long (911 > 518 characters)  (line-length)
  10877:519 error    line too long (538 > 518 characters)  (line-length)
  10927:519 error    line too long (533 > 518 characters)  (line-length)
  12069:519 error    line too long (936 > 518 characters)  (line-length)
  12223:519 error    line too long (682 > 518 characters)  (line-length)
  16828:519 error    line too long (717 > 518 characters)  (line-length)

@turbomam
Copy link
Member Author

turbomam commented Oct 8, 2024

poetry run python src/scripts/describe_enums_by_slots_using.py \
    --schema-file src/mixs/schema/mixs.yaml \
    --output-file assets/mixs-schema-formatting-variants/mixs_with_enum_descriptions.yaml
gen-linkml \
    --format yaml \
    --no-mergeimports \
    --no-materialize-attributes \
    --materialize-patterns assets/mixs-schema-formatting-variants/mixs_with_enum_descriptions.yaml |\
yq eval '(.. | select(has("from_schema")) | .from_schema) style="" | del(.. | select(has("from_schema")).from_schema)' |\
    yq eval '.prefixes |= map_values(.prefix_reference)' |\
    yq eval '.settings |= map_values(.setting_value)'  |\
    yq eval 'del(.classes.[].name)' |\
    yq eval 'del(.classes.[].slot_usage.[].name)'  |\
    yq eval 'del(.enums.[].name)'  |\
    yq eval 'del(.enums.[].permissible_values.[].text)' |\
    yq eval 'del(.slots.[].domain)'  |\
    yq eval 'del(.slots.[].name)' |\
    yq eval 'del(.source_file)'  |\
    yq eval 'del(.subsets.[].name)' |\
yamlfmt -in -conf .yamlfmt  > assets/mixs-schema-formatting-variants/mixs_with_enum_descriptions_standardized.yaml
rm -rf assets/mixs-schema-formatting-variants/mixs_with_enum_descriptions.yaml

@turbomam
Copy link
Member Author

turbomam commented Oct 14, 2024

@turbomam turbomam closed this Oct 14, 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.

1 participant