Make simulation profiles pydantic models#40
Merged
Conversation
VerilatorProfile and CocotbProfile were frozen dataclasses. Convert them to frozen pydantic BaseModels so they validate on construction and expose model_validate — letting downstream packages (dau-build) validate profile mappings declaratively instead of by hand. Adds pydantic (already present transitively via csp) as an explicit dependency.
Contributor
Test Results490 tests 487 ✅ 8s ⏱️ Results for commit b82d4e3. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #40 +/- ##
==========================================
- Coverage 84.57% 84.56% -0.02%
==========================================
Files 56 56
Lines 9351 9351
Branches 1202 1202
==========================================
- Hits 7909 7908 -1
Misses 1159 1159
- Partials 283 284 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the DAU hydra/pydantic-first audit (coordination for dau-build audit #4).
VerilatorProfileandCocotbProfilewere frozen@dataclasses. Converted to frozen pydanticBaseModels so they validate on construction and exposemodel_validate— which lets downstream packages (dau-build, which parses artlink manifests into these profiles) validate profile mappings declaratively instead of by hand.Adds
pydanticas an explicit dependency (already present transitively viacsp). Construction is kwarg-based, unchanged for callers.Full dau-sim suite: 489 passed; ruff clean. dau-build's profile tests pass against the converted models.