-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathzmatrix_example.py
More file actions
34 lines (26 loc) · 889 Bytes
/
zmatrix_example.py
File metadata and controls
34 lines (26 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# ruff: noqa: T201
from pathlib import Path
import stk
import stko
def main() -> None:
"""Run the example."""
bb1 = stk.BuildingBlock("NCCNCCN", [stk.PrimaryAminoFactory()])
bb2 = stk.BuildingBlock("O=CCCC=O", [stk.AldehydeFactory()])
polymer = stk.ConstructedMolecule(
stk.polymer.Linear(
building_blocks=(bb1, bb2),
repeating_unit="AB",
orientations=(0, 0),
num_repeating_units=1,
)
)
examples_output = Path("output_directory")
examples_output.mkdir(parents=True, exist_ok=True)
print(stko.ZMatrix().get_zmatrix(bb1))
bb1.write(examples_output / "bb1.mol")
print(stko.ZMatrix().get_zmatrix(bb2))
bb2.write(examples_output / "bb2.mol")
print(stko.ZMatrix().get_zmatrix(polymer))
polymer.write(examples_output / "polymer.mol")
if __name__ == "__main__":
main()