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

troute.config: Implementation of t-route configuration file schema using pydantic #628

Merged
merged 37 commits into from
Aug 17, 2023

Conversation

aaraney
Copy link
Member

@aaraney aaraney commented Aug 3, 2023

This is my first go at implementing pydantic "data models" (often called schemas) that capture troute's configuration file. Im sure that I've missed some fields or used incorrect types / default values in several places.

closes #618

Additions

  • troute.config namespace package that capture troute's configuration file. This package provides APIs for validating and programmatically accessing troute's configuration file.

Notes

  • You may notice the version of is pinned to pydantic~=1.10. Nearly all, if not all, OWP code that uses pydantic currently pins pydantic in this way for several reasons. The first being breaking changes introduced in pydantic v2, the second relates to concerns with using pydantic >= 2 in deployment environments that don't yet support rustc. The long and short of it is, pydantic v2 was re-written with the core written in rust. Until we can verify that all deployment environments support some version of rustc, this pinning will remain.

Todos

  • Add installation guidance to readme
  • Add usage section to readme

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Code follows project standards (link if applicable)
  • Passes all existing automated tests
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future todos are captured in comments
  • Visually tested in supported browsers and devices (see checklist below 👇)
  • Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)
  • Reviewers requested with the Reviewers tool ➡️

aaraney added 3 commits August 3, 2023 15:44
This package provides pydantic data models that capture troute's
configuration file schema. This enables validating and programmatically
accessing troute config files.
@aaraney
Copy link
Member Author

aaraney commented Aug 3, 2023

@shorvath-noaa, it doesnt look like I can assign a reviewer. If you could assign one that would be great! Look forward to working through this with you all!

@shorvath-noaa shorvath-noaa self-assigned this Aug 11, 2023
@shorvath-noaa
Copy link
Contributor

@kumdonoaa @hellkite500 @aaraney I've made my updates to this PR that @aaraney started (thanks for getting the ball rolling!). Could someone give it a review? I focused on implementing this for v4, and I plan to make an additional branch/PR after this is merged to integrate this module into t-route. I'm sure there will be additional edits that need to be made once integration begins, but this seems like a good start.

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.

Implement t-route configuration file "data models" using pydantic
3 participants