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
Make mapper aliases configurable #175
Conversation
8edf5b9
to
ca5cc94
Compare
Codecov Report
@@ Coverage Diff @@
## master #175 +/- ##
==========================================
+ Coverage 86.24% 86.31% +0.07%
==========================================
Files 40 40
Lines 1868 1878 +10
==========================================
+ Hits 1611 1621 +10
Misses 257 257
Continue to review full report at Codecov.
|
I must admit, I thought the point was that one implemented their own Note, I am not against this at all, I am only confused as to what the desired design goals are at the moment of this package/repository. What its prioritized purpose is (e.g., first and foremost a source for the models and filter grammar, then to be used to implement an index meta-database, then for a full implementation, etc.) |
Absolutely, but the point should still be to make everything as reusable as possible. I know it's trivial to implement a structure mapper without aliases, but it's even more trivial to, er, not have to in the default case.
I agree with this ranking of the goals but I don't see this minor goal impeding on the rest. I would argue the aliases here are a special case where your fields perfectly align with the OPTiMaDe fields, asdie from their field names. I think a much more likely use case would be someone spinning up a new database for sharing results using the OPTiMaDe models from the get-go. |
2f420fa
to
87e5fdd
Compare
For sure. And agreed.
Perhaps. And I definitely don't see it impeding either. |
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.
Looks good.
I've suggested some minor code optimizations in config.py
.
31ecf76
to
def3dbb
Compare
Co-authored-by: Casper Welzel Andersen <casper.andersen@epfl.ch>
def3dbb
to
d1f0ab7
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.
LGTM, thanks @ml-evs
Bump to v0.5.0 Changes: - Possibility for Docker deployment for both the index meta-database server as well as the regular server (#140, @ltalirz, @CasperWA) - Test building and starting Docker images with GitHub Actions CI (#140, @CasperWA, @ml-evs, @ltalirz) - Remove `/index` from the index meta-database's base URL (#140, @ltalirz, @CasperWA) - `include` query parameter (#163, @CasperWA) - Rename `optimade/server/deps.py` to `optimade/server/query_params.py` (#163, @CasperWA) - Human-readable landing page for versioned base URLs, as well as for `/optimade` (#172, @ml-evs) - Move mapper aliases to config file and out of mapper classes (#175, @ml-evs) Bug fixes: - Properly build versioned base URLs (#178, @CasperWA)
This PR removes the default StructureMapper aliases and moves them to the default
config.ini
. They were previously quite annoying as you had to use these pseudo-MP field names if you didn't want to patch the our library yourself (i.e. if you were both creating and consuming your database using the optimade models).<endpoint>.aliases
sections to config file, with blank defaults, similar toprovider fields
.ResourceMapper
now pulls aliases from three places: the definedALIASES
class data, any config sectionconfig.aliases[ENDPOINT]
and the config provider fields.We should probably write some docs on how to use the aliasing features.