MolSSI / QCFractal

A distributed compute and database platform for quantum chemistry.
https://molssi.github.io/QCFractal/
BSD 3-Clause "New" or "Revised" License
144 stars 47 forks source link

Compute keywords have inconsistent alias case sensitvity #683

Closed jthorton closed 2 years ago

jthorton commented 2 years ago

Describe the bug Datasets store keywords under an alias which is lowered before being stored, however when adding compute tasks for a dataset and providing the original alias name you get an error as it is not lowered before being searched.

To Reproduce As we can not add compute to the public QCArchive I instead use the internal function to look for a keyword alias which as already been stored.

from qcportal import FractalClient
client = FractalClient()
ds = client.get_collection("dataset", "OpenFF Theory Benchmarking Single Point Energies v1.0")
ds._default_parameters(program="psi4", method="B3LYP-D3BJ", basis="DEF2-TZVP", keywords="B3LYP-D3BJ/DEF2-TZVP")

KeyError: "KeywordSet alias 'B3LYP-D3BJ/DEF2-TZVP' not found for program 'psi4'."

now check for the alias using lower case

ds._default_parameters(program="psi4", method="B3LYP-D3BJ", basis="DEF2-TZVP", keywords="B3LYP-D3BJ/DEF2-TZVP".lower())

('B3LYP-D3BJ/def2-tzvp-b3lyp-d3bj/def2-tzvp', {'driver': 'energy', 'program': 'psi4', 'method': 'B3LYP-D3BJ', 'basis': 'DEF2-TZVP', 'keywords': '2'}, {'driver': 'energy', 'program': 'psi4', 'method': 'B3LYP-D3BJ', 'basis': 'DEF2-TZVP', 'keywords': 'b3lyp-d3bj/def2-tzvp'})

Expected behavior The keyword alias should be lowered here when adding compute.

Additional context