diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index aae0446bb9..b482ed03db 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,6 +12,7 @@ repos: hooks: - id: black name: Reformat Python files with the black code formatter + files: '^.*(/PACKAGE)|(\.py)$' exclude: >- (?x)^( exts/.*| diff --git a/src/PACKAGE b/src/PACKAGE index bab4d89430..a7eb80f0cc 100644 --- a/src/PACKAGE +++ b/src/PACKAGE @@ -1,7 +1,24 @@ { -"description": "Main package of CP2K", -"archive" : "libcp2kmain", -"requires": ["common", "fm", "pw", "pw_env", "input", "aobasis", "xc", "base", "mpiwrap", "subsys", "hfxbase", "minimax", "eri_mme", "shg_int", "dbcsrx", "arnoldi", "grid"], -"implicit": "INIT_METADYN|META_FORCE_CALCULATION|plumed_f_installed|plumed_f_gcreate|plumed_f_gcmd", - + "description": "Main package of CP2K", + "archive": "libcp2kmain", + "requires": [ + "common", + "fm", + "pw", + "pw_env", + "input", + "aobasis", + "xc", + "base", + "mpiwrap", + "subsys", + "hfxbase", + "minimax", + "eri_mme", + "shg_int", + "dbcsrx", + "arnoldi", + "grid", + ], + "implicit": "INIT_METADYN|META_FORCE_CALCULATION|plumed_f_installed|plumed_f_gcreate|plumed_f_gcmd", } diff --git a/src/aobasis/PACKAGE b/src/aobasis/PACKAGE index beb2af17e0..f8a27d3c86 100644 --- a/src/aobasis/PACKAGE +++ b/src/aobasis/PACKAGE @@ -1,5 +1,5 @@ { -"description": "routines defining and dealing with atomic orbitals on a low level", -"archive": "libcp2kao", -"requires": ["../common", "../input", "../base"], + "description": "routines defining and dealing with atomic orbitals on a low level", + "archive": "libcp2kao", + "requires": ["../common", "../input", "../base"], } diff --git a/src/arnoldi/PACKAGE b/src/arnoldi/PACKAGE index 772daebe96..57bfcf767d 100644 --- a/src/arnoldi/PACKAGE +++ b/src/arnoldi/PACKAGE @@ -1,6 +1,6 @@ { -"description": "Arnoldi iteration eigenvalue algorithm", -"archive": "libdbcsrarnoldi", -"requires": ["../mpiwrap", "../base", "../dbcsrx", "../common"], -"public" : ["arnoldi_api.F",], + "description": "Arnoldi iteration eigenvalue algorithm", + "archive": "libdbcsrarnoldi", + "requires": ["../mpiwrap", "../base", "../dbcsrx", "../common"], + "public": ["arnoldi_api.F",], } diff --git a/src/base/PACKAGE b/src/base/PACKAGE index 9efe84c102..397ef510b7 100644 --- a/src/base/PACKAGE +++ b/src/base/PACKAGE @@ -1,4 +1,4 @@ { -"description": "base routines needed to abstract away some machine/compiler dependent functionality", -"requires": [] + "description": "base routines needed to abstract away some machine/compiler dependent functionality", + "requires": [], } diff --git a/src/common/PACKAGE b/src/common/PACKAGE index 20ec5d8e91..49df04cd48 100644 --- a/src/common/PACKAGE +++ b/src/common/PACKAGE @@ -1,4 +1,4 @@ { -"description": "Basic routines which are conceptually independent from CP2K and its input", -"requires": ["../mpiwrap", "../base"] + "description": "Basic routines which are conceptually independent from CP2K and its input", + "requires": ["../mpiwrap", "../base"], } diff --git a/src/dbcsrx/PACKAGE b/src/dbcsrx/PACKAGE index f4441f1b22..0e6e969424 100644 --- a/src/dbcsrx/PACKAGE +++ b/src/dbcsrx/PACKAGE @@ -1,5 +1,5 @@ { -"description": "DBCSR eXtra functionalities", -"archive": "libdbcsrx", -"requires": ["../mpiwrap", "../base"], + "description": "DBCSR eXtra functionalities", + "archive": "libdbcsrx", + "requires": ["../mpiwrap", "../base"], } diff --git a/src/emd/PACKAGE b/src/emd/PACKAGE index 6e6de0d7f1..61cab18404 100644 --- a/src/emd/PACKAGE +++ b/src/emd/PACKAGE @@ -1,4 +1,16 @@ { -"description": "Methods for Ehrenfest molecular dynamics", -'requires': ["../", "../common", "../base", "../input", "../subsys", "../aobasis", "../mpiwrap", "../fm", "../pw", "../pw_env", "../arnoldi"], + "description": "Methods for Ehrenfest molecular dynamics", + "requires": [ + "../", + "../common", + "../base", + "../input", + "../subsys", + "../aobasis", + "../mpiwrap", + "../fm", + "../pw", + "../pw_env", + "../arnoldi", + ], } diff --git a/src/eri_mme/PACKAGE b/src/eri_mme/PACKAGE index 8a565dd9d9..ea3edd82e3 100644 --- a/src/eri_mme/PACKAGE +++ b/src/eri_mme/PACKAGE @@ -1,5 +1,5 @@ { -"description": "MiniMax-Ewald (MME) method for periodic ERIs", -"requires": ["../minimax","../aobasis", "../common", "../base","../mpiwrap"], -"public": ["eri_mme_integrate.F", "eri_mme_types.F", "eri_mme_test.F"] + "description": "MiniMax-Ewald (MME) method for periodic ERIs", + "requires": ["../minimax", "../aobasis", "../common", "../base", "../mpiwrap"], + "public": ["eri_mme_integrate.F", "eri_mme_types.F", "eri_mme_test.F"], } diff --git a/src/fm/PACKAGE b/src/fm/PACKAGE index 2abcda2184..d3a8f87c25 100644 --- a/src/fm/PACKAGE +++ b/src/fm/PACKAGE @@ -1,19 +1,17 @@ { -"description": "Full Matrices", -"requires": ["../common", "../base", "../mpiwrap" ], - - -"implicit": ( - "^(BLACS_.*|IGSUM2D" # BLACS - # ScaLAPACK - "|DESCINIT|NUMROC|INFOG2L|INDXG2L|INDXG2P|INDXL2G|PILAENV|ICEIL|" - "(P[SDCZ]" - "(ROT|COPY|" - "LA(CPY|NGE|TRA)|" - "(AX|DB|DT|GB|GE|GG|HE|OR|PB|PO|PT|ST|SY|TR|TZ|UN)" - "(MR2D|MM|ADD|ANU|ANC|TRI|LS|EV|EVD|EVX|GVX|SVD|BRD|CON|EBZ|EDC|EIN|EQU|" - "EVC|GBR|GHR|GLQ|GQL|GQR|GRQ|GST|HRD|LQF|MBR|MHR|MLQ|MQL|" - "MQR|MRQ|MRZ|MTR|QLF|QPF|QRF|RFS|RQF|RZF|TRD|TRF|TRI|TRS|" - "PY|SM|AN|RK))))$" - ), + "description": "Full Matrices", + "requires": ["../common", "../base", "../mpiwrap"], + "implicit": ( + "^(BLACS_.*|IGSUM2D" # BLACS + # ScaLAPACK + "|DESCINIT|NUMROC|INFOG2L|INDXG2L|INDXG2P|INDXL2G|PILAENV|ICEIL|" + "(P[SDCZ]" + "(ROT|COPY|" + "LA(CPY|NGE|TRA)|" + "(AX|DB|DT|GB|GE|GG|HE|OR|PB|PO|PT|ST|SY|TR|TZ|UN)" + "(MR2D|MM|ADD|ANU|ANC|TRI|LS|EV|EVD|EVX|GVX|SVD|BRD|CON|EBZ|EDC|EIN|EQU|" + "EVC|GBR|GHR|GLQ|GQL|GQR|GRQ|GST|HRD|LQF|MBR|MHR|MLQ|MQL|" + "MQR|MRQ|MRZ|MTR|QLF|QPF|QRF|RFS|RQF|RZF|TRD|TRF|TRI|TRS|" + "PY|SM|AN|RK))))$" + ), } diff --git a/src/grid/PACKAGE b/src/grid/PACKAGE index bd117e7be7..548e4db31d 100644 --- a/src/grid/PACKAGE +++ b/src/grid/PACKAGE @@ -1,5 +1,15 @@ { -"description": "Efficient conversion between Gaussian and plane-wave basis", -"requires": ["../base", "../pw", "../aobasis", "../common", "../subsys", "../mpiwrap", "./common", "./ref", "./cpu"], -"public": ["grid_api.F"], + "description": "Efficient conversion between Gaussian and plane-wave basis", + "requires": [ + "../base", + "../pw", + "../aobasis", + "../common", + "../subsys", + "../mpiwrap", + "./common", + "./ref", + "./cpu", + ], + "public": ["grid_api.F"], } diff --git a/src/grid/common/PACKAGE b/src/grid/common/PACKAGE index 08b7775570..e1520b41d4 100644 --- a/src/grid/common/PACKAGE +++ b/src/grid/common/PACKAGE @@ -1,4 +1,4 @@ { -"description": "Common parts shared by the grid backends", -"requires": [], + "description": "Common parts shared by the grid backends", + "requires": [], } diff --git a/src/grid/cpu/PACKAGE b/src/grid/cpu/PACKAGE index e47599f8f0..99f72e6195 100644 --- a/src/grid/cpu/PACKAGE +++ b/src/grid/cpu/PACKAGE @@ -1,4 +1,4 @@ { -"description": "Optimized CPU backend", -"requires": ["../common", "../ref"], + "description": "Optimized CPU backend", + "requires": ["../common", "../ref"], } diff --git a/src/grid/ref/PACKAGE b/src/grid/ref/PACKAGE index d4515c724f..1b98a3a646 100644 --- a/src/grid/ref/PACKAGE +++ b/src/grid/ref/PACKAGE @@ -1,4 +1,4 @@ { -"description": "Reference backend implementation", -"requires": ["../common"], + "description": "Reference backend implementation", + "requires": ["../common"], } diff --git a/src/hfxbase/PACKAGE b/src/hfxbase/PACKAGE index 0276d0abb7..70f4595a97 100644 --- a/src/hfxbase/PACKAGE +++ b/src/hfxbase/PACKAGE @@ -1,4 +1,4 @@ { -"description": "Basic (largely autogenerated) routines to perform Hartree-Fock exchange calculations ", -"requires": ["../common", "../base" ] + "description": "Basic (largely autogenerated) routines to perform Hartree-Fock exchange calculations ", + "requires": ["../common", "../base"], } diff --git a/src/input/PACKAGE b/src/input/PACKAGE index 0aaef0c717..f87167fafb 100644 --- a/src/input/PACKAGE +++ b/src/input/PACKAGE @@ -1,4 +1,4 @@ { -"description": "Dealing with the input, parsing files", -"requires": ["../common", "../base", "../mpiwrap" ], + "description": "Dealing with the input, parsing files", + "requires": ["../common", "../base", "../mpiwrap"], } diff --git a/src/metadyn_tools/PACKAGE b/src/metadyn_tools/PACKAGE index d63d02a78b..2df9db4218 100644 --- a/src/metadyn_tools/PACKAGE +++ b/src/metadyn_tools/PACKAGE @@ -1,4 +1 @@ -{ -"description": "FES tool for Metadynamics", -"requires": ["../common", "../base" ] -} +{"description": "FES tool for Metadynamics", "requires": ["../common", "../base"]} diff --git a/src/minimax/PACKAGE b/src/minimax/PACKAGE index c84919df7b..b11241f428 100644 --- a/src/minimax/PACKAGE +++ b/src/minimax/PACKAGE @@ -1,5 +1,5 @@ { -"description": "parameters for minimax approximations of 1/x", -"requires": ["../base","../common"], -"public": ["minimax_exp.F", "minimax_rpa.F", "minimax_exp_gw.F"] + "description": "parameters for minimax approximations of 1/x", + "requires": ["../base", "../common"], + "public": ["minimax_exp.F", "minimax_rpa.F", "minimax_exp_gw.F"], } diff --git a/src/motion/PACKAGE b/src/motion/PACKAGE index e782ea852b..9adf4f0ee2 100644 --- a/src/motion/PACKAGE +++ b/src/motion/PACKAGE @@ -1,4 +1,17 @@ { -"description": "Methods for changing atomic coordinates", -'requires': ["../", "../base", "../common", "../mpiwrap", "../input", "../fm", "../subsys", "../emd", "thermostat", "../pw", "../pw_env", "../pw/fft"], + "description": "Methods for changing atomic coordinates", + "requires": [ + "../", + "../base", + "../common", + "../mpiwrap", + "../input", + "../fm", + "../subsys", + "../emd", + "thermostat", + "../pw", + "../pw_env", + "../pw/fft", + ], } diff --git a/src/motion/mc/PACKAGE b/src/motion/mc/PACKAGE index a587cc8045..993ab83c17 100644 --- a/src/motion/mc/PACKAGE +++ b/src/motion/mc/PACKAGE @@ -1,4 +1,13 @@ { -"description": "Subroutines for Monte-Carlo simulations", -'requires': ["../..", "../../base", "../../common","../../mpiwrap", "../../input", "../../subsys", "..", "../thermostat"], + "description": "Subroutines for Monte-Carlo simulations", + "requires": [ + "../..", + "../../base", + "../../common", + "../../mpiwrap", + "../../input", + "../../subsys", + "..", + "../thermostat", + ], } diff --git a/src/motion/thermostat/PACKAGE b/src/motion/thermostat/PACKAGE index 2dbcc41a5a..7d607ba85c 100644 --- a/src/motion/thermostat/PACKAGE +++ b/src/motion/thermostat/PACKAGE @@ -1,4 +1,11 @@ { -"description": "The thermostat and barostat", -'requires': ["../..", "../../base", "../../common","../../mpiwrap", "../../input", "../../subsys"], + "description": "The thermostat and barostat", + "requires": [ + "../..", + "../../base", + "../../common", + "../../mpiwrap", + "../../input", + "../../subsys", + ], } diff --git a/src/mpiwrap/PACKAGE b/src/mpiwrap/PACKAGE index 34b24a9492..b407ec4acf 100644 --- a/src/mpiwrap/PACKAGE +++ b/src/mpiwrap/PACKAGE @@ -1,5 +1,5 @@ { -"description": "wrappers of the mpi routines", -"requires": ["../base"], -"implicit": "MPI_.*", + "description": "wrappers of the mpi routines", + "requires": ["../base"], + "implicit": "MPI_.*", } diff --git a/src/pw/PACKAGE b/src/pw/PACKAGE index 4f3214edb6..46c13f402f 100644 --- a/src/pw/PACKAGE +++ b/src/pw/PACKAGE @@ -1,4 +1,4 @@ { -"description": "Real-Space and Plane-Wave Grids", -"requires": [ "fpga", "fft", "../common", "cuda", "../base", "../mpiwrap"], + "description": "Real-Space and Plane-Wave Grids", + "requires": ["fpga", "fft", "../common", "cuda", "../base", "../mpiwrap"], } diff --git a/src/pw/cuda/PACKAGE b/src/pw/cuda/PACKAGE index dfdeefa127..81b020fe0a 100644 --- a/src/pw/cuda/PACKAGE +++ b/src/pw/cuda/PACKAGE @@ -1,5 +1,5 @@ { -"description": "CUDA FFT acceleration", -"requires": [], -"archive": "libcp2kpwcuda", + "description": "CUDA FFT acceleration", + "requires": [], + "archive": "libcp2kpwcuda", } diff --git a/src/pw/fft/PACKAGE b/src/pw/fft/PACKAGE index fc377b1354..042e27a62b 100644 --- a/src/pw/fft/PACKAGE +++ b/src/pw/fft/PACKAGE @@ -1,5 +1,5 @@ { -"description": "Fast Fourier transform", -"requires": ["../../common","../../base"], -"implicit": "DFFTW_.*", + "description": "Fast Fourier transform", + "requires": ["../../common", "../../base"], + "implicit": "DFFTW_.*", } diff --git a/src/pw/fpga/PACKAGE b/src/pw/fpga/PACKAGE index 8970313f5c..bf30584ce2 100644 --- a/src/pw/fpga/PACKAGE +++ b/src/pw/fpga/PACKAGE @@ -1,4 +1,4 @@ { -"description": " FPGA FFT3d implementation", -"requires": [], + "description": " FPGA FFT3d implementation", + "requires": [], } diff --git a/src/pw_env/PACKAGE b/src/pw_env/PACKAGE index f4cd030178..4b76d61c49 100644 --- a/src/pw_env/PACKAGE +++ b/src/pw_env/PACKAGE @@ -1,4 +1,4 @@ { -"description": "Plane Wave Environment - A container for grids stuff", -"requires": ["../base", "../pw", "../common", "../input", "../mpiwrap"], + "description": "Plane Wave Environment - A container for grids stuff", + "requires": ["../base", "../pw", "../common", "../input", "../mpiwrap"], } diff --git a/src/shg_int/PACKAGE b/src/shg_int/PACKAGE index 6354c19f75..54cdb9fa26 100644 --- a/src/shg_int/PACKAGE +++ b/src/shg_int/PACKAGE @@ -1,5 +1,9 @@ { -"description": "2-c integral scheme using solid harmonic Gaussians (SHG)", -"requires": ["../aobasis", "../common", "../base"], -"public": ["generic_shg_integrals.F", "generic_shg_integrals_init.F", "constants_operator.F"] + "description": "2-c integral scheme using solid harmonic Gaussians (SHG)", + "requires": ["../aobasis", "../common", "../base"], + "public": [ + "generic_shg_integrals.F", + "generic_shg_integrals_init.F", + "constants_operator.F", + ], } diff --git a/src/start/PACKAGE b/src/start/PACKAGE index eb81a1e33d..72851f31cb 100644 --- a/src/start/PACKAGE +++ b/src/start/PACKAGE @@ -1,4 +1,17 @@ { -"description": "Entry points of CP2K", -"requires": ["../", "../common", "../input", "../grid", "../pw", "../fm", "../tmc", "../base", "../mpiwrap", "../swarm", "../motion", "../motion/mc"] + "description": "Entry points of CP2K", + "requires": [ + "../", + "../common", + "../input", + "../grid", + "../pw", + "../fm", + "../tmc", + "../base", + "../mpiwrap", + "../swarm", + "../motion", + "../motion/mc", + ], } diff --git a/src/subsys/PACKAGE b/src/subsys/PACKAGE index 47cead6aa3..296e2d0370 100644 --- a/src/subsys/PACKAGE +++ b/src/subsys/PACKAGE @@ -1,6 +1,13 @@ { -"description": "Data structures for communicating with the force_eval interface", - -#TODO: Dependencies on mpiwrap, aobasis, and input should go -'requires': ["../common", "../base", "../pw", "../fm", "../mpiwrap", "../input", "../aobasis"], + "description": "Data structures for communicating with the force_eval interface", + # TODO: Dependencies on mpiwrap, aobasis, and input should go + "requires": [ + "../common", + "../base", + "../pw", + "../fm", + "../mpiwrap", + "../input", + "../aobasis", + ], } diff --git a/src/swarm/PACKAGE b/src/swarm/PACKAGE index c3339fd922..e0795c43f7 100644 --- a/src/swarm/PACKAGE +++ b/src/swarm/PACKAGE @@ -1,4 +1,12 @@ { -"description": "Swarm framework for asynchronous master/worker schemes", -"requires": ["../", "../common", "../mpiwrap", "../input", "../base", "../motion", "../subsys"] + "description": "Swarm framework for asynchronous master/worker schemes", + "requires": [ + "../", + "../common", + "../mpiwrap", + "../input", + "../base", + "../motion", + "../subsys", + ], } diff --git a/src/tmc/PACKAGE b/src/tmc/PACKAGE index 3309fa6ca2..84299cd8cb 100644 --- a/src/tmc/PACKAGE +++ b/src/tmc/PACKAGE @@ -1,4 +1,4 @@ { -"description": "Tree Monte Carlo", -"requires": ["../", "../common", "../input", "../base", "../mpiwrap", "../subsys"] + "description": "Tree Monte Carlo", + "requires": ["../", "../common", "../input", "../base", "../mpiwrap", "../subsys"], } diff --git a/src/xc/PACKAGE b/src/xc/PACKAGE index 6de866422f..e42f4fd7c4 100644 --- a/src/xc/PACKAGE +++ b/src/xc/PACKAGE @@ -1,5 +1,5 @@ { -"description": "Routines dealing with xc functionals in CP2K", -"requires": ["../common", "../pw", "../input", "../base", "../mpiwrap"], -"implicit": "XC_F90_.*", + "description": "Routines dealing with xc functionals in CP2K", + "requires": ["../common", "../pw", "../input", "../base", "../mpiwrap"], + "implicit": "XC_F90_.*", } diff --git a/tools/precommit/precommit.py b/tools/precommit/precommit.py index 3af2d44e00..419695da9a 100755 --- a/tools/precommit/precommit.py +++ b/tools/precommit/precommit.py @@ -104,7 +104,7 @@ def main(): # Find eligible files and sort by size as larger ones will take longer to process. eligible_file_pattern = re.compile( - r"(./data/.*POTENTIALS?)|(.*\.(F|fypp|c|cu|h|py|md))$" + r"(./data/.*POTENTIALS?)|(.*/PACKAGE)|(.*\.(F|fypp|c|cu|h|py|md))$" ) file_list = [fn for fn in candidate_file_list if eligible_file_pattern.match(fn)] file_list.sort(reverse=True, key=lambda fn: os.path.getsize(fn)) @@ -181,7 +181,7 @@ def process_file(fn, allow_modifications): run_remote_tool("clangformat", fn) run_analyze_src(fn) - elif re.match(r".*\.py$", fn): + elif re.match(r"(.*/PACKAGE)|(.*\.py)$", fn): ast.parse(orig_content, filename=fn) run_remote_tool("black", fn) run_analyze_src(fn)