utilities
Utility maker nodes.
CombineMolecules
dataclass
Bases: PymatGenMaker[Molecule | list[Molecule], Molecule]
flowchart TD
jfchemistry.utilities.CombineMolecules[CombineMolecules]
jfchemistry.core.makers.pymatgen_maker.PymatGenMaker[PymatGenMaker]
jfchemistry.core.makers.jfchem_maker.JFChemMaker[JFChemMaker]
jfchemistry.core.makers.core_maker.CoreMaker[CoreMaker]
jfchemistry.core.makers.pymatgen_maker.PymatGenMaker --> jfchemistry.utilities.CombineMolecules
jfchemistry.core.makers.jfchem_maker.JFChemMaker --> jfchemistry.core.makers.pymatgen_maker.PymatGenMaker
jfchemistry.core.makers.core_maker.CoreMaker --> jfchemistry.core.makers.jfchem_maker.JFChemMaker
click jfchemistry.utilities.CombineMolecules href "" "jfchemistry.utilities.CombineMolecules"
click jfchemistry.core.makers.pymatgen_maker.PymatGenMaker href "" "jfchemistry.core.makers.pymatgen_maker.PymatGenMaker"
click jfchemistry.core.makers.jfchem_maker.JFChemMaker href "" "jfchemistry.core.makers.jfchem_maker.JFChemMaker"
click jfchemistry.core.makers.core_maker.CoreMaker href "" "jfchemistry.core.makers.core_maker.CoreMaker"
Combine one or more Molecule objects into a single Molecule.
Only supports pymatgen Molecule inputs (not periodic Structure). Molecules are appended in the order provided, in the same coordinate frame.
Source code in jfchemistry/utilities/combine_molecules.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | |
make
make(input: InputType | list[InputType], **kwargs) -> Response[_output_model]
Create a workflow job for processing structure(s).
Automatically handles job distribution for lists of structures. Each structure in a list is processed as a separate job for parallel execution.
| PARAMETER | DESCRIPTION |
|---|---|
input
|
Single Pymatgen SiteCollection or list of SiteCollections.
TYPE:
|
**kwargs
|
Additional kwargs to pass to the operation.
DEFAULT:
|
| RETURNS | DESCRIPTION |
|---|---|
Response[_output_model]
|
Response containing: - structure: Processed structure(s) - files: XYZ format file(s) of the structure(s) - properties: Computed properties from the operation |
Examples:
>>> from jfchemistry.conformers import CRESTConformers
>>> from pymatgen.core import Molecule
>>> molecule = Molecule.from_ase_atoms(molecule("C2H6"))
>>> # Generate conformers
>>> conformer_gen = CRESTConformers(ewin=6.0)
>>> job = conformer_gen.make(input)
Source code in jfchemistry/core/makers/jfchem_maker.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | |
PropertiesToDisk
dataclass
Bases: PymatGenMaker
flowchart TD
jfchemistry.utilities.PropertiesToDisk[PropertiesToDisk]
jfchemistry.core.makers.pymatgen_maker.PymatGenMaker[PymatGenMaker]
jfchemistry.core.makers.jfchem_maker.JFChemMaker[JFChemMaker]
jfchemistry.core.makers.core_maker.CoreMaker[CoreMaker]
jfchemistry.core.makers.pymatgen_maker.PymatGenMaker --> jfchemistry.utilities.PropertiesToDisk
jfchemistry.core.makers.jfchem_maker.JFChemMaker --> jfchemistry.core.makers.pymatgen_maker.PymatGenMaker
jfchemistry.core.makers.core_maker.CoreMaker --> jfchemistry.core.makers.jfchem_maker.JFChemMaker
click jfchemistry.utilities.PropertiesToDisk href "" "jfchemistry.utilities.PropertiesToDisk"
click jfchemistry.core.makers.pymatgen_maker.PymatGenMaker href "" "jfchemistry.core.makers.pymatgen_maker.PymatGenMaker"
click jfchemistry.core.makers.jfchem_maker.JFChemMaker href "" "jfchemistry.core.makers.jfchem_maker.JFChemMaker"
click jfchemistry.core.makers.core_maker.CoreMaker href "" "jfchemistry.core.makers.core_maker.CoreMaker"
Persist one or more properties objects to JSON on disk.
If a list is provided, indexed suffixes are appended to the base filename:
e.g. properties.json -> properties_0.json, properties_1.json.
Source code in jfchemistry/utilities/properties_to_disk.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
make
make(properties: Properties | list[Properties]) -> Response[_output_model]
Write properties object(s) to JSON file(s).
Source code in jfchemistry/utilities/properties_to_disk.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
RotateMolecule
dataclass
Bases: PymatGenMaker[Molecule, Molecule]
flowchart TD
jfchemistry.utilities.RotateMolecule[RotateMolecule]
jfchemistry.core.makers.pymatgen_maker.PymatGenMaker[PymatGenMaker]
jfchemistry.core.makers.jfchem_maker.JFChemMaker[JFChemMaker]
jfchemistry.core.makers.core_maker.CoreMaker[CoreMaker]
jfchemistry.core.makers.pymatgen_maker.PymatGenMaker --> jfchemistry.utilities.RotateMolecule
jfchemistry.core.makers.jfchem_maker.JFChemMaker --> jfchemistry.core.makers.pymatgen_maker.PymatGenMaker
jfchemistry.core.makers.core_maker.CoreMaker --> jfchemistry.core.makers.jfchem_maker.JFChemMaker
click jfchemistry.utilities.RotateMolecule href "" "jfchemistry.utilities.RotateMolecule"
click jfchemistry.core.makers.pymatgen_maker.PymatGenMaker href "" "jfchemistry.core.makers.pymatgen_maker.PymatGenMaker"
click jfchemistry.core.makers.jfchem_maker.JFChemMaker href "" "jfchemistry.core.makers.jfchem_maker.JFChemMaker"
click jfchemistry.core.makers.core_maker.CoreMaker href "" "jfchemistry.core.makers.core_maker.CoreMaker"
Rotate a Molecule using a rotation matrix, axis-angle, or principal-axes alignment.
Only supports pymatgen Molecule (not Structure). Modes: - "matrix": apply a user-provided 3x3 rotation matrix. - "axis_angle": rotate by angle [degrees] around an axis (e.g. "z" or [0,0,1]). - "principal_axes": align principal moments of inertia with lab axes (e.g. largest along z).
Units
Pass a float in the listed unit or a pint Quantity (e.g. jfchemistry.ureg
or jfchemistry.Q_):
- angle_deg: [degrees]
Set rotation parameters as instance attributes; then call make(molecule) or make([mol1, mol2]).
Source code in jfchemistry/utilities/rotate_molecule.py
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | |
make
make(input: InputType | list[InputType], **kwargs) -> Response[_output_model]
Create a workflow job for processing structure(s).
Automatically handles job distribution for lists of structures. Each structure in a list is processed as a separate job for parallel execution.
| PARAMETER | DESCRIPTION |
|---|---|
input
|
Single Pymatgen SiteCollection or list of SiteCollections.
TYPE:
|
**kwargs
|
Additional kwargs to pass to the operation.
DEFAULT:
|
| RETURNS | DESCRIPTION |
|---|---|
Response[_output_model]
|
Response containing: - structure: Processed structure(s) - files: XYZ format file(s) of the structure(s) - properties: Computed properties from the operation |
Examples:
>>> from jfchemistry.conformers import CRESTConformers
>>> from pymatgen.core import Molecule
>>> molecule = Molecule.from_ase_atoms(molecule("C2H6"))
>>> # Generate conformers
>>> conformer_gen = CRESTConformers(ewin=6.0)
>>> job = conformer_gen.make(input)
Source code in jfchemistry/core/makers/jfchem_maker.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | |
SaveToDisk
dataclass
Bases: PymatGenMaker[InputType, OutputType]
flowchart TD
jfchemistry.utilities.SaveToDisk[SaveToDisk]
jfchemistry.core.makers.pymatgen_maker.PymatGenMaker[PymatGenMaker]
jfchemistry.core.makers.jfchem_maker.JFChemMaker[JFChemMaker]
jfchemistry.core.makers.core_maker.CoreMaker[CoreMaker]
jfchemistry.core.makers.pymatgen_maker.PymatGenMaker --> jfchemistry.utilities.SaveToDisk
jfchemistry.core.makers.jfchem_maker.JFChemMaker --> jfchemistry.core.makers.pymatgen_maker.PymatGenMaker
jfchemistry.core.makers.core_maker.CoreMaker --> jfchemistry.core.makers.jfchem_maker.JFChemMaker
click jfchemistry.utilities.SaveToDisk href "" "jfchemistry.utilities.SaveToDisk"
click jfchemistry.core.makers.pymatgen_maker.PymatGenMaker href "" "jfchemistry.core.makers.pymatgen_maker.PymatGenMaker"
click jfchemistry.core.makers.jfchem_maker.JFChemMaker href "" "jfchemistry.core.makers.jfchem_maker.JFChemMaker"
click jfchemistry.core.makers.core_maker.CoreMaker href "" "jfchemistry.core.makers.core_maker.CoreMaker"
Save a structure or molecule to disk; appends suffixes for lists.
Accepts a single Structure/Molecule or a list. When given a list, each item is written to a file with an appended suffix (e.g. output_0.xyz, output_1.xyz). Format is inferred from the filename extension if not provided.
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
Maker name for jobflow.
TYPE:
|
suffix_fmt |
Format string for list indices, e.g. "_{i}" -> output_0.xyz. Must contain exactly one "{i}" placeholder.
TYPE:
|
filename |
Base filename for saving.
TYPE:
|
fmt |
Format to save as.
TYPE:
|
Source code in jfchemistry/utilities/save_to_disk.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | |
make
make(input: InputType | list[InputType], **kwargs) -> Response[_output_model]
Create a workflow job for processing structure(s).
Automatically handles job distribution for lists of structures. Each structure in a list is processed as a separate job for parallel execution.
| PARAMETER | DESCRIPTION |
|---|---|
input
|
Single Pymatgen SiteCollection or list of SiteCollections.
TYPE:
|
**kwargs
|
Additional kwargs to pass to the operation.
DEFAULT:
|
| RETURNS | DESCRIPTION |
|---|---|
Response[_output_model]
|
Response containing: - structure: Processed structure(s) - files: XYZ format file(s) of the structure(s) - properties: Computed properties from the operation |
Examples:
>>> from jfchemistry.conformers import CRESTConformers
>>> from pymatgen.core import Molecule
>>> molecule = Molecule.from_ase_atoms(molecule("C2H6"))
>>> # Generate conformers
>>> conformer_gen = CRESTConformers(ewin=6.0)
>>> job = conformer_gen.make(input)
Source code in jfchemistry/core/makers/jfchem_maker.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | |
TranslateMolecule
dataclass
Bases: PymatGenMaker[Molecule, Molecule]
flowchart TD
jfchemistry.utilities.TranslateMolecule[TranslateMolecule]
jfchemistry.core.makers.pymatgen_maker.PymatGenMaker[PymatGenMaker]
jfchemistry.core.makers.jfchem_maker.JFChemMaker[JFChemMaker]
jfchemistry.core.makers.core_maker.CoreMaker[CoreMaker]
jfchemistry.core.makers.pymatgen_maker.PymatGenMaker --> jfchemistry.utilities.TranslateMolecule
jfchemistry.core.makers.jfchem_maker.JFChemMaker --> jfchemistry.core.makers.pymatgen_maker.PymatGenMaker
jfchemistry.core.makers.core_maker.CoreMaker --> jfchemistry.core.makers.jfchem_maker.JFChemMaker
click jfchemistry.utilities.TranslateMolecule href "" "jfchemistry.utilities.TranslateMolecule"
click jfchemistry.core.makers.pymatgen_maker.PymatGenMaker href "" "jfchemistry.core.makers.pymatgen_maker.PymatGenMaker"
click jfchemistry.core.makers.jfchem_maker.JFChemMaker href "" "jfchemistry.core.makers.jfchem_maker.JFChemMaker"
click jfchemistry.core.makers.core_maker.CoreMaker href "" "jfchemistry.core.makers.core_maker.CoreMaker"
Translate a Molecule by a vector or move its center to the origin.
Only supports pymatgen Molecule (not Structure). Modes: - "vector": apply a user-provided translation (dx, dy, dz). - "center_of_mass": move center of mass to the origin (mass-weighted). - "center_of_geometry": move centroid (center of geometry) to the origin.
Set mode and translation as instance attributes; then call make(molecule) or make([mol1, ...]).
Source code in jfchemistry/utilities/translate_molecule.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | |
make
make(input: InputType | list[InputType], **kwargs) -> Response[_output_model]
Create a workflow job for processing structure(s).
Automatically handles job distribution for lists of structures. Each structure in a list is processed as a separate job for parallel execution.
| PARAMETER | DESCRIPTION |
|---|---|
input
|
Single Pymatgen SiteCollection or list of SiteCollections.
TYPE:
|
**kwargs
|
Additional kwargs to pass to the operation.
DEFAULT:
|
| RETURNS | DESCRIPTION |
|---|---|
Response[_output_model]
|
Response containing: - structure: Processed structure(s) - files: XYZ format file(s) of the structure(s) - properties: Computed properties from the operation |
Examples:
>>> from jfchemistry.conformers import CRESTConformers
>>> from pymatgen.core import Molecule
>>> molecule = Molecule.from_ase_atoms(molecule("C2H6"))
>>> # Generate conformers
>>> conformer_gen = CRESTConformers(ewin=6.0)
>>> job = conformer_gen.make(input)
Source code in jfchemistry/core/makers/jfchem_maker.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | |