Esempio n. 1
0
#!python
import sys, os
import shutil
from magres.utils import find_all 

cwd = sys.argv[1]
target_dir = sys.argv[2]

file_paths = find_all(cwd, ".sh") + find_all(cwd, ".cell") + find_all(cwd, ".param") + find_all(cwd, ".DAT")

for path in file_paths:
  bits = path.split('/')

  for i in range(len(bits)):
    new_path = os.path.join(target_dir, *bits[:i])

    if not os.path.isdir(new_path):
      os.mkdir(new_path)

  new_path = os.path.join(target_dir, *bits)

  shutil.copy(path, new_path)

#!python
import yaml
import pyaml
import sys, os
from numpy import mean, std, array
from magres.utils import find_all
from magres.atoms import MagresAtoms
from castepy.utils import calc_from_path

magres_files = []

for dir in sys.argv[3:]:
  magres_files += find_all(dir, '.magres')

data = yaml.load(open(sys.argv[1]))
dataset_name = sys.argv[2]

seed_map = {}

# make all the coupling expressions lists
for structure_name, structure in data['structures'].items():
  couplings = structure['couplings']
  for i, coupling in enumerate(couplings):
    if type(coupling['index1']) is not list:
      coupling['index1'] = [x.strip() for x in coupling['index1'].split(',')]

    if type(coupling['index2']) is not list:
      coupling['index2'] = [x.strip() for x in coupling['index2'].split(',')]

    if type(coupling['expr']) is not list:
      coupling['expr'] = [x.strip() for x in coupling['expr'].split(',')]
Esempio n. 3
0
#!/usr/bin/python
import yaml
import pyaml
import sys, os
from numpy import mean, std, array
from magres.utils import find_all
from magres.atoms import MagresAtoms
from castepy.utils import calc_from_path

magres_files = []

for dir in sys.argv[3:]:
    magres_files += find_all(dir, '.magres')

data = yaml.load(open(sys.argv[1]))
dataset_name = sys.argv[2]

seed_map = {}

# make all the coupling expressions lists
for structure_name, structure in data['structures'].items():
    couplings = structure['couplings']
    for i, coupling in enumerate(couplings):
        if type(coupling['index1']) is not list:
            coupling['index1'] = coupling['index1'].split(',')

        if type(coupling['index2']) is not list:
            coupling['index2'] = coupling['index2'].split(',')

        if type(coupling['expr']) is not list:
            coupling['expr'] = coupling['expr'].split(',')