Skip to content

Commit 37913dd

Browse files
authored
Update Docs (#72)
* update docs, co-workers, pyproject.toml, remove typos Signed-off-by: Marcel Müller <marcel.mueller@thch.uni-bonn.de> * update CHANGELOG, make case more consistent Signed-off-by: Marcel Müller <marcel.mueller@thch.uni-bonn.de> * update mindlessgen.toml Signed-off-by: Marcel Müller <marcel.mueller@thch.uni-bonn.de> * align defaults Signed-off-by: Marcel Müller <marcel.mueller@thch.uni-bonn.de> * update reference default value Signed-off-by: Marcel Müller <marcel.mueller@thch.uni-bonn.de> * update tests Signed-off-by: Marcel Müller <marcel.mueller@thch.uni-bonn.de> * correct inconsistent boolean Signed-off-by: Marcel Müller <marcel.mueller@thch.uni-bonn.de> --------- Signed-off-by: Marcel Müller <marcel.mueller@thch.uni-bonn.de>
1 parent d064d3d commit 37913dd

8 files changed

Lines changed: 95 additions & 67 deletions

File tree

.github/CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
# These parts are specifically owned by some people
88
/src/mindlessgen/cli @marcelmbn
99
/src/mindlessgen/generator @marcelmbn
10-
/src/mindlessgen/molecules @marcelmbn
11-
/src/mindlessgen/prog @marcelmbn
10+
/src/mindlessgen/molecules @marcelmbn @jonathan-schoeps
11+
/src/mindlessgen/prog @marcelmbn @jonathan-schoeps
1212
/src/mindlessgen/qm @marcelmbn

CHANGELOG.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
## [Unreleased]
88
### Changed
99
- vdW radii scaling parameter can now be adjusted via `mindlessgen.toml` or CLI
10-
- The check_distance function now checks based on the sum of the van der Waals radii and a scaling factor acessible via `mindlessgen.toml` or CLI
10+
- check_distance function now checks based on the sum of the van der Waals radii and a scaling factor acessible via `mindlessgen.toml` or CLI
1111
- better type hints for `Callables`
12-
- A clearer differentiation between the distinct scaling factors for the van der Waals radii.
13-
- `README.md` with more detailed explanation of the element composition function.
12+
- clearer differentiation between the distinct scaling factors for the van der Waals radii
13+
- `README.md` with more detailed explanation of the element composition function
14+
- Default `max_cycles` for the generation & refinement set to 200
1415

1516
### Fixed
16-
- Unit conversion for (currenly unused) vdW radii from the original Fortran project
17+
- unit conversion for (currenly unused) vdW radii from the original Fortran project
1718
- minor print output issues (no new line breaks, more consistent verbosity differentiation, ...)
1819
- bug in `postprocess_mol` which led to an unassigned return variable in the single-point case
20+
- bug leading to `UnicodeDecodeError` when reading `xtb` output files
1921
- bug with all atom lists being initialized with a length of 102 instead of 103
22+
- inconsistent default values for the `mindlessgen.toml` and the `ConfigManager` class
2023

2124
### Added
22-
- Support for the novel "g-xTB" method (working title: GP3-xTB)
23-
- A function which contracts the coordinates after the initial generation.
24-
- A function which is able to printout the xyz coordinates to the terminal similar to the `.xyz` layout.
25-
- Elements 87 to 103 are accessible via the element composition. If `xtb` is the engine, the elements will be replaced by their lighter homologues.
25+
- support for the novel "g-xTB" method (working title: GP3-xTB)
26+
- function which contracts the coordinates after the initial generation
27+
- function which is able to printout the xyz coordinates to the terminal similar to the `.xyz` layout
28+
- elements 87 to 103 are accessible via the element composition. If `xtb` is the engine, the elements will be replaced by their lighter homologues.
29+
- support for `python-3.13`
2630

2731
### Breaking Changes
2832
- Removal of the `dist_threshold` flag and in the `-toml` file.
2933
- The number of unpaired electrons (`Molecule.uhf`) is now set to 0 if `xtb` is used as `QMMethod` and a lanthanide is within the molecule to match the `f-in-core` approximation.
34+
- "Contract Coordinates" functionality set to `true` by default in the `mindlessgen.toml` file.
3035

3136
## [0.4.0] - 2024-09-19
3237
### Changed

README.md

Lines changed: 47 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<a href="http://www.apache.org/licenses/LICENSE-2.0">
55
<img src="https://img.shields.io/badge/License-Apache%202.0-orange.svg" alt="Apache-2.0"/>
66
</a>
7-
<a href="https://img.shields.io/badge/Python-3.10%20|%203.11%20|%203.12-blue.svg">
8-
<img src="https://img.shields.io/badge/Python-3.10%20|%203.11|%203.12-blue.svg" alt="Python Versions"/>
7+
<a href="https://img.shields.io/badge/Python-3.10%20|%203.11%20|%203.12%20|%203.13-blue.svg">
8+
<img src="https://img.shields.io/badge/Python-3.10%20|%203.11%20|%203.12%20|%203.13-blue.svg" alt="Python Versions"/>
99
</a>
1010
<img align="right" src="assets/C1H2N1O2Te2Er1Lu2_89bd3e.png" height="150" />
1111

@@ -49,10 +49,10 @@ Both installation methods work in principle also without a virtual environment,
4949
### Development purposes
5050

5151
For working on the code of `mindlessgen`, the following setup is recommended:
52-
```
52+
```bash
5353
mamba create -n mindlessgen python=3.12
5454
mamba activate mindlessgen
55-
git clone {link to the MindlessGen repository}
55+
git clone https://github.com/grimme-lab/MindlessGen.git # or the analogous SSH link
5656
pip install -e '.[dev]'
5757
```
5858
Thereby, all necessary development tools (e.g., `ruff`, `mypy`, `tox`, `pytest`, and `pre-commit`) are installed.
@@ -82,11 +82,12 @@ If the path is not specified with `-c/--config`, `mindlessgen.toml` will be sear
8282
1. Current working directory (`$CWD`)
8383
2. Home directory (`$USER/`)
8484

85-
The active configuration can be printed using `--print-config`.
85+
If neither a corresponding CLI command nor an entry in the configuration file is provided, the default values are used.
86+
The active configuration, including the default values, can be printed using `--print-config`.
8687

8788
### Element composition
8889
There are two related aspects of the element composition:
89-
1. _Which elements_ should occur within the generated molecule?
90+
1. **Which elements** should occur within the generated molecule?
9091
2. **How many atoms** of the specified element should occur?
9192
- **Example 1**: `C:1-3, O:1-1, H:1-*` would result in a molecule with 1, 2, or 3 carbon atoms, exactly 1 oxygen atom, and between 1 and an undefined number of hydrogen atoms (i.e., at least 1).
9293
- **Example 2**: `Na:10-10, In:10-10, O:20-20`. This example would result in a molecule with exactly 10 sodium atoms, 10 indium atoms, and 20 oxygen atoms. **For a fixed element composition, the number of atoms (40) has to be within the min_num_atoms and max_num_atom interval.** `mindlessgen` will consequently always return a molecule with exactly 40 atoms.
@@ -98,28 +99,46 @@ There are two related aspects of the element composition:
9899
99100
## Citation
100101

101-
When using the program for academic purposes, please cite:
102-
103-
_J. Chem. Theory Comput._ 2009, **5**, 4, 993–1003
104-
105-
or in `BibTeX` format:
106-
```
107-
@article{doi:10.1021/ct800511q,
108-
author = {Korth, Martin and Grimme, Stefan},
109-
title = {“Mindless” DFT Benchmarking},
110-
journal = {Journal of Chemical Theory and Computation},
111-
volume = {5},
112-
number = {4},
113-
pages = {993-1003},
114-
year = {2009},
115-
doi = {10.1021/ct800511q},
116-
note ={PMID: 26609608},
117-
URL = {https://doi.org/10.1021/ct800511q},
118-
eprint = {https://doi.org/10.1021/ct800511q}
119-
}
120-
```
121-
122-
## Acknowdledgements
102+
When using the program for academic purposes, please cite _i)_ the original idea and _ii)_ the new Python implementation.
103+
104+
1. _J. Chem. Theory Comput._ 2009, **5**, 4, 993–1003
105+
```
106+
@article{korth_mindless_2009,
107+
title = {Mindless {DFT} benchmarking},
108+
volume = {5},
109+
issn = {15499618},
110+
url = {https://pubs.acs.org/doi/full/10.1021/ct800511q},
111+
doi = {10.1021/ct800511q},
112+
number = {4},
113+
urldate = {2022-11-07},
114+
journal = {J. Chem. Theo. Comp.},
115+
author = {Korth, Martin and Grimme, Stefan},
116+
month = apr,
117+
year = {2009},
118+
note = {Publisher: American Chemical Society},
119+
pages = {993--1003},
120+
}
121+
```
122+
123+
2. A new publication featuring all functionalities and improvements of `mindlessgen` is in preparation.
124+
In the meantime, please refer to the original publication and to the following preprint, which uses the `mindlessgen` program for the first time:
125+
Müller, M.; Froitzheim, T.; Hansen, A.; Grimme, S. _ChemRxiv_ October 28, 2024. https://doi.org/10.26434/chemrxiv-2024-h76ms.
126+
```
127+
@misc{muller_advanced_2024,
128+
title = {Advanced {Charge} {Extended} {Hückel} ({CEH}) {Model} and a {Consistent} {Adaptive} {Minimal} {Basis} {Set} for the {Elements} {Z}=1-103},
129+
url = {https://chemrxiv.org/engage/chemrxiv/article-details/671a92581fb27ce1247466ad},
130+
doi = {10.26434/chemrxiv-2024-h76ms},
131+
urldate = {2024-10-28},
132+
publisher = {ChemRxiv},
133+
author = {Müller, Marcel and Froitzheim, Thomas and Hansen, Andreas and Grimme, Stefan},
134+
month = oct,
135+
year = {2024},
136+
keywords = {DFT, Basis sets, EHT, SQM},
137+
}
138+
```
139+
140+
## Acknowledgements
123141
124142
[T. Gasevic](https://github.com/gasevic) for creating an initial `GitHub` [migration](https://github.com/gasevic/mlmgen) of the code and making important adjustments to the workflow.
125143
[S. Grimme](https://www.chemie.uni-bonn.de/grimme/de/grimme) and M. Korth for the original code written in Fortran associated to the publication in [J. Chem. Theory Comput.](https://pubs.acs.org/doi/full/10.1021/ct800511q).
144+
[T. Froitzheim](https://github.com/thfroitzheim) for helpful discussons during the development of the program.

mindlessgen.toml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
# Default configuration for the 'Mindless Molecule GENerator' (MindlessGen) package
2-
# Following file locations are searched for in the following order:
1+
# Default configuration for the 'Mindless Molecule Generator' (MindlessGen) package
2+
# The following file locations are searched for in ascending order:
33
# 1. Location specified by the `--config < str | Path >` command-line argument
44
# 2. Current working directory (`Path.cwd()`)
55
# 3. User's home directory (`Path.home()`)
66

77
[general]
8-
# > Verbosity level defining the printout: Options: 0 = silent, 1 = default, 2 = verbose, 3 = debug
8+
# > Verbosity level defining the printout: Options: -1 = super-silent, 0 = silent, 1 = default, 2 = verbose, 3 = debug
99
verbosity = 1
1010
# > Number of parallel processes to use. Corresponds to the number of physical CPU cores used. Options: <int>
1111
parallel = 1
12-
# > Maximum number of generation/optimization try-and-error cycles per molecule. Options: <int>
13-
max_cycles = 100
12+
# > Maximum number of generation & optimization try-and-error cycles per molecule. Options: <int>
13+
max_cycles = 200
1414
# > Number of molecules to generate. Options: <int>
1515
num_molecules = 1
16-
# > Do post-processing (checking for HL gap, etc.) after the optimization. Options: <bool>
16+
# > Do post-processing after the optimization with another engine (e.g., `orca`). Default: false. Options: <bool>
1717
postprocess = false
18-
# > Switch molecule structure XYZ writing on and off (default: true). Options: <bool>
18+
# > Switch molecule structure XYZ writing on and off. Default: true. Options: <bool>
1919
write_xyz = true
2020

2121
[generate]
@@ -26,21 +26,21 @@ max_num_atoms = 10
2626
# > Initial coordinate scaling factor. Options: <float>
2727
init_scaling = 3.0
2828
# > Increase in the coordinate scaling factor per trial after check_distance was not met. Options: <float>
29-
increase_scaling_factor = 1.3
29+
increase_scaling_factor = 1.1
3030
# > Scaling factor for the van der Waals radii employed for the fragment detection. Options: <float>
3131
scale_fragment_detection = 1.25
3232
# > Scaling factor for the minimal distance between two atoms based on the sum of the van der Waals radii. Options: <float>
3333
scale_minimal_distance = 0.8
34-
# > Contract the coordinates after the initial generation. Leads to more cluster-like and less extended structures. Options: <bool>
35-
contract_coords = false
34+
# > Contract the coordinates after the initial generation. Leads to more cluster-like and less extended structures
35+
# and can speed-up the generation for larger molecules significantly. Options: <bool>
36+
contract_coords = true
3637
# > Atom types and their minimum and maximum occurrences. Format: "<element>:<min_count>-<max_count>"
3738
# > Elements that are not specified are only added by random selection.
3839
# > A star sign (*) can be used as a wildcard for integer value.
3940
element_composition = "C:2-3, H:1-2, O:1-2, N:1-*"
4041
# > Atom types that are not chosen for random selection. Format: "<element1>, <element2>, ..."
4142
# > CAUTION: This option is overridden by the 'element_composition' option.
4243
# > I.e., if an element is specified in 'element_composition' with an occurrence > 0, it will be added to the molecule anyway.
43-
# > Example: forbidden_elements = "18,57-*"
4444
forbidden_elements = "57-71, 81-*"
4545

4646
[refine]

pyproject.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@ build-backend = "setuptools.build_meta"
66
name = "mindlessgen"
77
authors = [
88
{ name = "Marcel Müller", email = "marcel.mueller@thch.uni-bonn.de" },
9+
{ name = "Jonathan Schöps", email = "s6jtscho@uni-bonn.de" },
910
]
10-
description = "Mindless Molecule GENerator"
11+
description = "Mindless Molecule Generator"
1112
readme = "README.md"
1213
requires-python = ">=3.10"
1314
license = { file = "LICENSE.md" }
1415
classifiers = [
15-
"License :: OSI Approved :: MIT License",
16+
"License :: OSI Approved :: Apache-2.0 License",
1617
"Programming Language :: Python :: 3 :: Only",
1718
"Programming Language :: Python :: 3.10",
1819
"Programming Language :: Python :: 3.11",
1920
"Programming Language :: Python :: 3.12",
21+
"Programming Language :: Python :: 3.13",
2022
"Topic :: Scientific/Engineering",
2123
"Typing :: Typed",
2224
]

src/mindlessgen/prog/config.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class GeneralConfig(BaseConfig):
3737

3838
def __init__(self: GeneralConfig) -> None:
3939
self._verbosity: int = 1
40-
self._max_cycles: int = 100
40+
self._max_cycles: int = 200
4141
self._print_config: bool = False
4242
self._parallel: int = 1
4343
self._num_molecules: int = 1
@@ -174,15 +174,15 @@ class GenerateConfig(BaseConfig):
174174
"""
175175

176176
def __init__(self: GenerateConfig) -> None:
177-
self._min_num_atoms: int = 2
178-
self._max_num_atoms: int = 100
177+
self._min_num_atoms: int = 5
178+
self._max_num_atoms: int = 10
179179
self._init_coord_scaling: float = 3.0
180-
self._increase_scaling_factor: float = 1.3
180+
self._increase_scaling_factor: float = 1.1
181181
self._element_composition: dict[int, tuple[int | None, int | None]] = {}
182182
self._forbidden_elements: list[int] | None = None
183183
self._scale_fragment_detection: float = 1.25
184184
self._scale_minimal_distance: float = 0.8
185-
self._contract_coords: bool = False
185+
self._contract_coords: bool = True
186186

187187
def get_identifier(self) -> str:
188188
return "generate"
@@ -409,7 +409,7 @@ class RefineConfig(BaseConfig):
409409
"""
410410

411411
def __init__(self: RefineConfig) -> None:
412-
self._max_frag_cycles: int = 100
412+
self._max_frag_cycles: int = 10
413413
self._engine: str = "xtb"
414414
self._hlgap: float = 0.5
415415
self._debug: bool = False
@@ -495,8 +495,8 @@ class PostProcessConfig(BaseConfig):
495495

496496
def __init__(self: PostProcessConfig) -> None:
497497
self._engine: str = "orca"
498-
self._opt_cycles: int | None = None
499-
self._optimize: bool = False
498+
self._opt_cycles: int | None = 5
499+
self._optimize: bool = True
500500
self._debug: bool = False
501501

502502
def get_identifier(self) -> str:
@@ -624,7 +624,7 @@ class ORCAConfig(BaseConfig):
624624
def __init__(self: ORCAConfig) -> None:
625625
self._orca_path: str | Path = "orca"
626626
self._functional: str = "PBE"
627-
self._basis: str = ""
627+
self._basis: str = "def2-SVP"
628628
self._gridsize: int = 1
629629
self._scf_cycles: int = 100
630630

test/test_config/test_config_set_attributes.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def test_general_config_property_setters(
4343
"property_name, initial_value",
4444
[
4545
("verbosity", 1),
46-
("max_cycles", 100),
46+
("max_cycles", 200),
4747
("print_config", False),
4848
("parallel", 1),
4949
("num_molecules", 1),
@@ -110,10 +110,10 @@ def test_generate_config_element_composition(
110110
@pytest.mark.parametrize(
111111
"property_name, initial_value",
112112
[
113-
("min_num_atoms", 2),
114-
("max_num_atoms", 100),
113+
("min_num_atoms", 5),
114+
("max_num_atoms", 10),
115115
("init_coord_scaling", 3.0),
116-
("increase_scaling_factor", 1.3),
116+
("increase_scaling_factor", 1.1),
117117
("element_composition", {}),
118118
("forbidden_elements", None),
119119
],
@@ -127,8 +127,8 @@ def test_generate_config_default_values(property_name, initial_value):
127127
@pytest.mark.parametrize(
128128
"property_name, valid_value, invalid_value, expected_exception",
129129
[
130-
("max_frag_cycles", 100, -1, ValueError),
131-
("max_frag_cycles", 100, "100", TypeError),
130+
("max_frag_cycles", 200, -1, ValueError),
131+
("max_frag_cycles", 200, "100", TypeError),
132132
("engine", "xtb", 123, TypeError),
133133
("engine", "xtb", "g16", ValueError),
134134
],
@@ -150,7 +150,7 @@ def test_refine_config_property_setters(
150150
@pytest.mark.parametrize(
151151
"property_name, initial_value",
152152
[
153-
("max_frag_cycles", 100),
153+
("max_frag_cycles", 10),
154154
("engine", "xtb"),
155155
],
156156
)

test/test_molecules/test_refinement.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ def test_iterative_optimization(mol_C13H14: Molecule, mol_C7H8: Molecule) -> Non
122122
"""
123123
# initialize a configuration object
124124
config = ConfigManager()
125+
config.generate.min_num_atoms = 2
126+
config.generate.max_num_atoms = 100
125127
config.refine.hlgap = 0.001 # TODO: Change charge assignment such that
126128
# fragment charge is not completely random anymore. Currently, that's the
127129
# reason for a virtually switched off HL gap check (fragment can be -2, 0, 2)

0 commit comments

Comments
 (0)