-
Notifications
You must be signed in to change notification settings - Fork 44
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
Update structure endpoint to pre-alpha 0.10 spec #45
Update structure endpoint to pre-alpha 0.10 spec #45
Conversation
@ml-evs you can now use the constrained list we've created (in utils) |
On second thought.... it might need some more work to pass in the type of elements we are validating |
I've just added the new chemical formula definitions from the recently merged Materials-Consortia/OPTIMADE#100, but there are still several fields to go.
|
Ok, that's odd - note there are two tests for it that should check at least the basic functionality.
Ok, if it works like this I guess we can live with it at the moment. |
Could you give an example of how you intend the constrained list to be defined in structures.py? The test wraps it in another class and doesn't seem to use |
The test uses Still, so far the constrained list (and the test) only checks the length of the list with no way of validating its contents. I wanted to look into this but at the moment have too many deadlines - unfortunately I don't see an example in pydantic of a constrained "container"; it's just int/str/... so one has to think Furthermore, this is only the python part: I just checked and the constraint actually is not represented in the openapi.json in any way. So, if you like, I would suggest to proceed with this PR without using the |
wait - "conlist was released today" (also @dwinston ) Ok, so it looks like this is exactly what we need.
So let's proceed as described above, and make an issue to include these constraints lateron once a compatible version of fastapi is released. |
Sure thing, didn't mean to drag you away from other work! I'm going to attack another chunk of the structure attributes now and will only request your review (and others) when it's done. Cheers @ltalirz! |
I think I've got everything in the current development spec from structure now. Happy to wait for any new changes in v0.10, or merge now. Outstanding issues:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @ml-evs !
I don't think we need to wait until 0.10 - if there are changes, they can be tackled then.
Just one minor request.
By the way, you'll need to approve as this is "my PR". |
for @ml-evs