This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
data = read_xvg("name_of_file.xvg") | |
plt.plot(data[:,0], data[:,1]) | |
plt.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mbuild | |
import foyer | |
import mosdef_cassandra as mc | |
import unyt as u | |
from mosdef_cassandra.utils.get_files import ( | |
get_example_ff_path, | |
get_example_mol2_path, | |
) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pytest | |
import hypothesis | |
import mbuild as mb | |
from mbuild.formats.xyz import write_xyz | |
from mbuild.utils.io import get_fn | |
from mbuild.tests.base_test import BaseTest | |
from mbuild.exceptions import MBuildError | |
from mbuild.lib.moieties import H2O |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import foyer | |
import mbuild as mb | |
import unyt as u | |
import gmso | |
from gmso.lib.potential_templates import PotentialTemplateLibrary | |
from gmso.external import from_parmed | |
from gmso.formats.top import write_top | |
from gmso.formats.gro import write_gro | |
def gmso_top(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cation = mb.load('cation.mol2') | |
for idx, particle in enumerate(cation.particles()): | |
if idx == 0: | |
particle.name = 'C_E' | |
# Atom type system | |
# `structure` is a parmed structure | |
# Have to change the name or parmed will error when trying to save the structure | |
for atom in structure.atoms: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mbuild as mb | |
import foyer | |
import antefoyer | |
alkane = mb.load('CCCC', smiles=True) | |
packing_box = mb.Box([5, 5, 5]) | |
# Initialize gaff force field |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@pytest.mark.parametrize('orientations,constraints', | |
[((True, False, False),["constrain_rotation x"]), | |
((False, True, False),["constrain_rotation y"]), | |
((False, False, True),["constrain_rotation z"]), | |
((True, True, False),["constrain_rotation x", | |
"constrain_rotation y"]), | |
((False, True, True),["constrain_rotation y", | |
"constrain_rotation z"]), | |
((True, False, True),["constrain_rotation x", | |
"constrain_rotation z"])]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
project = signac.get_project() | |
for job in project.find_jobs(): | |
fig, ax = plt.subplots() | |
if os.path.isfile(os.path.join(job.workspace(), 'all-reducs.pkl')): | |
with open(os.path.join(job.workspace(), 'all-reducs.pkl'), 'rb') as f: | |
reduc = pickle.load(f) | |
c = deepcopy(reduc) | |
cluster_sizes = [] | |
for proc in c: | |
for matrix in proc: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import signac | |
import os | |
project = signac.get_project() | |
for job in project.find_jobs(): | |
sq = os.path.join(job.workspace(), 'sq.txt') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mdtraj as md | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from scattering.scattering import structure_factor | |
# Load trajectory with MDTraj | |
trj = md.load('sample.trr', top='sample.gro') | |
il = trj.topology.select('resid 0') | |
trj_il = trj.atom_slice(il) |
NewerOlder