-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path09 - GCMCRunWriter.py
42 lines (41 loc) · 1.63 KB
/
09 - GCMCRunWriter.py
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
35
36
37
38
39
40
41
42
######This python script take in a list of your species and temperature, then spits out a bash runscript to run your GCMC simulations
#It requires the following variables:
#species - the name of your sorbent species
#framework - the name of your MOF (or other porous material
#parentdir = a path to navigate you to your testing directory
#################
import os
import re
import random
import numpy as np
from math import sqrt, log
from pathlib import Path
import logging
import datetime
import argparse
import musicpy.setup as setup
import musicpy.Antoine as Antoine
import musicpy.Forcefield as Forcefield
now = datetime.datetime.now()
#################
####This section sorts out your messages from this script to the console and a log file
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
handler = logging.FileHandler('{0}/sorb_sorb_maker.log'.format('.'))
handler.setLevel(logging.DEBUG)
handler2 = logging.StreamHandler()
handler2.setLevel(logging.INFO)
logger.addHandler(handler)
logger.addHandler(handler2)
logger.debug('-----------------------------------')
logger.debug('Generating new files on {0}-{1}-{2} at {3}:{4}'.format(now.year, now.month, now.day, now.hour, now.minute))
logger.debug('-----------------------------------')
##################
species = ['XXXX']
T = 298
framework = 'YYYY'
istm = ['''### your pressure points here###''']
parentdir = Path('/home/r/jrhm21/scratch/03_music_chloroform_forcefield/')
targetdir = Path('./experiments/{0}/{1}/'.format(species[-1], T))
####################
setup.GcmcRunWriter(logger, species[-1], T, framework, parentdir, targetdir, istm)