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 diff --git a/setup.py b/setup.py index ede466e..0c99503 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,53 @@ +import argparse +from distutils.command.clean import clean +import os +import shutil +import sys + import PyInstaller.__main__ -name = 'diceplayer' +name = "diceplayer" -PyInstaller.__main__.run([ - 'diceplayer/__main__.py', - '--onefile', - '-n{}'.format(name) -]) \ No newline at end of file +parser = argparse.ArgumentParser(prog="Diceplayer Setup") + +parser.add_argument( + "-b", "--build", + dest="build", + default=False, + action="store_true", + help="Builds the Diceplayer Binary", +) +parser.add_argument( + "-c", "--clean", + dest="clean", + default=False, + action="store_true", + help="Cleans the Development Environment", +) + +args = parser.parse_args() + + +def __build(): + + PyInstaller.__main__.run( + ["diceplayer/__main__.py", "--onefile", "-n{}".format(name)] + ) + + +def __clean(): + + shutil.rmtree("build") + shutil.rmtree("dist") + os.remove("diceplayer.spec") + + +if __name__ == "__main__": + + if args.build: + __build() + elif args.clean: + __clean() + else: + parser.print_help(sys.stderr) + sys.exit(1)