Permutes result index order
@@ -12,7 +12,7 @@ from .definitions_schema import get_definition
from .molecule_schema import molecule_schema
from .options_schema import options_schema
-__all__ = ["get_schema", "get_indices", "get_schema_keys", "validate", "get_hash_fields"]
+__all__ = ["get_schema", "get_indices", "get_schema_keys", "validate", "get_hash_fields", "format_result_indices"]
_schemas = {}
@@ -29,7 +29,7 @@ _schemas["options"] = options_schema
_collection_indices = {
"database": ("category", "name"),
"option": ("program", "name"),
- "result": ("molecule_id", "method", "basis", "option", "program", "driver"),
+ "result": ("program", "molecule_id", "driver", "method", "basis", "option"),
"molecule": ("molecule_hash", )
}
@@ -46,6 +46,10 @@ def get_indices(name):
return _collection_indices[name]
+def format_result_indices(data):
+ return (data["molecule_id"], data["model"]["method"])
+
+
def get_schema(name):
if name not in _schemas:
raise KeyError("Schema name %s not found." % name)
