Skip to content

Commit

Permalink
make new default more consistent; allow setting to 'none'
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Müller <[email protected]>
  • Loading branch information
marcelmbn committed Feb 17, 2025
1 parent 3c248d9 commit 0bcc7c7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- dict keys for elemental compositions will now always be checked for validity
- Renamed GP3-xTB to g-xTB
- Moved constants and (empirical) parameters to the `data` module
- Default for optimization cycles in the postprocessing step set to program default (convergence)

### Deprecated
- Nothing will be printed while multiple molecules are generated in parallel, tqdm-based progress bar instead
Expand All @@ -20,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- support for TURBOMOLE as QM engine
- updated the parallelization to work over the number of molecules
- possibility to generate symmetrical molecules (choice from rotation, inversion, mirroring)
- Number of optimization steps in the postprocessing part can be set to program default by `none`

### Fixed
- version string is now correctly formatted and printed
Expand Down
4 changes: 2 additions & 2 deletions mindlessgen.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ ncores = 2
engine = "orca"
# > Optimize geometry in the post-processing part. If `false`, only a single-point is conducted. Options: <bool>
optimize = true
# > Optimization cycles for the post-processing part. If not given, the program default is chosen. Options: <int>
opt_cycles = 5
# > Optimization cycles for the post-processing part. If not given or set to "none" or 0, the program default is chosen. Options: <int> or "none"
opt_cycles = "none"
# > Debug this step. Leads to more verbose output as soon as the post-processing part is reached. Options: <bool>
# > If `debug` is true, the process is terminated after the first (successful or not) post-processing step.
# > Note: This option is only relevant if the 'postprocess' option in the 'general' section is set to 'true'.
Expand Down
14 changes: 11 additions & 3 deletions src/mindlessgen/prog/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,10 +795,18 @@ def opt_cycles(self, opt_cycles: int):
"""
Set the optimization cycles for post-processing.
"""
if not isinstance(opt_cycles, int):
raise TypeError("Optimization cycles should be an integer.")
if not isinstance(opt_cycles, (int, str)):
raise TypeError("Optimization cycles can only be an integer or a string.")
if isinstance(opt_cycles, str):
if opt_cycles.lower() != "none":
raise ValueError(
"Optimization cycles can only be an integer or 'none'."
)
self._opt_cycles = None
if opt_cycles == 0:
self._opt_cycles = None
if opt_cycles < 0:
raise ValueError("Optimization cycles should be 0 or greater.")
raise ValueError("Optimization cycles can only be 0 or greater.")
self._opt_cycles = opt_cycles

@property
Expand Down

0 comments on commit 0bcc7c7

Please sign in to comment.