-
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 filter examples and validate optional cases #227
Conversation
Codecov Report
@@ Coverage Diff @@
## master #227 +/- ##
==========================================
- Coverage 87.57% 87.33% -0.24%
==========================================
Files 43 43
Lines 1916 1943 +27
==========================================
+ Hits 1678 1697 +19
- Misses 238 246 +8
Continue to review full report at Codecov.
|
304241e
to
7598a8b
Compare
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.
Good work, thanks @ml-evs !
I have some minor suggested changes.
It is generally a very practical code, which is fine by me. But the amount of if-else statements is increasing rapidly, which tells me there may be a better design for the whole thing. However, this is definitely for a later point, when we're all bored and want to do something "fun" 😅
7598a8b
to
ad5c62d
Compare
Co-authored-by: Casper Welzel Andersen <[email protected]>
Co-authored-by: Casper Welzel Andersen <[email protected]>
Co-authored-by: Casper Welzel Andersen <[email protected]>
Co-authored-by: Casper Welzel Andersen <[email protected]>
bb41c65
to
6715bfc
Compare
Yes, the important thing now to consider is validating the results properly (beyond checking that the response is in the right format)... this has been useful to catch some problems with the filterparser and transformer, but it's pretty meaningless if all we're doing his querying non-existent fields! I'm not entirely sure how we should go about doing this. We could potentially just find one structure in the API and use that to construct a load of queries that should return at least that structure, and kind of trawl and validate that way. Hopefully this can be guided more by other implementations! |
True. We need more real-world implementations as testbeds.
I don't think scraping the spec further will end in a fruitful result. Rather, we should either re-use some queries/model structures from the other OPTIMADE repository tests and/or use real-world implementations and/or have the consortium come up with a list of queries/structures that can be used. The latter would also solidify this validator as the "official" OPTIMADE implementation validator to be used. I don't know if I misunderstood your comment in answering here, but I think my comments are still valid in their own right 😅 |
100% agree
It's not the point I was making, but I do agree! In order to avoid getting people to put random data into their databases so that it can be queried, my suggestion was more to find any structure in the database (i.e. /structures?page_limit=1), then perform queries that should definitely return that structure, i.e. query for its ID, query for formula, query on its relationships etc. in order to check that the underlying mechanisms are working. The spec scraping stuff is only really useful to check what the database says it has implemented, and what causes backend errors. |
We should leave this to an issue discussing the future of the validator though :) |
Ah. It would be a good check, I guess, of the I would even go so far as to say that it's the implementation's own responsibility to ensure their system works properly... However, I definitely see the benefit of having a central "official" tester to make sure it works generally as expected. |
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.
Very good.
All of the txt
files are already added to the MANIFEST in some way, right?
Yep! |
This PR completes the automation of scraping the spec for examples, since they are now all parseable as of Materials-Consortia/OPTIMADE#263. It adds the optional filters as tests in the validator that are printed with less emphasis, and do not cause the validator to return a non-zero exit code.