Materials-Consortia / Materials-Consortia/optimade-python-tools
Add a simple way of mapping filter values as well as data values
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 91
- Forks
- 54
- PR merge metrics
- No merged PRs in 30d
Description
Currently implementations can arbitrarily map their stored data (via e.g. a custom .map_back() method for their entry mappers) such that the final output is OPTIMADE-compliant. Sometimes these tweaks can even happen in the model definitions themselves, via custom pydantic validators.
I think it would be useful to provide hooks for consistently mapping filters in the same way, to allow for simple things like unit conversions or token renaming. This will become increasingly important once more filterable properties are defined.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names custom .map_back() methods on entry mappers and custom Pydantic validators, but no files or tests. Start by locating those mapping and validation entry points, then determine how filter values currently flow through the API. Done should include a consistent filter-mapping hook supporting examples such as unit conversion or token renaming, with coverage for the chosen behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100