mesa-examples icon indicating copy to clipboard operation
mesa-examples copied to clipboard

CI: Add metadata.toml validation workflow (implements #3272)

Open Vanya-kapoor opened this issue 8 months ago • 2 comments

Summary

Adds automated CI validation for metadata.toml files in all examples, as discussed in #3272.

Changes

  • .github/workflows/validate_metadata.yml: GitHub Actions workflow that runs on every PR touching metadata files
  • scripts/validate_metadata.py: Validation script that checks:
    • All required fields are present
    • space is one of: Grid, Network, Continuous, None
    • time is one of: Discrete, Continuous
    • complexity is one of: Basic, Advanced
    • Valid TOML syntax

Why

As raised in #3272 without validation, metadata can silently drift from the agreed standard as new examples are added. This ensures every PR with a metadata.toml is automatically checked.

Related

  • Implements schema validation proposed by @areyoush and @ShreyasN707 in #3272 #313
  • Works alongside the metadata.toml additions in my PR

Vanya-kapoor avatar Mar 21 '26 07:03 Vanya-kapoor

See my comment in #423

codebreaker32 avatar Mar 21 '26 09:03 codebreaker32

Hi @Vanya-kapoor! Great work on this. Implementing the CI validation for metadata.toml is going to be incredibly helpful for standardizing the repo, especially with all the discussions happening around #3272! The field validation logic (checking ALLOWED_SPACE, ALLOWED_COMPLEXITY, etc.) looks really clean.

However, I noticed there are some unrelated changes mixed into this PR. Starting around line 590, there are modifications to the ForestFire model's batch_run and plotting logic (plt.scatter(df["density"], df["Burned Out"])).

According to the Mesa Examples peer-review guidelines (#390), PRs should contain "no unrelated changes." > Suggestion: I highly recommend splitting this into two separate PRs ,one dedicated strictly to the CI metadata validation, and another for your ForestFire data collection updates. That will make it much easier and faster for the maintainers to approve and merge the CI workflow!

Let me know when you update it and I'll gladly re-review.

Ishwarpatra avatar Mar 22 '26 11:03 Ishwarpatra