Skip to content

Commit

Permalink
Strip trailing new lines and update example for realsitic pressure
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasKappel committed Apr 25, 2024
1 parent e6ee6d5 commit 2687e66
Show file tree
Hide file tree
Showing 6 changed files with 768 additions and 44 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,20 @@ pip install molbox
from molbox import Box, MolBox
from molbox.lammps_data import write_lammps_data
from molbox.rdkit_3d_ops import create_3d_mol_from_smiles, rotate_mol
from rdkit import Chem
from scipy.spatial.transform import Rotation


def main():
box = Box([0, 0, 0], [10, 10, 10])
box = Box([0, 0, 0], [175, 175, 175])
o2_box = MolBox(box=box)
o2_mol = create_3d_mol_from_smiles("O=O")
num_mols = 32
num_mols = 128
for _ in range(num_mols):
rotation = Rotation.random(random_state=42)
rotation = Rotation.random()
new_mol = rotate_mol(o2_mol, rotation, "COM")
o2_box.add_mol_randomly(new_mol)
Chem.MolToMolFile(o2_box.mol, "examples/o2_box.mol")
write_lammps_data(o2_box, "examples/o2_box.lmpdat")


Expand Down
4 changes: 2 additions & 2 deletions examples/create_o2_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@


def main():
box = Box([0, 0, 0], [10, 10, 10])
box = Box([0, 0, 0], [175, 175, 175])
o2_box = MolBox(box=box)
o2_mol = create_3d_mol_from_smiles("O=O")
num_mols = 8
num_mols = 128
for _ in range(num_mols):
rotation = Rotation.random()
new_mol = rotate_mol(o2_mol, rotation, "COM")
Expand Down
Loading

0 comments on commit 2687e66

Please sign in to comment.