Skip to content

Commit

Permalink
Reverting MPCules PR #926 (#1106)
Browse files Browse the repository at this point in the history
* Revert "Merge pull request #926 from espottesmith/query_restructure"

This reverts commit 69adac5, reversing
changes made to 7ded807.

* regenerate enums after mpcules PR revert

* [automated commit] update calc type enums

* molecules: rm StringRepQuery

---------

Co-authored-by: github-actions <[email protected]>
  • Loading branch information
tschaume and github-actions authored Sep 19, 2024
1 parent 085254c commit 1dffb90
Show file tree
Hide file tree
Showing 73 changed files with 1,520 additions and 3,595 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,6 @@ emmet/scripts/token.json

Error_Record

# Emmet autogenerated enums
# emmet autogenerated enums
# emmet-core/emmet/core/vasp/calc_types/enums.py
# emmet-core/emmet/core/qchem/calc_types/enums.py
6 changes: 2 additions & 4 deletions emmet-api/emmet/api/routes/molecules/association/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@
from emmet.api.routes.molecules.molecules.query_operators import (
FormulaQuery,
ChemsysQuery,
CompositionElementsQuery,
ElementsQuery,
ChargeSpinQuery,
DeprecationQuery,
MultiTaskIDQuery,
MultiMPculeIDQuery,
FindMoleculeQuery,
CalcMethodQuery,
HashQuery,
StringRepQuery,
)

from emmet.api.core.global_header import GlobalHeaderProcessor
Expand Down Expand Up @@ -53,12 +52,11 @@ def mol_assoc_resource(assoc_store):
MultiMPculeIDQuery(),
FormulaQuery(),
ChemsysQuery(),
CompositionElementsQuery(),
ElementsQuery(),
ChargeSpinQuery(),
MultiTaskIDQuery(),
CalcMethodQuery(),
HashQuery(),
StringRepQuery(),
DeprecationQuery(),
NumericQuery(model=MoleculeDoc),
PaginationQuery(),
Expand Down
12 changes: 6 additions & 6 deletions emmet-api/emmet/api/routes/molecules/bonds/query_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ def query(
bond_type: Optional[str] = Query(
None, description="Bond type of interest; e.g. C-O for carbon-oxygen bonds."
),
bond_length_max: Optional[float] = Query(
max_bond_length: Optional[float] = Query(
None,
description="Maximum value for the bond lengths in the molecule.",
),
bond_length_min: Optional[float] = Query(
min_bond_length: Optional[float] = Query(
None,
description="Minimum value for the bond lengths in the molecule.",
),
Expand All @@ -39,10 +39,10 @@ def query(
key: dict() # type: ignore
} # type: ignore

if bond_length_max is not None:
crit[key]["$lte"] = bond_length_max
if bond_length_min is not None:
crit[key]["$gte"] = bond_length_min
if max_bond_length is not None:
crit[key]["$lte"] = max_bond_length
if min_bond_length is not None:
crit[key]["$gte"] = min_bond_length

# If no max or min, just make sure bond type exists
if len(crit[key]) == 0:
Expand Down
4 changes: 2 additions & 2 deletions emmet-api/emmet/api/routes/molecules/bonds/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
ExactCalcMethodQuery,
FormulaQuery,
ChemsysQuery,
CompositionElementsQuery,
ElementsQuery,
ChargeSpinQuery,
)
from emmet.api.routes.molecules.utils import MethodQuery, MultiPropertyIDQuery
Expand All @@ -28,7 +28,7 @@ def bonding_resource(bonds_store):
ExactCalcMethodQuery(),
FormulaQuery(),
ChemsysQuery(),
CompositionElementsQuery(),
ElementsQuery(),
ChargeSpinQuery(),
MethodQuery(),
MultiPropertyIDQuery(),
Expand Down
110 changes: 0 additions & 110 deletions emmet-api/emmet/api/routes/molecules/electric/query_operators.py

This file was deleted.

64 changes: 0 additions & 64 deletions emmet-api/emmet/api/routes/molecules/electric/resources.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,64 +15,64 @@ def query(
None,
description="Element symbol for coordinated metal, e.g. 'Li' for lithium or 'Mg' for magnesium",
),
metal_partial_charge_min: Optional[float] = Query(
min_metal_partial_charge: Optional[float] = Query(
None, description="Minimum metal partial charge."
),
metal_partial_charge_max: Optional[float] = Query(
max_metal_partial_charge: Optional[float] = Query(
None, description="Maximum metal partial charge."
),
metal_partial_spin_min: Optional[float] = Query(
min_metal_partial_spin: Optional[float] = Query(
None,
description="Minimum metal partial spin (only meaningful for open-shell systems).",
),
metal_partial_spin_max: Optional[float] = Query(
max_metal_partial_spin: Optional[float] = Query(
None,
description="Maximum metal partial spin (only meaningful for open-shell systems).",
),
metal_assigned_charge_min: Optional[float] = Query(
min_metal_assigned_charge: Optional[float] = Query(
None,
description="Minimum charge of the metal, determined by analyzing partial charges/spins.",
),
metal_assigned_charge_max: Optional[float] = Query(
max_metal_assigned_charge: Optional[float] = Query(
None,
description="Maximum charge of the metal, determined by analyzing partial charges/spins.",
),
metal_assigned_spin_min: Optional[Union[int, float]] = Query(
min_metal_assigned_spin: Optional[Union[int, float]] = Query(
None,
description="Minimum spin multiplicity of the metal, determined by analyzing partial spins.",
),
metal_assigned_spin_max: Optional[Union[int, float]] = Query(
max_metal_assigned_spin: Optional[Union[int, float]] = Query(
None,
description="Maximum spin multiplicity of the metal, determined by analyzing partial spins.",
),
number_coordinate_bonds_min: Optional[int] = Query(
min_number_coordinate_bonds: Optional[int] = Query(
None, description="Minimum number of atoms coordinated to the metal."
),
number_coordinate_bonds_max: Optional[int] = Query(
max_number_coordinate_bonds: Optional[int] = Query(
None, description="Maximum number of atoms coordinated to the metal."
),
binding_energy_min: Optional[float] = Query(
min_binding_energy: Optional[float] = Query(
None, description="Minimum binding electronic energy (units: eV)"
),
binding_energy_max: Optional[float] = Query(
max_binding_energy: Optional[float] = Query(
None, description="Maximum binding electronic energy (units: eV)"
),
binding_enthalpy_min: Optional[float] = Query(
min_binding_enthalpy: Optional[float] = Query(
None, description="Minimum binding enthalpy (units: eV)"
),
binding_enthalpy_max: Optional[float] = Query(
max_binding_enthalpy: Optional[float] = Query(
None, description="Maximum binding enthalpy (units: eV)"
),
binding_entropy_min: Optional[float] = Query(
min_binding_entropy: Optional[float] = Query(
None, description="Minimum binding entropy (units: eV/K)"
),
binding_entropy_max: Optional[float] = Query(
max_binding_entropy: Optional[float] = Query(
None, description="Maximum binding entropy (units: eV/K)"
),
binding_free_energy_min: Optional[float] = Query(
min_binding_free_energy: Optional[float] = Query(
None, description="Minimum binding free energy (units: eV)"
),
binding_free_energy_max: Optional[float] = Query(
max_binding_free_energy: Optional[float] = Query(
None, description="Maximum binding free energy (units: eV)"
),
) -> STORE_PARAMS:
Expand All @@ -83,23 +83,23 @@ def query(

d = {
"metal_partial_charge": [
metal_partial_charge_min,
metal_partial_charge_max,
min_metal_partial_charge,
max_metal_partial_charge,
],
"metal_partial_spin": [metal_partial_spin_min, metal_partial_spin_max],
"metal_partial_spin": [min_metal_partial_spin, max_metal_partial_spin],
"metal_assigned_charge": [
metal_assigned_charge_min,
metal_assigned_charge_max,
min_metal_assigned_charge,
max_metal_assigned_charge,
],
"metal_assigned_spin": [metal_assigned_spin_min, metal_assigned_spin_max],
"metal_assigned_spin": [min_metal_assigned_spin, max_metal_assigned_spin],
"number_coordinate_bonds": [
number_coordinate_bonds_min,
number_coordinate_bonds_max,
min_number_coordinate_bonds,
max_number_coordinate_bonds,
],
"binding_energy": [binding_energy_min, binding_energy_max],
"binding_enthalpy": [binding_enthalpy_min, binding_enthalpy_max],
"binding_entropy": [binding_entropy_min, binding_entropy_max],
"binding_free_energy": [binding_free_energy_min, binding_free_energy_max],
"binding_energy": [min_binding_energy, max_binding_energy],
"binding_enthalpy": [min_binding_enthalpy, max_binding_enthalpy],
"binding_entropy": [min_binding_entropy, max_binding_entropy],
"binding_free_energy": [min_binding_free_energy, max_binding_free_energy],
}

for entry in d:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
ExactCalcMethodQuery,
FormulaQuery,
ChemsysQuery,
CompositionElementsQuery,
ElementsQuery,
ChargeSpinQuery,
)
from emmet.api.routes.molecules.metal_binding.query_operators import BindingDataQuery
Expand All @@ -26,7 +26,7 @@ def metal_binding_resource(metal_binding_store):
ExactCalcMethodQuery(),
FormulaQuery(),
ChemsysQuery(),
CompositionElementsQuery(),
ElementsQuery(),
ChargeSpinQuery(),
MethodQuery(),
BindingDataQuery(),
Expand Down
Loading

0 comments on commit 1dffb90

Please sign in to comment.