Package: cp2k-helper
cp2k_helperThis is a package I plan on building up to help accelerate working with cp2k.CP2K is a quantum chemistry and solid state physics software package.  I will explain some of the functionalities I have built so far below.InstallationInstallation through PyPi:pip install cp2k_helperInstall through GitHub:Run the following in your terminal where you would like to install the package directory.git clone https://github.com/loevlie/cp2k_helper.git
pip install -e cp2k_helperExample Usageoutput_parserUsesRetreive information from the output files generated after running a calculation using cp2k.Important NoteThe class will retrieve all information under the given directory (with a max depth as an optional extra argument) and use the directory names to classify each calculation you ran.  Therefore, you should not have two seperate cp2k calculations with the same directory name.ExampleThe output will be a dictionary of dictionaries (Containing the single point Energy calculations and Geometric optimization final energies found under the specified directory)fromcp2k_helperimportoutput_parser# Depth automatically set to infparser=output_parser(base_file_path='./cp2k')# If all=False then only the final energies will be retrievedEnergies=parser.get_energies(all=False)print(Energies)Output:{'ENERGY':defaultdict(float,{'Folder_Name1':-1000.997638482306,'Folder_Name2':-1000.997638482306,'Folder_Name6':-1000.900349392778}),'GEO_OPT':defaultdict(None,{'Folder_Name5':-1000.900349392778,'Folder_Name7':-1000.997638482306,'Folder_Name3':-1000.900349392778,'Folder_Name4':-1000.900349392778})}Note:The output example has fake foldernames and energy values for proprietary reasons.Command Line toolsrestartcp2k_helper has a handy command line tool for restarting a calculation if it timed out.  Just execute the command below in the directory that the calculation timed out and a new subdirectory will be created for the new job.  You can then submit the new job to restart the calculation.cp2k_helper --restartsummcp2k_helper can give you a quick summary of your output file.  Just use the command below with your output filename:cp2k_helper --summ OPT.outenergycp2k_helper can quickly get you the final energy values from all GEO_OPT or ENERGY DFT calculations under a specified directory.  The values are converted from Ha to eV.  They are saved as a csv (optionally you may name it whatever you want but the default is Energies.csv).  An example of using this feature for all of the calculations under the current folder is below:cp2k_helper --energy . My_Energy_ValuesThe above command will save a csv file to your current directory with all of the final energy values along with the type of calculation run and the folder name of each.  As of now the .csv file will look similar to below (if you had 4 DFT calculations in the given directory).Energies.csvFolder_NameTypeEnergy (eV)Folder_1GEO_OPT-10000.34324Folder_2ENERGY-10000.34324Folder_3ENERGY-10100.34324Folder_4GEO_OPT-10000.34324TODO:Add optional information to the csv file on the followingFunctionalDid the calculation converge? (this one is important/useful)Convergence criteriaAtomic compositionEtc. (if anyone has other information they think would be useful please add it to this list)Contribute to cp2k helperIf you have any ideas for features that would be nice to have in cp2k_helper please reach out to me or submit a pull request!Reporting IssuesPlease report issues athttps://github.com/loevlie/cp2k_helper/issues.