playmolecule.devutils module#
- playmolecule.devutils.app_arg_parser(description)#
- playmolecule.devutils.app_arg_parser2(description)#
- playmolecule.devutils.app_wrapper(args, parser, func)#
- playmolecule.devutils.app_wrapper2(func, cli_arg_str=None, token=None, execid=None, dump_argparser=None, dump_manifest=None, input_json=None)#
- playmolecule.devutils.basenameInputs(parser, args, prefix='.')#
Returns the basename of the value for the file arguments :param parser: The argparse parser :type parser: argparse.ArgumentParser :param args: The dictionary of the arguments to inspect :type args: dict :param prefix: The path prefix to apply to the basename :type prefix: str
- Returns:
args – The dictionary of the arguments with the basename value (for files)
- Return type:
- playmolecule.devutils.getJobId(configpath)#
Returns the job id stored in the config file
- playmolecule.devutils.pmtryexcept(arg1, arg2, arg3)#
The decorator that handles the try/except by redirecting the sys.stderr and sys.stdout to a log file. Two boolean arguments can trigger the usage of the log file: arg1 refers to standalone mode; arg2 refers to debug mode. For writing to the log file the arg1 needs to be False or the arg2 needs to be True.
- playmolecule.devutils.pmws_wrapper(token, execid, pythonexe)#
- playmolecule.devutils.report_alive(outdir)#
- playmolecule.devutils.setAsCompleted(outdir)#
Writes the sentinel for the complete job.
- Parameters:
outdir (str) – The location where to write the sentinel file
- playmolecule.devutils.setAsError(outdir)#
Writes the sentinel for the error job.
- Parameters:
outdir (str) – The location where to write the sentinel file
- playmolecule.devutils.setAsSleep(outdir)#
Writes the sentinel for the complete job.
- Parameters:
outdir (str) – The location where to write the sentinel file
- playmolecule.devutils.tarFolder(folder, outtar=None, arcname='')#
- playmolecule.devutils.unzipit(z, tmpdir='./tmp', overwrite=False, outdir=None)#
Returns a list with the files in the zip file (when a zip). In alternative, a list with the passed file/folder
- playmolecule.devutils.writeInputsOptionsLog(path, parser, varset, debug=False)#
Writes a log file, in yml format file, reporting all the options used for the current simulations. :param parser: The argparse parser :type parser: argparse.ArgumentParser :param path: The folder destination where to write the log :type path: str :param varset: The namespace that contains all the options used :type varset: Namespace :param debug: Set as True if you want to write the debug value :type debug: bool
- playmolecule.devutils.writeInputsOptionsLog2(path, params)#
Writes a log file, in yml format file, reporting all the options used for the current simulations.
- playmolecule.devutils.writeSentinel(fname, outfolder, message=None)#
Writes a sentinel file. A message can be written in the file
- playmolecule.devutils.zipdir(path, ziph)#
Adds all the tree files of the folder passed into the zip file :param path: The path to add to the zip file :type path: str :param ziph: The zipfile object :type ziph: zipfile.ZipFile