From 8cbd590725fe0e6ef8718b021364d5011898bd50 Mon Sep 17 00:00:00 2001 From: Shyue Ping Ong Date: Mon, 14 Oct 2024 10:31:56 -0700 Subject: [PATCH] Update dev docs --- docs/custodian.gaussian.handlers.md | 32 +++++++++++----------- docs/custodian.gaussian.jobs.md | 12 ++++----- docs/custodian.gaussian.md | 1 - docs/custodian.vasp.utils.md | 41 +++++++++++++++-------------- pyproject.toml | 2 +- 5 files changed, 44 insertions(+), 44 deletions(-) diff --git a/docs/custodian.gaussian.handlers.md b/docs/custodian.gaussian.handlers.md index f1f6ad68..6acf00aa 100644 --- a/docs/custodian.gaussian.handlers.md +++ b/docs/custodian.gaussian.handlers.md @@ -8,7 +8,7 @@ nav_exclude: true This module implements error handlers for Gaussian runs. -### *class* custodian.gaussian.handlers.GaussianErrorHandler(input_file: str, output_file: str, stderr_file: str = 'stderr.txt', cart_coords: bool = True, scf_max_cycles: int = 100, opt_max_cycles: int = 100, job_type: str = 'normal', lower_functional: str | None = None, lower_basis_set: str | None = None, prefix: str = 'error', check_convergence: bool = True) +## *class* custodian.gaussian.handlers.GaussianErrorHandler(input_file: str, output_file: str, stderr_file: str = ‘stderr.txt’, cart_coords: bool = True, scf_max_cycles: int = 100, opt_max_cycles: int = 100, job_type: str = ‘normal’, lower_functional: str | None = None, lower_basis_set: str | None = None, prefix: str = ‘error’, check_convergence: bool = True) Bases: `ErrorHandler` @@ -41,19 +41,19 @@ Initialize the GaussianErrorHandler class. be monitored and plotted (convergence criteria versus cycle number) and saved to a file called ‘convergence.png’. -#### GRID_NAMES *= ('finegrid', 'fine', 'superfinegrid', 'superfine', 'coarsegrid', 'coarse', 'sg1grid', 'sg1', 'pass0grid', 'pass0')* +### GRID_NAMES *= (‘finegrid’, ‘fine’, ‘superfinegrid’, ‘superfine’, ‘coarsegrid’, ‘coarse’, ‘sg1grid’, ‘sg1’, ‘pass0grid’, ‘pass0’)* -#### MEM_UNITS *= ('kb', 'mb', 'gb', 'tb', 'kw', 'mw', 'gw', 'tw')* +### MEM_UNITS *= (‘kb’, ‘mb’, ‘gb’, ‘tb’, ‘kw’, ‘mw’, ‘gw’, ‘tw’)* -#### activate_better_guess *= False* +### activate_better_guess *= False* -#### check(directory: str = './') +### check(directory: str = ‘./’) Check for errors in the Gaussian output file. -#### conv_criteria*: ClassVar* *= {'max_disp': re.compile('\\\\s+(Maximum Displacement)\\\\s+(-?\\\\d+.?\\\\d\*|.\*)\\\\s+(-?\\\\d+.?\\\\d\*)'), 'max_force': re.compile('\\\\s+(Maximum Force)\\\\s+(-?\\\\d+.?\\\\d\*|.\*)\\\\s+(-?\\\\d+.?\\\\d\*)'), 'rms_disp': re.compile('\\\\s+(RMS {5}Displacement)\\\\s+(-?\\\\d+.?\\\\d\*|.\*)\\\\s+(-?\\\\d+.?\\\\d\*)'), 'rms_force': re.compile('\\\\s+(RMS {5}Force)\\\\s+(-?\\\\d+.?\\\\d\*|.\*)\\\\s+(-?\\\\d+.?\\\\d\*)')}* +### conv_criteria\*: ClassVar\* *= {‘max_disp’: re.compile(’\\s+(Maximum Displacement)\\s+(-?\\d+.?\\d\*|.\*)\\s+(-?\\d+.?\\d\*)’), ‘max_force’: re.compile(’\\s+(Maximum Force)\\s+(-?\\d+.?\\d\*|.\*)\\s+(-?\\d+.?\\d\*)’), ‘rms_disp’: re.compile(’\\s+(RMS {5}Displacement)\\s+(-?\\d+.?\\d\*|.\*)\\s+(-?\\d+.?\\d\*)’), ‘rms_force’: re.compile(’\\s+(RMS {5}Force)\\s+(-?\\d+.?\\d\*|.\*)\\s+(-?\\d+.?\\d\*)’)}* -#### *static* convert_mem(mem: float, unit: str) +### *static* convert_mem(mem: float, unit: str) Convert memory size between different units to megabytes (MB). @@ -67,19 +67,19 @@ Convert memory size between different units to megabytes (MB). * **Return type:** float -#### correct(directory: str = './') +### correct(directory: str = ‘./’) Perform necessary actions to correct the errors in the Gaussian output. -#### error_defs*: ClassVar* *= {'A syntax error was detected in the input line.': 'syntax', 'Atom specifications unexpectedly found in input stream.': 'found_coords', 'Bad file opened by FileIO': 'bad_file', 'Convergence failure': 'scf_convergence', 'End of file in ZSymb': 'zmatrix', 'End of file reading connectivity.': 'coords', 'Error in internal coordinate system': 'internal_coords', 'FileIO operation on non-existent file.': 'missing_file', 'FormBX had a problem': 'linear_bend', 'Inv3 failed in PCMMkU': 'solute_solvent_surface', 'Linear angle in Tors.': 'linear_bend', 'No data on chk file.': 'empty_file', 'Optimization stopped': 'opt_steps', 'Out-of-memory error in routine': 'insufficient_mem', 'The combination of multiplicity ([0-9]+) and \\\\s+? ([0-9]+) electrons is impossible.': 'charge', 'There are no atoms in this input structure !': 'missing_mol', 'Z-matrix optimization but no Z-matrix variables.': 'coord_inputs'}* +### error_defs\*: ClassVar\* *= {‘A syntax error was detected in the input line.’: ‘syntax’, ‘Atom specifications unexpectedly found in input stream.’: ‘found_coords’, ‘Bad file opened by FileIO’: ‘bad_file’, ‘Convergence failure’: ‘scf_convergence’, ‘End of file in ZSymb’: ‘zmatrix’, ‘End of file reading connectivity.’: ‘coords’, ‘Error in internal coordinate system’: ‘internal_coords’, ‘FileIO operation on non-existent file.’: ‘missing_file’, ‘FormBX had a problem’: ‘linear_bend’, ‘Inv3 failed in PCMMkU’: ‘solute_solvent_surface’, ‘Linear angle in Tors.’: ‘linear_bend’, ‘No data on chk file.’: ‘empty_file’, ‘Optimization stopped’: ‘opt_steps’, ‘Out-of-memory error in routine’: ‘insufficient_mem’, ‘The combination of multiplicity ([0-9]+) and \\s+? ([0-9]+) electrons is impossible.’: ‘charge’, ‘There are no atoms in this input structure !’: ‘missing_mol’, ‘Z-matrix optimization but no Z-matrix variables.’: ‘coord_inputs’}* -#### error_patt *= re.compile('Optimization stopped|Convergence failure|FormBX had a problem|Linear angle in Tors.|Inv3 failed in PCMMkU|Error in internal coordinate system|End of file in ZSymb|There are no atoms in this input str)* +### error_patt *= re.compile(‘Optimization stopped|Convergence failure|FormBX had a problem|Linear angle in Tors.|Inv3 failed in PCMMkU|Error in internal coordinate system|End of file in ZSymb|There are no atoms in this input str)* -#### grid_patt *= re.compile('(-?\\\\d{5})')* +### grid_patt *= re.compile(‘(-?\\d{5})’)* -#### recom_mem_patt *= re.compile('Use %mem=([0-9]+)MW to provide the minimum amount of memory required to complete this step.')* +### recom_mem_patt *= re.compile(‘Use %mem=([0-9]+)MW to provide the minimum amount of memory required to complete this step.’)* -### *class* custodian.gaussian.handlers.WallTimeErrorHandler(wall_time: int, buffer_time: int, input_file: str, output_file: str, stderr_file: str = 'stderr.txt', prefix: str = 'error') +## *class* custodian.gaussian.handlers.WallTimeErrorHandler(wall_time: int, buffer_time: int, input_file: str, output_file: str, stderr_file: str = ‘stderr.txt’, prefix: str = ‘error’) Bases: `ErrorHandler` @@ -102,15 +102,15 @@ Initialize the WalTimeErrorHandler class. which means a series of error.1.tar.gz, error.2.tar.gz, … will be generated. -#### check(directory: str = './') +### check(directory: str = ‘./’) Check if the job is nearing the walltime. If so, return True, else False. -#### correct(directory: str = './') +### correct(directory: str = ‘./’) Perform the corrections. -#### is_monitor*: bool* *= True* +### is_monitor\*: bool\* *= True* This class property indicates whether the error handler is a monitor, i.e., a handler that monitors a job as it is running. If a diff --git a/docs/custodian.gaussian.jobs.md b/docs/custodian.gaussian.jobs.md index c6fc4fe8..322ce24b 100644 --- a/docs/custodian.gaussian.jobs.md +++ b/docs/custodian.gaussian.jobs.md @@ -8,7 +8,7 @@ nav_exclude: true This module implements basic kinds of jobs for Gaussian runs. -### *class* custodian.gaussian.jobs.GaussianJob(gaussian_cmd: str, input_file: str, output_file: str, stderr_file: str = 'stderr.txt', suffix: str = '', backup: bool = True) +## *class* custodian.gaussian.jobs.GaussianJob(gaussian_cmd: str, input_file: str, output_file: str, stderr_file: str = ‘stderr.txt’, suffix: str = ‘’, backup: bool = True) Bases: `Job` @@ -26,7 +26,7 @@ A basic Gaussian job. * **backup** (*bool*) – Whether to backup the input file. If True, the input will be copied with a “.orig” appended to the name. Defaults to True. -#### *classmethod* generate_better_guess(gaussian_cmd: str, input_file: str, output_file: str, stderr_file: str = 'stderr.txt', backup: bool = True, cart_coords: bool = True, directory: str = './') +### *classmethod* generate_better_guess(gaussian_cmd: str, input_file: str, output_file: str, stderr_file: str = ‘stderr.txt’, backup: bool = True, cart_coords: bool = True, directory: str = ‘./’) Generate a better initial guess for a Gaussian calculation (optimization or SCF run). This is done by running the job at a lower level of theory @@ -46,7 +46,7 @@ generated by the previous job. * **Yields:** *GaussianJob* – The Gaussian job instance. -#### postprocess(directory: str = './') +### postprocess(directory: str = ‘./’) Perform any postprocessing of the Gaussian run. This includes making a copy of the input and output file if a suffix is specified. @@ -54,7 +54,7 @@ of the input and output file if a suffix is specified. * **Parameters:** **directory** (*str*) – Directory where the job was run. Defaults to ‘./’. -#### run(directory: str = './') +### run(directory: str = ‘./’) Perform the actual Gaussian run. @@ -65,7 +65,7 @@ Perform the actual Gaussian run. * **Return type:** subprocess.Popen -#### setup(directory: str = './') +### setup(directory: str = ‘./’) Perform initial setup for the job, i.e., make a backup of the input file if requested. @@ -73,7 +73,7 @@ requested. * **Parameters:** **directory** (*str*) – Directory where the job will be run. Defaults to ‘./’. -#### terminate(directory: str = './') +### terminate(directory: str = ‘./’) Terminate the Gaussian job. diff --git a/docs/custodian.gaussian.md b/docs/custodian.gaussian.md index cc867c56..4f40d742 100644 --- a/docs/custodian.gaussian.md +++ b/docs/custodian.gaussian.md @@ -8,7 +8,6 @@ nav_exclude: true This package implements various Gaussian Jobs and Error Handlers. - * [custodian.gaussian.handlers module](custodian.gaussian.handlers.md) * [`GaussianErrorHandler`](custodian.gaussian.handlers.md#custodian.gaussian.handlers.GaussianErrorHandler) * [`GaussianErrorHandler.GRID_NAMES`](custodian.gaussian.handlers.md#custodian.gaussian.handlers.GaussianErrorHandler.GRID_NAMES) diff --git a/docs/custodian.vasp.utils.md b/docs/custodian.vasp.utils.md index c0182c69..5ce00f31 100644 --- a/docs/custodian.vasp.utils.md +++ b/docs/custodian.vasp.utils.md @@ -8,29 +8,30 @@ nav_exclude: true Utility methods for VASP error handlers. -### custodian.vasp.utils.increase_k_point_density(kpoints: Kpoints | dict | float, structure: Structure, factor: float = 0.1, max_inc: int = 500, min_kpoints: int = 1, force_gamma: bool = True) +## custodian.vasp.utils.increase_k_point_density(kpoints: Kpoints | dict | float, structure: Structure, factor: float = 0.1, max_inc: int = 500, min_kpoints: int = 1, force_gamma: bool = True) Inputs: : kpoints (Kpoints, dict, float, int) : - : If a dict or Kpoints object: original Kpoints used in the calculation - If a float: the original KSPACING used in the calculation -
- structure (Structure) : associated structure - factor (float) : factor used to increase k-point density. -
- > The first increase uses approximately (1 + factor) higher k-point density. - > The second increase: ~ (1 + 2\*factor) higher k-kpoint density, etc. - max_inc (int) - : before giving up -
- min_kpoints (int): The minimum permitted number of k-points. - : Can be useful if using the tetrahedron method, where - at least 4 k-points are needed. -
- force_gamma (bool) = True: whether to use Gamma-centered or - : Monkhorst-Pack grids +: If a dict or Kpoints object: original Kpoints used in the calculation +If a float: the original KSPACING used in the calculation +
+structure (Structure) : associated structure +factor (float) : factor used to increase k-point density. +
+ +> The first increase uses approximately (1 + factor) higher k-point density. +> The second increase: ~ (1 + 2\*factor) higher k-kpoint density, etc. +> max_inc (int) +> : before giving up +>
+> min_kpoints (int): The minimum permitted number of k-points. +> : Can be useful if using the tetrahedron method, where +> at least 4 k-points are needed. +>
+> force_gamma (bool) = True: whether to use Gamma-centered or +> : Monkhorst-Pack grids Outputs: : dict : - : The new Kpoints object / KSPACING consistent with constraints. - If an empty dict, no new k-point mesh could be found. \ No newline at end of file +: The new Kpoints object / KSPACING consistent with constraints. +If an empty dict, no new k-point mesh could be found. \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index c72cab9f..90193f03 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "custodian" -version = "2024.6.24" +version = "2024.10.14" description = "A simple JIT job management framework in Python." authors = [ { name = "Janosh Riebesell", email = "janosh.riebesell@gmail.com" },