From bd35d5057ab831b37ac7eea425209ff83d749b0a Mon Sep 17 00:00:00 2001 From: Vitor Hideyoshi Date: Thu, 2 Jun 2022 13:42:37 -0300 Subject: [PATCH] Adding stable dependencies to project --- Pipfile | 23 +++++++++++++++++++++++ diceplayer/DPpack/Player.py | 21 +++++---------------- diceplayer/__main__.py | 14 ++++++-------- 3 files changed, 34 insertions(+), 24 deletions(-) create mode 100644 Pipfile diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..a96e015 --- /dev/null +++ b/Pipfile @@ -0,0 +1,23 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[packages] +numpy = "*" +pyinstaller = "*" +pyinstall = "*" +argparse = "*" +typing = "*" +nptyping = "*" +"subprocess.run" = "*" +multiprocess = "*" +setproctitle = "*" +textwrap3 = "*" +pathlib = "*" +gzip-utils = "*" + +[dev-packages] + +[requires] +python_version = "3.8" diff --git a/diceplayer/DPpack/Player.py b/diceplayer/DPpack/Player.py index f6a93a5..cb81833 100644 --- a/diceplayer/DPpack/Player.py +++ b/diceplayer/DPpack/Player.py @@ -612,17 +612,13 @@ class Player: self.gaussian.reset() - # I still have to talk with Herbet about this function def populate_asec_vdw(self, cycle): # Both asec_charges and vdw_meanfield will utilize the Molecule() class and Atoms() with some None elements asec_charges = Molecule( "ASEC_CHARGES" - ) # (lbl=None, na=None, rx, ry, rz, chg, eps=None, sig=None) - # vdw_meanfield = ( - # Molecule() - # ) # (lbl=None, na=None, rx, ry, rz, chg=None, eps, sig) + ) if self.dice.nstep[-1] % self.dice.isave == 0: nconfigs = round(self.dice.nstep[-1] / self.dice.isave) @@ -632,11 +628,6 @@ class Player: norm_factor = nconfigs * self.nprocs nsitesref = len(self.system.molecule[0].atom) - # nsitesref = ( - # len(self.system.molecule[0].atom) - # + len(self.system.molecule[0].ghost_atoms) - # + len(self.system.molecule[0].lp_atoms) - # ) nsites_total = self.dice.nmol[0] * nsitesref for i in range(1, len(self.dice.nmol)): @@ -647,9 +638,8 @@ class Player: for proc in range(1, self.nprocs + 1): # Run over folders - simdir = "simfiles" path = ( - simdir + "simfiles" + os.sep + "step{:02d}".format(cycle) + os.sep @@ -682,19 +672,18 @@ class Player: ) ) - # Skip the first (reference) molecule xyzfile = xyzfile[nsitesref:] mol_count = 0 - for type in range(len(self.dice.nmol)): # Run over types of molecules + for type in range(len(self.dice.nmol)): if type == 0: nmols = self.dice.nmol[0] - 1 else: nmols = self.dice.nmol[type] - for mol in range(nmols): # Run over molecules of each type + for mol in range(nmols): - new_molecule = Molecule(self.system.molecule[type].molname) + new_molecule = Molecule(self.system.molecule[type]) # Run over sites of each molecule for site in range(len(self.system.molecule[types].atom)): diff --git a/diceplayer/__main__.py b/diceplayer/__main__.py index bff71a8..4f91fb7 100644 --- a/diceplayer/__main__.py +++ b/diceplayer/__main__.py @@ -1,5 +1,3 @@ -#!/usr/bin/python3 - import argparse import os import pickle @@ -20,24 +18,24 @@ if __name__ == "__main__": parser = argparse.ArgumentParser(prog="Diceplayer") parser.add_argument( - "--continue", dest="opt_continue", default=False, action="store_true" + "-c", "--continue", dest="opt_continue", default=False, action="store_true" ) parser.add_argument( - "--version", action="version", version="diceplayer-" + __VERSION + "-v", "--version", action="version", version="diceplayer-" + __VERSION ) parser.add_argument( - "-i", + "-i", "--input", dest="infile", default="control.yml", metavar="INFILE", - help="input file of diceplayer [default = control.in]", + help="input file of diceplayer [default = control.in]" ) parser.add_argument( - "-o", + "-o", "--output", dest="outfile", default="run.log", metavar="OUTFILE", - help="output file of diceplayer [default = run.log]", + help="output file of diceplayer [default = run.log]" ) ## Study the option of a parameter for continuing the last process via data from control.in and run.log files