MolSSI / QCFractal

@@ -49,10 +49,22 @@
Loading
49 49
        "start new optimizations, in unit of a.u. I.e. if energy_upper_limit = 0.05, current global "
50 50
        "minimum energy is -9.9 , then a new task starting with energy -9.8 will be skipped.",
51 51
    )
52 +
    additional_keywords: Dict[str, Any] = Field(
53 +
        {}, description="Additional keywords to add to the torsiondrive's optimization runs"
54 +
    )
52 55
53 56
    def __init__(self, **kwargs):
54 57
        super().__init__(**recursive_normalizer(kwargs))
55 58
59 +
    def dict(self, *args, **kwargs):
60 +
        ret = super().dict(*args, **kwargs)
61 +
62 +
        # For hash compatibility
63 +
        if len(ret["additional_keywords"]) == 0:
64 +
            ret.pop("additional_keywords")
65 +
66 +
        return ret
67 +
56 68
57 69
_td_constr = constr(strip_whitespace=True, regex="torsiondrive")
58 70
_qcfractal_constr = constr(strip_whitespace=True, regex="qcfractal")

@@ -113,6 +113,11 @@
Loading
113 113
            "meta": {"procedure": "optimization", "qc_spec": output.qc_spec.dict(), "tag": meta.pop("tag", None)}
114 114
        }
115 115
        opt_template["meta"].update(output.optimization_spec.dict())
116 +
117 +
        # allows for injection of e.g. additional constraints for
118 +
        # optimizations created by torsiondrive service
119 +
        opt_template["meta"]["keywords"].update(service_input.keywords.additional_keywords)
120 +
116 121
        meta["optimization_template"] = json.dumps(opt_template)
117 122
118 123
        # Move around geometric data

@@ -92,6 +92,7 @@
Loading
92 92
        dihedral_ranges: Optional[List[Tuple[int, int]]] = None,
93 93
        energy_decrease_thresh: Optional[float] = None,
94 94
        energy_upper_limit: Optional[float] = None,
95 +
        additional_keywords: Optional[Dict[str, Any]] = None,
95 96
        attributes: Dict[str, Any] = None,
96 97
        save: bool = True,
97 98
    ) -> None:
@@ -112,6 +113,8 @@
Loading
112 113
            The threshold of energy decrease to trigger activating grid points
113 114
        energy_upper_limit: Optional[float]
114 115
            The upper limit of energy relative to current global minimum to trigger activating grid points
116 +
        additional_keywords : Dict[str, Any], optional
117 +
            Additional keywords to add to the torsiondrive's optimization runs
115 118
        attributes : Dict[str, Any], optional
116 119
            Additional attributes and descriptions for the entry
117 120
        save : bool, optional
@@ -124,6 +127,9 @@
Loading
124 127
        if attributes is None:
125 128
            attributes = {}
126 129
130 +
        if additional_keywords is None:
131 +
            additional_keywords = {}
132 +
127 133
        # Build new objects
128 134
        molecule_ids = self.client.add_molecules(initial_molecules)
129 135
        td_keywords = TDKeywords(
@@ -132,6 +138,7 @@
Loading
132 138
            dihedral_ranges=dihedral_ranges,
133 139
            energy_decrease_thresh=energy_decrease_thresh,
134 140
            energy_upper_limit=energy_upper_limit,
141 +
            additional_keywords=additional_keywords,
135 142
        )
136 143
137 144
        entry = TDEntry(name=name, initial_molecules=molecule_ids, td_keywords=td_keywords, attributes=attributes)
Files Coverage
qcfractal 88.26%
Project Totals (70 files) 88.26%
1
coverage:
2
  ignore:
3
    - */tests/*
4
    - qcfractal/dashboard/* # early state
5
    - qcfractal/alembic/* # difficult to test
6
    - qcfractal/_version.py
7
    - setup.py
8
  status:
9
    patch: false
10
    project:
11
      default:
12
        threshold: 80%
13
comment:
14
  layout: "header"
15
  require_changes: false
16
  branches: null
17
  behavior: once
18
  flags: null
19
  paths: null
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading