vega / vega-datasets

Common repository for example datasets used by Vega-related projects
264 stars 209 forks source link

docs: add source for budget.json and validation script #581

Closed dsmedia closed 3 months ago

dsmedia commented 3 months ago

Partially addresses #15

Changes made:

  1. Adds source information for budgets.json to SOURCES.md
  2. Creats a new script validate_budget_data.py in the scripts directory to validate the budget data against the original source
domoritz commented 3 months ago

Rather than validating, should the script just generate the file? We can always check that the diff is empty in git. It would be more similar to the other scripts.

We could also run the script as part of the workflows if we want to have tests.

domoritz commented 3 months ago

What changed about the dataset? I'm asking since it affects what version bump this implies.

dsmedia commented 3 months ago

What changed about the dataset? I'm asking since it affects what version bump this implies.

The original and script-generated budget.json files are identical in content, but differ in formatting: the original file has no space after the colons separating keys and values, while the script in my prior commit generated a json with a space after each colon. In this new commit, I've updated the script to generate a JSON formatted like the original.

Timeline of changes:

  1. Original state: budget.json had no spaces after colons separating keys and values.
  2. First commit:
    • Updated budget.py to generate JSON using default formatting of including spaces after colons.
    • Included the newly generated budget.json (identical content, different formatting).
  3. Latest commit:
    • Updated budget.py to generate JSON without spaces after colons (matching original format).
    • Updated budget.json to match the original formatting.
domoritz commented 3 months ago

Having a space after the : is actually nice and a good practice. We can change the format without bumping the minor version. It's nice to see that the diff is empty after the format change. Let's undo 6615d79 and merge. Thank you!

domoritz commented 3 months ago

Thank you