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

Support Interval type and check compatibility with pydantic #922

Merged
merged 1 commit into from
Aug 6, 2023

Conversation

HDembinski
Copy link
Member

This adds support for the Interval annotation type that is in the package annotated_types and pydantic, which was previously missing. It also adds tests for float annotations from annotated_types and pydantic, to check that they are correctly handled by util.describe

@HDembinski
Copy link
Member Author

@matthewfeickert I requested a review from you, because Github suggested it. Maybe it knows that you have been dealing with pydantic or Annotated types?

@matthewfeickert
Copy link
Member

matthewfeickert commented Aug 4, 2023

I requested a review from you, because Github suggested it. Maybe it knows that you have been dealing with pydantic or Annotated types?

Thanks @HDembinski. Perhaps GitHub knows from my browsing that I want to get more into Pydantic, but I must admit that I really have zero experience with it so far and so don't think I can give you any useful review.

If you do want someone with lots of Pydantic experience I would suggest adonath (who I think you know?) and gave a great Pydantic tutorial at SciPy 2023.

@HDembinski
Copy link
Member Author

@adonath If you have the time, it would be great if you had a look over how iminuit is starting to support restricted float type from pydantic and annotated_types. The idea is to use them to declare limits on model parameters when specifying the model, instead of setting those limits when calling Minuit.

@HDembinski
Copy link
Member Author

I am going to merge now, since it is not a controversal addition to the functionality that was already there.

@HDembinski HDembinski merged commit 41de6ea into develop Aug 6, 2023
5 checks passed
@HDembinski HDembinski deleted the support_pydantic branch August 6, 2023 12:06
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