Skip to content

Commit

Permalink
Update dev docs
Browse files Browse the repository at this point in the history
  • Loading branch information
shyuep committed Oct 14, 2024
1 parent e286d16 commit 8cbd590
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 44 deletions.
32 changes: 16 additions & 16 deletions docs/custodian.gaussian.handlers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down Expand Up @@ -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).

Expand All @@ -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`

Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions docs/custodian.gaussian.jobs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand All @@ -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
Expand All @@ -46,15 +46,15 @@ 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.

* **Parameters:**
**directory** (*str*) – Directory where the job was run. Defaults to ‘./’.

#### run(directory: str = './')
### run(directory: str = ‘./’)

Perform the actual Gaussian run.

Expand All @@ -65,15 +65,15 @@ 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.

* **Parameters:**
**directory** (*str*) – Directory where the job will be run. Defaults to ‘./’.

#### terminate(directory: str = './')
### terminate(directory: str = ‘./’)

Terminate the Gaussian job.

Expand Down
1 change: 0 additions & 1 deletion docs/custodian.gaussian.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
41 changes: 21 additions & 20 deletions docs/custodian.vasp.utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<br/>
structure (Structure) : associated structure
factor (float) : factor used to increase k-point density.
<br/>
> 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
<br/>
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.
<br/>
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
<br/>
structure (Structure) : associated structure
factor (float) : factor used to increase k-point density.
<br/>

> 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
> <br/>
> 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.
> <br/>
> 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.
: The new Kpoints object / KSPACING consistent with constraints.
If an empty dict, no new k-point mesh could be found.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "[email protected]" },
Expand Down

0 comments on commit 8cbd590

Please sign in to comment.