Skip to content

Instantly share code, notes, and snippets.

View ramanishsingh's full-sized avatar

Ramanish Singh ramanishsingh

View GitHub Profile
#!/usr/bin/env python3
"""
Simple benchmark script to compare DataLoader with stateful=True vs stateful=False
Based on the existing benchmark_dataloader.py structure.
Usage: python simple_stateful_benchmark.py
"""
import json
import random
import time
#!/usr/bin/env python3
"""
Plot benchmark results produced by benchmark_dataloader.py
Usage:
python plot_benchmark_results.py --results /path/to/benchmark_results.json --outdir /path/to/output_dir
If --outdir is not provided, plots will be saved alongside the JSON file.
"""
@ramanishsingh
ramanishsingh / benchmark_dataloader_nw0.py
Last active October 8, 2025 16:55
Benchmarking torchdata StatefulDataLoader speed w.r.t. torch.utils.data DataLoader
#!/usr/bin/env python3
"""
Benchmark script to compare torch.utils.data.dataloader.DataLoader vs StatefulDataLoader
across various dataset types.
Usage: python benchmark_dataloader.py
"""
import json
import random
import time
@ramanishsingh
ramanishsingh / constrainmol_effect_OneMoleculeVsOneBox.ipynb
Last active August 25, 2021 21:03
Effect of constrainmol on a filled mbuild box
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ramanishsingh
ramanishsingh / constrainmol_effect.ipynb
Created August 7, 2021 20:56
A jupyter notebook showing the difference in bond lengths before and after using constrainmol
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ramanishsingh
ramanishsingh / n2box_creator.py
Last active August 2, 2021 23:34
High precision coordinates for fixed bond length simulations using constrainmol
import numpy as np
import parmed
import mbuild as mb
from constrainmol import ConstrainedMolecule
def save_box(num_molecules, side_length,out_filename):
""" num_molecules: Number of molecules in the box
side_length : Side length of the box in AA
out_filename : Name of the output xyz file
"""
@ramanishsingh
ramanishsingh / com.py
Last active July 29, 2021 18:10
Save residue COM trajectory using mdtraj and freud
import mdtraj as md
import freud
import numpy as np
import mbuild as mb
comb_traj = md.load("litfsi-pos-1.xyz", top="10m_small.pdb")
length=[15.7932,15.7932,15.7932]
comb_traj = md.Trajectory(
comb_traj.xyz,
comb_traj.top,
unitcell_lengths = np.tile([length[0]/10, length[1]/10, length[2]/10], (comb_traj.n_frames,1)),
@ramanishsingh
ramanishsingh / ITG.cif
Created April 28, 2021 16:18
ITG cif downloaded from IZA
data_ITG
#**************************************************************************
#
# CIF taken from the IZA-SC Database of Zeolite Structures
# Ch. Baerlocher and L.B. McCusker
# Database of Zeolite Structures: http://www.iza-structure.org/databases/
#
# The atom coordinates and the cell parameters were optimized with DLS76
# assuming a pure SiO2 composition.
@ramanishsingh
ramanishsingh / ITG_XYZ_vesta.xyz
Created April 28, 2021 16:18
unit cell xyz created in VESTA using ITG cif
196
ITG
Si 7.694179 1.532757 4.948914
Si 2.746242 11.166143 15.923773
Si 2.746242 1.532757 15.923773
Si 7.694179 11.166143 4.948914
Si 9.295567 1.532757 7.620618
Si 1.144854 11.166143 13.252069
Si 1.144854 1.532757 13.252069
Si 9.295567 11.166143 7.620618
@ramanishsingh
ramanishsingh / remove_periodic_images_itg.ipynb
Last active April 28, 2021 16:16
Jupyter notebook for removing periodic images
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.