repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
milos85vasic/Apache-Factory-Toolkit | git_info.py | <gh_stars>1-10
import subprocess
import json
key_branch = "branch"
destination = "git_info.json"
key_repository = "repository"
def set_git_info():
star = "* "
branch = ""
repository = ""
fetch_url = "Fetch URL:"
url_result, _ = subprocess.Popen(["git", "remote", "show", "origin"], stdout=subproce... |
milos85vasic/Apache-Factory-Toolkit | configuration.py | apache_factory = "Apache-Factory"
pyramid_factory = "Pyramid-Factory"
mail_server_factory = "Mail-Server-Factory"
php = "Php"
mysql = "MySQL"
apache2 = "Apache2"
mysql_bin_dir = "bin"
mysql_lib_dir = "lib"
mysql_priv_dir = "priv"
mysql_bench_dir = "bench"
mysql_plugin_dir = "plugin"
mysql_data_dir = "data"
mysql_log_d... |
milos85vasic/Apache-Factory-Toolkit | system_configuration.py | import json
import os
from Toolkit.configuration import *
from Toolkit.commands import *
from Toolkit.connectivity import *
arg_prefix = "--"
arg_server_admin = arg_prefix + "server_admin"
key_configuration_port = "port"
key_configuration_port_mysql = "port_mysql"
key_configuration_port_postfix = "port_postfix"
key_c... |
milos85vasic/Apache-Factory-Toolkit | mysql_common_5560.py | <reponame>milos85vasic/Apache-Factory-Toolkit
from .configuration import *
from .system_configuration import *
# MySQL 5.5.60:
def get_mysql_start_command(user_account):
system_configuration = get_system_configuration()
mysql_full_path = get_home_directory_path(user_account) + "/" + mysql + "/"
port = def... |
milos85vasic/Apache-Factory-Toolkit | commands.py | <reponame>milos85vasic/Apache-Factory-Toolkit
import os
import subprocess
here = "./"
os_unknown = "Unknown"
os_centos_7 = "CentOS Linux 7"
os_centos_8 = "CentOS Linux 8"
toolkit_directory = "Toolkit"
toolkit_repo = "https://github.com/milos85vasic/Apache-Factory-Toolkit.git"
toolkit_repo_raw_access = "https://raw.gi... |
milos85vasic/Apache-Factory-Toolkit | connectivity.py | <filename>connectivity.py
import socket, errno
def is_port_available(port_number):
success = True
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
s.bind(("127.0.0.1", port_number))
except socket.error as e:
if e.errno == errno.EADDRINUSE:
success = False
... |
milos85vasic/Apache-Factory-Toolkit | find_service_index.py | import json
import getpass
import sys
from commands import *
from configuration import *
from system_configuration import *
account = getpass.getuser()
system_configuration = get_system_configuration()
service = None
service_url = sys.argv[1]
service_home = sys.argv[2]
services = system_configuration[account][key_s... |
milos85vasic/Apache-Factory-Toolkit | __init__.py | # __init__.py
from .commands import *
from .configuration import *
from .connectivity import *
from .mysql_common import *
from .mysql_common_5560 import *
from .system_configuration import * |
milos85vasic/Apache-Factory-Toolkit | websetup.py | <reponame>milos85vasic/Apache-Factory-Toolkit<filename>websetup.py
import os
import sys
import subprocess
import time
toolkit_directory = "Toolkit"
toolkit_repo = "https://github.com/milos85vasic/Apache-Factory-Toolkit.git"
if __name__ == '__main__':
exists = True
steps = []
if not os.path.exists(toolkit_... |
MatheusAmelco/squad-1-ad-python-2 | api/migrations/0002_auto_20190727_1440.py | <filename>api/migrations/0002_auto_20190727_1440.py<gh_stars>1-10
# Generated by Django 2.2.3 on 2019-07-27 14:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0001_initial'),
]
operations = [
migrations.AlterField(
... |
MatheusAmelco/squad-1-ad-python-2 | commission/settings_prod.py | <reponame>MatheusAmelco/squad-1-ad-python-2<filename>commission/settings_prod.py<gh_stars>1-10
from .settings import *
import dj_database_url
DEBUG = False
# procura pela URL do banco em DATABASE_URL
DATABASES = {
'default': dj_database_url.config()
}
# https://devcenter.heroku.com/articles/django-assets
# Djan... |
MatheusAmelco/squad-1-ad-python-2 | api/serializers.py | <gh_stars>1-10
from rest_framework import serializers
from api.models import Commission_plan, Sellers, Sales
class CommissionPlanSerializer(serializers.ModelSerializer):
class Meta:
model = Commission_plan
fields = ['id', 'lower_percentage', 'upper_percentage', 'min_value']
class SellersSerializ... |
MatheusAmelco/squad-1-ad-python-2 | api/urls.py | <reponame>MatheusAmelco/squad-1-ad-python-2
from django.urls import path
from api import views
from rest_framework_jwt.views import obtain_jwt_token
from rest_framework_jwt.views import refresh_jwt_token
urlpatterns = [
path('sellers/', views.sellers),
path('commissions/', views.commissions),
path('month_c... |
MatheusAmelco/squad-1-ad-python-2 | api/tests.py | <gh_stars>1-10
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from django.contrib.auth.models import User
from api.models import Commission_plan, Sellers, Sales
from decimal import Decimal
class TelesalesViewTestCase(TestCase):
def setUp(self):
... |
MatheusAmelco/squad-1-ad-python-2 | api/migrations/0001_initial.py | # Generated by Django 2.2.3 on 2019-07-24 03:09
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Commission_plan',
fields=[... |
MatheusAmelco/squad-1-ad-python-2 | api/admin.py | from django.contrib import admin
from .models import Sellers, Commission_plan, Sales
admin.site.register(Sellers)
admin.site.register(Commission_plan)
admin.site.register(Sales)
|
MatheusAmelco/squad-1-ad-python-2 | api/migrations/0003_auto_20190729_2006.py | <reponame>MatheusAmelco/squad-1-ad-python-2
# Generated by Django 2.2.3 on 2019-07-29 20:06
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0002_auto_20190727_1440'),
]
operations = [
migrations.Alte... |
Duilio999/autodownloader | main.py | <reponame>Duilio999/autodownloader<gh_stars>1-10
# import urllib.request
from openload import OpenLoad
from time import sleep
# Define Functions
def find_id(string1):
index = 0
string2 = 'openload.co/f/'
sl = 14 # sl = set lenght of distance from the openload.co/f/ string we have to obtain
while sl ... |
fire717/hualubei2020-callingsmoking | data/resize.py | <reponame>fire717/hualubei2020-callingsmoking<gh_stars>10-100
import cv2
import albumentations as A
import os
import sys
import json
def getAllName(file_dir, tail_list = ['.JPG']): #
L=[]
for root, dirs, files in os.walk(file_dir):
for file in files:
if os.path.splitext(file)[1] in tail_l... |
fire717/hualubei2020-callingsmoking | config.py |
cfg = {
"model_name": "adv-efficientnet-b4",
#adv-efficientnet-b2 se_resnext50_32x4d xception resnext101_32x8d_wsl
"img_size": 600,
'GPU_ID': '0',
"class_number": 4,
'mode': '-mutillabel',
#train
'batch_size':3,
'early_stop_patient':26,
'learning_rate':0.0002,
'epochs':35,... |
CHPC-UofU/jupyter-lmod | jupyterlmod/handler.py | <reponame>CHPC-UofU/jupyter-lmod
import json
import os
import tornado.web
import lmod
from functools import partial
from jupyter_core.paths import jupyter_path
from notebook.base.handlers import IPythonHandler
ACTIONS = {
"avail" : lmod.avail,
"list" : partial(lmod.list, hide_hidden=True),
"freeze... |
weizigege/pyqt5 | day01/pyqt1.py | import sys
from PyQt5.QtWidgets import QApplication,QWidget
if __name__=='__main__':
app=QApplication(sys.argv)
w=QWidget()
w.resize(400,400)
w.setWindowTitle('你是猪吗')
w.show()
sys.exit(app.exec_())
|
yildirimyy/permutation-combination | combi.py | <reponame>yildirimyy/permutation-combination
def combinations(list_item, n, com_list=[]):
# recursive cagirimda n'li seviyeye geldiysen dur
if len(list_item) == n:
# eger daha once boyle bir combinasyon bulunduysa ekleme
# ornek: abcb icin iki kere bb bb gelir
if not list_item in com_lis... |
yildirimyy/permutation-combination | permu.py | def permutations(list):
#Listede eleman olup olmadiginin kontrolu
if len(list) == 0:
return []
#Listede 1 eleman varsa sonuc 1
if len(list) == 1:
return list
# Listede 1'den fazla eleman varsa permutasyonu bul
perm_list = [] # o anki permutasyonu tutan liste
for i in range(l... |
Finrsch/market_simulation | simulation.py | import pandas
import requests
import quandl #necessary ONLY if using quandl function below
quandl.ApiConfig.api_key="YOUR_TOKEN_HERE" #necessary ONLY if using the QUANDL function below
holding_list=list() #global variable. It holds the position. List element = [ticker, position_buy_value]
investment=int() #global var... |
marfeljoergsen/smart_duplicate_file_finder | smart_duplicate_file_finder.py | <filename>smart_duplicate_file_finder.py
#!/usr/bin/env python3
import sys
import subprocess
import inspect
from os import path, SEEK_SET, SEEK_END
import math
import argparse
import hashlib
import numpy as np # for random number generation
# File to compare if md5sum is the same for similar files on 8 vs 12 TB dis... |
zybbigpy/VaspCZ | sourcecode/VaspNEBKeepInputs.py | <reponame>zybbigpy/VaspCZ<filename>sourcecode/VaspNEBKeepInputs.py
import os
def run():
maintain_files = 'ini,fin'.split(',')
files = os.listdir('./')
del_files = []
for file in files:
if file in maintain_files:
pass
else:
del_files.append(file)
ipt = input(f'Thoes files/dir will be kept: {maintain_fil... |
zybbigpy/VaspCZ | vtstscripts-939/kdb/remote_insert.py | from kdbinsert import KdbInsert
from optparse import OptionParser
import sys
from aselite import read_any
from remote_db import RemoteDB
from server_config import *
class RemoteInsert(KdbInsert):
#email and password are set prior to running insert if email/pw combo is present
def __init__(self):
self.e... |
zybbigpy/VaspCZ | vtstscripts-939/kdb/local_insert.py | <gh_stars>10-100
from kdbinsert import KdbInsert
from optparse import OptionParser
import sys
from aselite import read_any
from config import *
from local_db import LocalDB
class LocalInsert(KdbInsert):
def __init__(self):
pass
# This function will overload the default insert_into_db function
def... |
zybbigpy/VaspCZ | vtstscripts-939/dymmatrix.py | <gh_stars>10-100
#!/usr/bin/env python
import numpy
numpy.seterr(all='raise')
import os
import glob
import aselite
from sys import exit
def check_file(filename):
if not os.path.isfile(filename):
print 'No such file: %s' % filename
exit(1)
def dymmatrix(displacecars, outcars):
all_displacemen... |
zybbigpy/VaspCZ | vtstscripts-939/kdb/local_db.py | import sqlite3
from aselite import Atoms
from aselite import FixAtoms
from aselite import write_vasp
import local_update
import numpy
import sys
import copy
class LocalDB():
def __init__(self, db_name, nf=None, dc=None, mac=None):
self.db_name = db_name
self.nf = nf
self.dc = dc
sel... |
zybbigpy/VaspCZ | vtstscripts-939/coverage.py | #!/usr/bin/env python
import sys
import glob
ignore = ['kdbaddpr.pl', 'kdbaddprnew.pl', 'kdbaddvpr.pl', 'kdbquery.pl', 'kdbquerynew.pl', 'akmcreset.pl', 'akmcupdate.pl', 'akmc.pl', 'akmccleanjobs.pl', 'pos2con.pl']
if len(sys.argv) > 1:
for fname in sys.argv[1:]:
if fname in ignore:
ignore.re... |
zybbigpy/VaspCZ | vtstscripts-939/center.py | #!/usr/bin/env python
import aselite
from sys import argv, exit
if len(argv) < 2 or len(argv) > 3 or '-h' in argv:
print 'usage: center.py FILE [DISTANCE]'
print ' centers the structure in the current box and'
print ' optionally adds DISTANCE amount of vacuum to FILE'
print
exit(0)
... |
zybbigpy/VaspCZ | vtstscripts-939/kdb/test/test.py | # NOTE: to test MySQL/anything in remote, you must first
# install MySQL-server (atleast until I setup the DB on Theory server)
# then run remote_initialize.py
import os
import sys
import commands
import filecmp
#get args
args = sys.argv
if len(args) <= 1:
print "test.py requires atleast one argueme... |
zybbigpy/VaspCZ | sourcecode/Check_Hb.py | <gh_stars>10-100
"""
针对fcc获得Hb
遍历当前文件夹下的文件下的文件夹,fcc_withele存在的时候,就计算一个Hb
"""
import os
def cal_Hb():
Hb = item1 + item2 - item3 -item4
return Hb
def run():
for path, dirnames, filenames in os.walk():
for dirname in dirnames:
if dirname[:-2] == 'fcc_with':
print(path, dirname)
if __name__ == '__main__':... |
zybbigpy/VaspCZ | vtstscripts-939/kdb/config.py | # This file holds variables that will never be changed during execution.
# The below parameters are only used when a database has not been created.
MOBILE_ATOM_CUTOFF = 0.7
NEIGHBOR_FUDGE = 0.2
DISTANCE_CUTOFF = 0.3
PBC_MAPPING_CHECK = False
REBOX_SUGGESTIONS = False
KDB_NAME = 'kdb.db' |
zybbigpy/VaspCZ | vtstscripts-939/stretch.py | #!/usr/bin/env python
import aselite
from sys import exit, argv
from os.path import isfile
import numpy as np
if '-h' in argv or len(argv) < 5:
print 'usage: stretch.py FILENAME INDEX1 INDEX2 DISTANCE'
print ' Stretches the atom INDEX2 by the bond defined by atoms INDEX1'
print ' and INDEX2 by ... |
zybbigpy/VaspCZ | vtstscripts-939/kdb/server_config.py | #List of variables used through remote package
db_name = 'kdb'
backup_db_name = 'kdb_backup'
user_db_name = 'kdb_user'
#note these variables should only be set on the server
#client's do not need these.
user = 'root'
password = 'password'
port = 3306
host = 'localhost'
|
zybbigpy/VaspCZ | othercode/get_Hb_2nn_to_6nn_forfcc.py | <gh_stars>10-100
import os
import subprocess
import sys
sys.path.append(os.path.join(os.environ['HOME'], 'bin/VaspCZ/sourcecode'))
import zzdlib
import numpy as np
import VaspCZ
pys_path = os.path.join(os.environ['HOME'], 'bin/VaspCZ/sourcecode')
def run_Hf_and_Hb(ele):
# 4个文件夹下的结构优化的WARNING 检查和能量检查。
E_pure = zzd... |
zybbigpy/VaspCZ | vtstscripts-939/kdb/local_update.py | <reponame>zybbigpy/VaspCZ<filename>vtstscripts-939/kdb/local_update.py<gh_stars>10-100
#!/usr/bin/env python
import local_db
from kdbinsert import KdbInsert
class LocalUpdate(KdbInsert):
# overrides default insert_into_db function
def insert_into_db(self, **args):
# create instance of database
db... |
zybbigpy/VaspCZ | sourcecode/VaspVibAna_forNEB.py | """
NEB的振动分析
程序运行在NEB目录,需要NEB完成
读取ini/CONTCAR fin/CONTCAR 鞍点(一般02)/CONTCAR
对比ini/CONTCAR fin/CONTCAR 的原子位置,确定是第几个是扩散元素。
对ini/CONTCAR saddle/CONTCAR 扩散元素T T T,非扩散元素F F F
修改INCAR进行振动分析
"""
import os, sys
import subprocess
import zzdlib
import argparse
import numpy as np
python = sys.executable
current_py_folder = os.p... |
zybbigpy/VaspCZ | othercode/test.py | import os
import subprocess
def dd():
print('mdmdmd')
res = subprocess.check_output(dd, stderr=subprocess.STDOUT, shell=True)
print(res) |
zybbigpy/VaspCZ | othercode/get_total_used_core.py | <filename>othercode/get_total_used_core.py<gh_stars>10-100
#!/public/software/apps/python/3.7.1/bin/python3
# coding=utf-8
import os
import argparse
import subprocess
def getshellResult(code):
res = subprocess.check_output(code, stderr=subprocess.STDOUT, shell=True)
res = res.decode('utf-8')
res = res.split('\n')... |
zybbigpy/VaspCZ | vtstscripts-939/vef.py | #!/usr/bin/env python
import aselite
from os.path import isfile, dirname, abspath, join
from os import system
from sys import exit, argv
if '-h' in argv:
print 'usage: vef.py'
print ' prints the force and energy for each ionic step of a vasp run'
print
exit(0)
vtst_path = dirname(abspath(__file_... |
zybbigpy/VaspCZ | vtstscripts-939/2con.py | #!/usr/bin/env python
import sys
import aselite
if len(sys.argv) < 3:
print 'usage: 2con.py IN OUT'
print ' converts file IN of type POSCAR or xyz to con and saves it to OUT'
print
sys.exit(0)
traj = aselite.read_any(sys.argv[1])
aselite.write_con(sys.argv[2], traj)
|
zybbigpy/VaspCZ | vtstscripts-939/kdb/remote_db.py | <gh_stars>10-100
from aselite import Atoms
from aselite import FixAtoms
from aselite import write_vasp
import numpy as np
import pymysql
from server_config import *
import re
import copy
import sys
class RemoteDB():
def __init__(self):
self.db_name = db_name
self.backup_db_name = backup_db_name
... |
zybbigpy/VaspCZ | sourcecode/VaspModiFile.py | #!/home/zhangzhengde/bin/bin/python3
#coding=utf-8
import sys
sys.path.append('/home/zhangzhengde/bin/pythonlib')
import zzdlib
import os
data_INCAR = zzdlib.File.openFile('./INCAR','r')
data_INCAR_old = data_INCAR.copy()
data_INCAR = zzdlib.File.substituteData(data_INCAR,'ISIF','ISIF=2')
data_INCAR = zzdlib.File.su... |
zybbigpy/VaspCZ | sourcecode/VaspVibAna_Result.py | <gh_stars>10-100
"""
振动分析结束后,获取振动分析结果,计算出当前态下的振动振动频率。
公式为:v = (求积vi_equilirium)/(求积vi_saddle)
平衡态一般取初态ini的结果,如果有反向过程,如bcc九频模型中w4是w3的反过程,取w3过渡态的fin作为平衡态,即可就出w4的振动频率
"""
import zzdlib
import os
import argparse
import numpy as np
def run_walk(isprint=True):
run_path = os.getcwd()
for dirpath, dirnames, filenames in o... |
zybbigpy/VaspCZ | sourcecode/VaspOpt-Sta.py | <filename>sourcecode/VaspOpt-Sta.py
#!/home/zhangzhengde/bin/bin/python3
import sys
sys.path.append('/home/zhangzhengde/bin/pythonlib')
import os
import zzdlib
import argparse
inl = ['ini','fin']
parser = argparse.ArgumentParser(description = 'manual to this script')
parser.add_argument('--nc',type=str,default='0,0... |
zybbigpy/VaspCZ | vtstscripts-939/aselite.py | <reponame>zybbigpy/VaspCZ<gh_stars>10-100
#!/usr/bin/env python
#encoding: utf-8
'''aselite is a striped down single file version of ase that retains the
following features: atom and atoms objects, some of ase.io and some of
ase.constraints.'''
# Copyright 2008, 2009 CAMd
# (see accompanying license files for details... |
zybbigpy/VaspCZ | sourcecode/VaspGenerate.py | import os
import VaspCZ.zzdlib as zzd
def generate_inputs(examp='fcc_Fe_3x3x3'):
"""
从example下拷贝例子
:return:
"""
path = zzd.File.VaspCZ_software_path()
for file in 'INCAR,POSCAR,POTCAR,KPOINTS'.split(','):
os.system(f'cp {path}/examples/{examp}/{file} .')
print(f'生成文件:{file} (example)')
vaspsh_path = zzd.F... |
zybbigpy/VaspCZ | vtstscripts-939/kdb/kdb.py | import glob
import os
import numpy
import sys
import re
import subprocess
class Kdb():
def check_svn_version(self):
#does not work
svn_info = subprocess.check_output("svn info")
print svn_info
def check_version(self):
if sys.version_info[:2] != (2,7):
print "python ... |
zybbigpy/VaspCZ | sourcecode/VaspQsub.py | <reponame>zybbigpy/VaspCZ<gh_stars>10-100
#!/home/zhangzhengde/bin/bin/python3
#coding=utf-8
import sys
sys.path.append('/home/zhangzhengde/bin/pythonlib')
import zzdlib as zzd
import os
data_Sh = zzd.File.openFile('./Vasp.sh','r')
#传入第1个参数是节点数,第2个参数是核数,第3个参数的任务名,第4个参数是是否加急
defnc = zzd.File.getLine(data_Sh,'#PBS -l... |
zybbigpy/VaspCZ | sourcecode/k_point_test.py | <filename>sourcecode/k_point_test.py
#!/home/zhangzhengde/bin/bin/python3
#coding=utf-8
import os
import argparse
def modify_vasp_sh(jobname, nodes, ppn):
with open('./Vasp.sh', 'r') as f:
data = f.readlines()
new_data = []
for line in data:
if ' #PBS -N' in line:
new_data.append(f' #PBS -N {jobname}\n')
... |
zybbigpy/VaspCZ | test.py | <reponame>zybbigpy/VaspCZ<filename>test.py
import sys
# print(sys.modules)
import VaspCZ.zzdlib as zzd
b = zzd.File.openFile('install.py', 'r')
print(b) |
zybbigpy/VaspCZ | vtstscripts-939/kdb/remote_update.py | <reponame>zybbigpy/VaspCZ
from remote_db import RemoteDB
from kdbinsert import KdbInsert
from optparse import OptionParser
import pymysql
from server_config import *
class RemoteUpdate(KdbInsert):
def __init__(self):
self.current_o_pro_pk = None
# overloaded insert function from KdbInsert class
de... |
zybbigpy/VaspCZ | vtstscripts-939/kdb/kdbinsert.py | <gh_stars>10-100
#!/usr/bin/env python
import numpy
from aselite import elements
from aselite import FixAtoms
from kdb import Kdb
class KdbInsert(Kdb):
def __init__(self):
pass
def coordination_numbers(self, p, nf):
nl = []
for a in range(len(p)):
nl.append([])
... |
zybbigpy/VaspCZ | vtstscripts-939/kdb_client.py |
import sys
import os
import shutil
cwd = os.getcwd()
os.chdir(os.path.dirname(__file__))
from kdb import kdb
from kdb import remote_client
# this is not ideal but to pickle the ASE.Atoms objects we need the class files in the same directory
# that the program is being called from.
shutil.copyfile('kdb/aselite.py', 'a... |
zybbigpy/VaspCZ | sourcecode/VaspNEBCheckDist.py | <filename>sourcecode/VaspNEBCheckDist.py
import os
import argparse
import VaspCZ.zzdlib as zzd
def VaspNEBCheckDist(POSorCONT):
if '00' in os.listdir() and 'INCAR' in os.listdir():
data_log = zzd.File.openFile('./INCAR')
image = zzd.File.getLine(data_log,'IMAGES')[0].split('=')[-1].strip('\n')
if int(image) <=... |
zybbigpy/VaspCZ | vtstscripts-939/kdb/local_client.py | <gh_stars>10-100
# Main.py is the user entry point into the program.
import sys
from kdb import Kdb
import local_insert
import local_query
import local_db
from aselite import read_any
from config import *
def run(args):
if not Kdb().check_version():
sys.exit()
if len(args) < 1:
print "first p... |
zybbigpy/VaspCZ | sourcecode/VaspCZ1.0.2.py | <gh_stars>10-100
#!/home/zhangzhengde/bin/bin/python3
#coding=utf-8
"""
这是应用程序Linux用户界面。
"""
import os, sys
import numpy as np
import time
import VaspGenerate
import VaspCZ.zzdlib as zzd
import utils
import subprocess
python = sys.executable
current_py_folder = os.path.dirname(os.path.abspath(__file__))
VaspCZ_path =... |
zybbigpy/VaspCZ | vtstscripts-939/kdb/remote_initialize.py | <filename>vtstscripts-939/kdb/remote_initialize.py
import pymysql
import sys
from server_config import *
# Try to create the databases without any tables.
def create_databases():
if user == '' or password == '' or port == None or host == '':
print "Cannot initialize Database until server_config.py is prope... |
zybbigpy/VaspCZ | vtstscripts-939/xyz2con.py | <reponame>zybbigpy/VaspCZ<filename>vtstscripts-939/xyz2con.py
#!/usr/bin/env python
import aselite
import numpy as np
from sys import argv, exit
if len(argv) < 3 or '-h' in argv:
print "usage: xyz2con.py FILENAME BOXSIZE\n"
exit(0)
filename = argv[1]
atoms = aselite.read_xyz(filename)
atoms.positions -= ... |
zybbigpy/VaspCZ | sourcecode/NEBCheck1.1.py | #!/home/zhuguifeng/BIN/bin/python3
# -*- coding: utf-8-*-
import sys
sys.path.append('/home/zhangzhengde/bin/pythonlib')
import zzdlib as zzd
import os
import subprocess
import time
import argparse
def isNEB(dirpath):
with open(dirpath+'/log') as file_log:
flag = 0
data_log = file_log.readlines()
for i in rang... |
zybbigpy/VaspCZ | sourcecode/VaspVibAna_forSb.py | """
振动分析.
仅仅支持fcc 3x3x3 超胞共108Fe,掺杂溶质solute和空位vacancy时两种振动频率的计算。
运行在fcc_withele 文件夹下,提交2个振动分析:Fe106Te1V1 或 Fe107Te1
2019.8.7 更新
原来只考虑1NN原子振动的变化,且VASP结果默认不区分各个原子的振动频率
现在考虑1NN和2NN原子振动的变化。
对于Fe107Te1, Te位置为0.33 0.50 0.50, 1NN 12个 代表位置为0.50 0.50 0.66, 2NN 6个 代表位置为 0.66 0.50 0.50, 共3个原子的振动。
对于Fe106Te1V1, 考虑空位的1NN 2NN和溶质的1N... |
zybbigpy/VaspCZ | vtstscripts-939/nebinterp.py | <reponame>zybbigpy/VaspCZ<gh_stars>10-100
# written by <NAME>
def interpolate_images(image_list, num_new_images, kind = 'linear', use_image_distance_in_spline = False):
''' This function interpolates a list of ASE "Atoms" to a new list of images'''
nimages = len(image_list)
natoms = atoms.positions.shape[0]
if ni... |
zybbigpy/VaspCZ | sourcecode/VaspNEBKeepINFI_OptInputs.py | #!/home/zhangzhengde/bin/bin/python3
#coding=utf-8
"""
更新,包含了提示要删除文件。
"""
import os
import sys
alldir = os.listdir()
# 只保留ini fin
del_files = []
for dir in alldir:
if dir == 'ini' or dir == 'fin':
continue
else:
del_files.append(dir)
del_ini_files = os.listdir('ini')
del_ini_files.remove('Opt')
del_fin_file... |
zybbigpy/VaspCZ | sourcecode/__init__.py | __all__ = ['zzdlib', 'VaspGenerate', 'utils'] |
zybbigpy/VaspCZ | vtstscripts-939/rattle.py | <filename>vtstscripts-939/rattle.py
#!/usr/bin/env python
import aselite
from sys import argv, exit
if len(argv) < 3:
print 'usage: center.py FILE STDDEV'
print ' randomly displaces the atoms in FILE by a gaussian with'
print ' a standard deviation of STDDEV'
print
exit(0)
file... |
zybbigpy/VaspCZ | vtstscripts-939/pos2xyz.py | #!/usr/bin/env python
import aselite
from sys import argv
if '-h' in argv or len(argv) != 2:
print 'usage: pos2xyz.py POSCAR'
print
exit(1)
atoms = aselite.read_vasp(argv[1])
aselite.write_xyz('%s.xyz' % argv[1], atoms)
|
zybbigpy/VaspCZ | vtstscripts-939/kdb/kdbquery.py | #!/usr/bin/env python
import os
import sys
import numpy
import glob
import shutil
import math
import copy
from optparse import OptionParser
from kdb import Kdb
from config import *
from aselite import elements
from aselite import write_vasp
class KdbQuery(Kdb):
def __init__(self):
self.return_dict = {... |
zybbigpy/VaspCZ | sourcecode/utils.py | <reponame>zybbigpy/VaspCZ
import os,sys
import VaspCZ.zzdlib as zzd
import subprocess
python = sys.executable
current_py_folder = os.path.dirname(os.path.abspath(__file__))
VaspCZ_path = [
os.path.dirname(current_py_folder) if 'sourcecode' in current_py_folder else current_py_folder][0] + '/sourcecode'
def gui_stri... |
zybbigpy/VaspCZ | sourcecode/VaspGetNELM.py | <filename>sourcecode/VaspGetNELM.py<gh_stars>10-100
#!/home/zhangzhengde/bin/bin/python3
#coding=utf-8
import sys
sys.path.append('/home/zhangzhengde/bin/pythonlib/')
import zzdlib
import os
data_log = zzdlib.File.openFile('./log','r')
print('{:^5} {}'.format(' ',data_log[12].strip('\n')))
for i in range(len(data_lo... |
zybbigpy/VaspCZ | vtstscripts-939/kdb/routes.py | <reponame>zybbigpy/VaspCZ<filename>vtstscripts-939/kdb/routes.py
from bottle import route, post, run, request
import remote_insert, remote_query, remote_db
import pickle
host = '0.0.0.0'
port = 8080
@post('/account_create')
def create_account():
email = request.forms.get('email')
password = request.forms.get('pa... |
zybbigpy/VaspCZ | vtstscripts-939/kdb/__init__.py | import aselite
import bottle
import config
import kdb
import kdbinsert
import kdbquery
import local_client
import local_db
import local_insert
import local_query
import local_update
import remote_client
import remote_config
import remote_db
import remote_initialize
import remote_insert
import remote_query
import remote... |
zybbigpy/VaspCZ | sourcecode/VaspINFISta-NEB.py | #!/home/zhangzhengde/bin/bin/python3
import sys
sys.path.append('/home/zhangzhengde/bin/pythonlib')
import os
import VaspCZ.zzdlib as zzdlib
import argparse
parser = argparse.ArgumentParser(description='manual to this script')
parser.add_argument('--nc', type=str, default='0,0')
parser.add_argument('--EMER', type=st... |
zybbigpy/VaspCZ | vtstscripts-939/getangle.py | #!/usr/bin/env python
import time
import sys
import numpy as np
from string import Template
import fnmatch
import os
import re
import datetime
## READ IN VASP CON FILE ##
filein = sys.argv[1]
with open(filein, 'r') as f:
first_line = f.readline()
second_line = f.readline()
third_line = f.readline()
f... |
zybbigpy/VaspCZ | sourcecode/VaspKeepInputs.py | <gh_stars>10-100
#!/home/zhangzhengde/bin/bin/python3
#coding=utf-8
import os
import sys
Files = 'INCAR,POSCAR,POTCAR,KPOINTS,Vasp.sh'
Flist = Files.split(',')
for i in range(1,len(sys.argv)):
Flist.append(sys.argv[i])
print(Flist)
dir = 'KeepInputsDir'
os.system('mkdir '+dir)
for i in range(len(Flist)):
os.sys... |
zybbigpy/VaspCZ | vtstscripts-939/kdb/remote_query.py | from kdbquery import KdbQuery
from optparse import OptionParser
import sys
from aselite import read_any
from remote_db import RemoteDB
from server_config import *
class RemoteQuery(KdbQuery):
def __init__(self):
self.return_dict = {}
# overloads KdbQuery.query_db()
def query_db(self, **args):
... |
zybbigpy/VaspCZ | vtstscripts-939/kdb/remote_config.py | <reponame>zybbigpy/VaspCZ<gh_stars>10-100
import getpass
# remote config is used to create new accounts on the database
class RemoteConfig():
def config(self):
f_name = raw_input('Please enter your first name: ')
l_name = raw_input('Please enter your last name: ')
email = raw_input('Please enter your email addr... |
zybbigpy/VaspCZ | sourcecode/VaspNEBCheckRMS.py | <filename>sourcecode/VaspNEBCheckRMS.py
import os
import VaspCZ.zzdlib as zzd
def VaspNEBCheckRMS():
print('CheckNEBRMS is running...')
if '00' in os.listdir() and 'INCAR' in os.listdir():
data_INCAR = zzd.File.openFile('./INCAR')
data_log = zzd.File.openFile('./log')
image = zzd.File.getLine(data_INCAR,'IMAG... |
zybbigpy/VaspCZ | othercode/get_Sb_forfcc.py | import os
import subprocess
import sys
sys.path.append(os.path.join(os.environ['HOME'], 'bin/VaspCZ/sourcecode'))
import zzdlib
import numpy as np
import VaspCZ
pys_path = os.path.join(os.environ['HOME'], 'bin/VaspCZ/sourcecode')
def decode_vib_frequency(data):
# data 是shell代码出来的结果,是一个列表
frequncies = []
for i in... |
zybbigpy/VaspCZ | sourcecode/zzdlib.py | <reponame>zybbigpy/VaspCZ
#!/home/zhangzhengde/bin/bin/python
#coding=utf-8
import os
import subprocess
import time
import numpy as np
user = 'zhangzhengde'
current_py_folder = os.path.dirname(os.path.abspath(__file__))
VaspCZ_path = [os.path.dirname(current_py_folder) if 'sourcecode' in current_py_folder else curren... |
zybbigpy/VaspCZ | othercode/cal_2nn_to_6nn.py | <filename>othercode/cal_2nn_to_6nn.py
"""
运行在fcc_withele目录下,进入ele-Energies/,获取Fe106ele1V1文件夹下的输入文件,把POSCAR改为对应的2nn-6nn,然后进行计算
"""
import os
import subprocess
import sys
sys.path.append(os.path.join(os.environ['HOME'], 'bin/VaspCZ/sourcecode'))
import zzdlib
import numpy as np
import argparse
import VaspCZ
pys_path =... |
zybbigpy/VaspCZ | vtstscripts-939/split_dos.py | #!/usr/bin/env python
import numpy as np
#import ase
import aselite as ase
### READ DOSCAR ###
def read_dosfile():
f = open("DOSCAR", 'r')
lines = f.readlines()
f.close()
index = 0
natoms = int(lines[index].strip().split()[0])
index = 5
nedos = int(lines[index].strip().split()[2])
eferm... |
zybbigpy/VaspCZ | othercode/bcc_complement1.1.py | """
之前所有算的bcc_withele,需要补全一些计算,运行在bcc_withele文件夹下:
补全内容:
1.ele-V下的1nn 2nn Fe_12 Fe_13 Fe_14下的振动分析
2.ele-V下的w5任务的提交。
3.ele-Energies下的 53Fe1Al的振动分析,52Fe1Al1V的振动分析
1.1 更新
更新ele_Energies_vib函数
原来的用1NN 2NN 3NN 5NN的原子振动变化来计算熵增的近似不合理
改为计算全部的原子的振动。
"""
import os
import argparse
import sys
sys.path.append(os.path.join(os.... |
zybbigpy/VaspCZ | vtstscripts-939/tist.py | <gh_stars>10-100
#!/usr/bin/env python
from __future__ import print_function
import sys
import re
import os
import gzip
def sumIonicTime(f,subt,ast):
"sum all ionic times in an OUTCAR"
subtt = 0
subett = 0
elecStep = 0
avgStepTime = 0
for line in f :
string = line.split()
if len(string) > 0 :
... |
zybbigpy/VaspCZ | othercode/get_Sb_forbcc.py | import os
import subprocess
import sys
sys.path.append(os.path.join(os.environ['HOME'], 'bin/VaspCZ/sourcecode'))
import zzdlib
import numpy as np
def decode_vib_frequency(data):
# data 是shell代码出来的结果,是一个列表
frequncies = []
for i in range(len(data)):
line = data[i]
if 'THz' in line:
frequncy = line.split('=')... |
zybbigpy/VaspCZ | uninstall.py | <reponame>zybbigpy/VaspCZ<filename>uninstall.py
import os, sys
import install
# 获取安装目录
home = os.path.expanduser('~')
ins_path = install.install_path if install.install_path != '~' else home
install_path = ins_path if '~/' not in ins_path else os.path.join(home, ins_path.split('~/')[-1])
# 获取lib安装目录
lib_path = None
fo... |
zybbigpy/VaspCZ | othercode/qsub_energies_Opt1.0.py | <gh_stars>10-100
"""
在ele-Energies文件夹下运行
1.0
进入两个文件夹,提交结构优化。[Fe106Cr1v1, Fe107Cr1]
Cr是old-ele, 替换成新的ele
"""
import os
import argparse
import sys
sys.path.append(os.path.join(os.environ['HOME'], 'bin/VaspCZ/sourcecode'))
import zzdlib
def run(nodes, ppn, ele, oele):
dirs = [f'Fe106{oele}1V1', f'Fe107{oele}1']
for... |
zybbigpy/VaspCZ | sourcecode/VaspTestENCUT.py | #!/home/zhangzhengde/bin/bin/python3
# coding=utf-8
import os
import argparse
import VaspCZ.zzdlib as zzd
def modify_vasp_sh(jobname, nodes, ppn):
with open('./Vasp.sh', 'r') as f:
data = f.readlines()
new_data = []
for line in data:
if ' #PBS -N' in line:
new_data.append(f' #PBS -N {jobname}\n')
elif ' ... |
zybbigpy/VaspCZ | vtstscripts-939/kdb/remote_client.py | <reponame>zybbigpy/VaspCZ
import urllib
import httplib
import pickle
from aselite import read_any, write_vasp
import sys
import os
import shutil
import getpass
import remote_config
from kdb import Kdb
host = 'theory.cm.utexas.edu'
port = 8080
def server_create_account():
#grab info from user
info = remote_con... |
zybbigpy/VaspCZ | sourcecode/VaspCheckResults.py | import os
import VaspCZ.zzdlib as zzd
import argparse
def CheckWARNING(usript):
# usrinput为1时,只打印是否完成,为2时候,只打印能量信息,为3时,打印全部
Path = []
Energy = []
Step = []
mag = []
dist = []
RMS = []
warnflag = 0
jstat = ['Running...', 'Done', 'SC Running...', 'SC done', 'Stoped']
for dirpath, dirnames, filenames in os.walk... |
zybbigpy/VaspCZ | vtstscripts-939/insplot.py | #!/usr/bin/env python
from os import system
from os.path import dirname, abspath, join
vtst_path = dirname(abspath(__file__))
system("grep ut insout.dat | grep -v itr | cut -c 5-100 > o.u.t.t.e.m.p")
system("gnuplot %s" % join(vtst_path, 'insplot.gnu'))
system("rm o.u.t.t.e.m.p")
|
zybbigpy/VaspCZ | vtstscripts-939/con2xyz.py | <filename>vtstscripts-939/con2xyz.py<gh_stars>10-100
#!/usr/bin/env python
import aselite
from sys import argv, exit
if len(argv) < 2 or '-h' in argv:
print "usage: con2xyz.py FILENAME\n"
exit(0)
filename = argv[1]
atoms = aselite.read_con(filename)
aselite.write_xyz(filename.replace('con', 'xyz'), ato... |
zybbigpy/VaspCZ | sourcecode/VaspCZ1.0.0.py | <reponame>zybbigpy/VaspCZ
#!/home/zhangzhengde/bin/bin/python3
#coding=utf-8
import os, sys
import zzdlib as zzd
import subprocess
import string
import shutil
def CheckWARNING(usript):
#usrinput为1时,只打印是否完成,为2时候,只打印能量信息,为3时,打印全部
Path = []
Energy =[]
Step =[]
mag =[]
dist =[]
RMS =[]
warnflag = 0
jstat = ['Run... |
tdsimao/codewars_solutions | katas/kyu_4/sudoko_validator.py | """
https://www.codewars.com/kata/529bf0e9bdf7657179000008
"""
def validSolution(board):
return valid_rows(board) and valid_columns(board) and valid_sub_regions(board)
def valid_rows(board):
for row in board:
if has_repeated_values(row):
return False
return True
def valid_colum... |
neoGurb/Home-Assisant-FusionSolar-Kiosk | custom_components/fusion_solar_kiosk/fusion_solar_kiosk_api.py | """API client for FusionSolar Kiosk."""
import logging
import html
import json
from .const import (
ATTR_DATA,
ATTR_FAIL_CODE,
ATTR_SUCCESS,
ATTR_DATA_REALKPI,
)
from requests import get
_LOGGER = logging.getLogger(__name__)
class FusionSolarKioksApi:
def __init__(self, host):
self._host... |
BeginToCodeSnaps/PythonSnaps | EG3-05 housemartins.py | # EG3-05 housemartins
import snaps
snaps.display_image('Housemartins.jpg')
snaps.display_message('Hull Rocks',color=(255,255,255),vert='top')
|
BeginToCodeSnaps/PythonSnaps | EG3-01 Throw a single die.py | <filename>EG3-01 Throw a single die.py
import random #import the random library
print(random.randint(1,6))
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.