Materials-Consortia / Materials-Consortia/optimade-python-tools

Support for enhanced list comparisons

Open
#1,467 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted transformers
Dominant language
Python
Stars
91
Forks
54
PR merge metrics
No merged PRs in 30d

Description

At some point we should try to support the grammar constructs listed in comparisons of list properties, e.g., list HAS ANY < 3, > 2.

One such correlated list query will come up in the CCPNC-DB implementation (tagging @jkshenton), where the following case might occur: if you have a flat list of chemical shifts of all species in a simulation, you will want to be able to do:

species_at_sites HAS Si:_ccpncdb_chemical_shifts HAS <= 3, >= 2

to request all Si chemical shifts between 2 and 3 inclusive. Of course it would be easier to keep the shifts in a dictionary keyed by element, at which case the query would be simplified to

_ccpnc_chemical_shifts.Si HAS <=3, >=2

but it would be great if we could support both.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the OPTIMADE specification section linked in the issue, especially the comparisons of list properties grammar. Trace the repository's query parsing entry point to determine how correlated list queries are represented. Done means supporting both the nested species_at_sites form and the dictionary-keyed chemical-shifts form shown in the examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.