-
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
Moving and adding some utilities for client code #589
Conversation
Codecov Report
@@ Coverage Diff @@
## master #589 +/- ##
==========================================
+ Coverage 92.63% 93.18% +0.54%
==========================================
Files 67 61 -6
Lines 3813 3270 -543
==========================================
- Hits 3532 3047 -485
+ Misses 281 223 -58
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
c87807e
to
3ef0dd9
Compare
This is quite an old PR that I've just refreshed, I think it has some useful changes for those writing client code and does some minor decoupling from the server deps. |
3ef0dd9
to
a05cba8
Compare
- Moved get_providers and some associated utilities to new top-level optimade.utils module, pre-empting a fledgling client utils module - Added a get_child_databases_link() function - Made assigning an ObjectID to a provider optional - Allow for missing uvicorn when using logger
a05cba8
to
cc59125
Compare
I will merge this at some point this week if there are no objections, @JPBergsma @CasperWA |
The code looks good to me. I was however wondering whether it would be possible to create a test for the get_child_database_links function. |
Not trivial as I'd have to mock a server (or use a flaky existing server). Once we have client code in this repo we can consider adding a proper mock server for this, but I don't think it is worth it now, so I will merge. |
I thought it may be possible to setup a uvicorn server like we explain in the documentation. Then you could request the links from this server. |
I've just been playing around with some CLI client code, and a couple of things came up when installing this package without the server deps.
get_providers()
out to a new top-level utils module, to avoid importing router-related stuffget_child_database_links()
function for finding all dbs from a provider linkLOGGER
, just fallback the default logging formatter insteadEfforts have been made to keep the functions that were moved available from the old import locations for backwards compat.