Skip to content

Use Pydantic to manage parameter metadata and validation#258

Merged
FlxPo merged 4 commits intomainfrom
parameters
Jan 27, 2026
Merged

Use Pydantic to manage parameter metadata and validation#258
FlxPo merged 4 commits intomainfrom
parameters

Conversation

@FlxPo
Copy link
Contributor

@FlxPo FlxPo commented Jan 27, 2026

Pydantic models seem to be a good fit for our needs :

  • Works just like the previous dataclasses for the users (ie PopulationTripsParameters(seed=0).
  • Handles default values and let us track what the user changed or leaved as default.
  • A lot of available metadata fields to document parameters.
  • Automatic validation for different situations (float in an one sided / two sided interval, set of str values...).
  • Easy export to a serializable dict so can be hashed by the Asset class.

@FlxPo FlxPo requested a review from Mind-the-Cap January 27, 2026 10:14
@codecov
Copy link

codecov bot commented Jan 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.42%. Comparing base (c8c3ac3) to head (1278b7f).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #258   +/-   ##
=======================================
  Coverage   70.42%   70.42%           
=======================================
  Files          56       56           
  Lines        2424     2424           
=======================================
  Hits         1707     1707           
  Misses        717      717           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@Mind-the-Cap Mind-the-Cap left a comment

Choose a reason for hiding this comment

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

Agreed with Pydantic use!

@FlxPo FlxPo merged commit f6f124e into main Jan 27, 2026
4 checks passed
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.

2 participants