diff --git a/about.py b/about.py index 13e8d9b..2bb1f00 100644 --- a/about.py +++ b/about.py @@ -57,7 +57,7 @@ # Do nothing to data other than add message with version and path info output["message"] = ( "avo_xtb plugin\n" - + f"easyxtb version: {easyxtb.conf.easyxtb_VERSION}\n" + + f"easyxtb version: {easyxtb.configuration.easyxtb_VERSION}\n" + f"xtb version: {xtb_version}\n" + f"xtb path: {easyxtb.XTB_BIN}\n" + f"CREST version: {crest_version}\n" diff --git a/config.py b/config.py index 8417477..7380261 100644 --- a/config.py +++ b/config.py @@ -134,7 +134,7 @@ # Save change to user_dir if there has been one if avo_input["user_dir"] != str(easyxtb.CALC_DIR): easyxtb.CALC_DIR = Path(avo_input["user_dir"]) - easyxtb.conf.TEMP_DIR = easyxtb.CALC_DIR / "last" + easyxtb.configuration.TEMP_DIR = easyxtb.CALC_DIR / "last" try: easyxtb.TEMP_DIR.mkdir(parents=True, exist_ok=True) except PermissionError: @@ -171,4 +171,4 @@ # Update optimization level easyxtb.config["opt_lvl"] = avo_input["opt_lvl"] - easyxtb.conf.save_config() + easyxtb.configuration.save_config() diff --git a/conformers.py b/conformers.py index c493372..2eafbd7 100644 --- a/conformers.py +++ b/conformers.py @@ -155,7 +155,7 @@ solvation = avo_input["solvent"] # Run calculation; returns set of conformers as well as Calculation object - conformers, calc = easyxtb.calc.conformers( + conformers, calc = easyxtb.calculate.conformers( geom, solvation=solvation, method=2, diff --git a/deprotonate.py b/deprotonate.py index a0e8bcb..06d93bb 100644 --- a/deprotonate.py +++ b/deprotonate.py @@ -42,7 +42,7 @@ geom = easyxtb.Geometry.from_cjson(avo_input["cjson"]) # Run calculation; returns set of tautomers as well as Calculation object - tautomers, calc = easyxtb.calc.deprotonate( + tautomers, calc = easyxtb.calculate.deprotonate( geom, solvation=easyxtb.config["solvent"], method=2, diff --git a/easyxtb/README.md b/easyxtb/README.md index b2fae11..d1352b1 100644 --- a/easyxtb/README.md +++ b/easyxtb/README.md @@ -48,7 +48,7 @@ Note that `easyxtb` follows the convention used by `xtb` itself, where `spin` is The package provides a function API for basic xtb calculation types (`energy`, `optimize`, `frequencies`, `opt_freq`, `orbitals`): ```python ->>> optimized = py_xtb.calc.optimize(input_geom, solvation="water", method=2, level="normal") +>>> optimized = py_xtb.calculate.optimize(input_geom, solvation="water", method=2, level="normal") >>> for atom in optimized: ... print(atom) ... @@ -78,7 +78,7 @@ The xtb team recommend generally using the `ohess` (optimization followed by a f The `opt_freq()` calculation function takes advantage of this and will continue reoptimizing using these distorted geometries until a minimum is reached, so is more reliable in getting what we want: ```python ->>> output_geom, output_freqs, calc = py_xtb.calc.opt_freq(input_geom, solvation="water", return_calc=True) +>>> output_geom, output_freqs, calc = py_xtb.calculate.opt_freq(input_geom, solvation="water", return_calc=True) >>> output_freqs[0] {'mode': 1, 'symmetry': 'a', 'frequency': 70.0622, 'reduced_mass': 13.4154, 'ir_intensity': 6.422, 'raman_scattering_activity': 0.0, 'eigenvectors': [[0.0, 0.0, -0.28], [-0.0, 0.0, -0.0], [-0.0, -0.0, 0.25], [0.0, -0.0, 0.04], [0.0, -0.0, -0.24], [-0.0, 0.0, -0.0], [-0.0, 0.0, 0.29], [-0.0, 0.0, 0.15], [0.0, -0.0, 0.02], [0.0, -0.0, -0.12], [0.0, 0.0, -0.15], [0.0, -0.0, 0.55], [0.0, 0.01, -0.56], [0.0, 0.0, -0.19]]} ``` diff --git a/easyxtb/src/easyxtb/__init__.py b/easyxtb/src/easyxtb/__init__.py index e914d23..fb6f579 100644 --- a/easyxtb/src/easyxtb/__init__.py +++ b/easyxtb/src/easyxtb/__init__.py @@ -1,10 +1,10 @@ import logging -from .conf import config, config_file -from .conf import PLUGIN_DIR, CALC_DIR, TEMP_DIR, BIN_DIR, XTB_BIN, CREST_BIN +from .configuration import config, config_file +from .configuration import PLUGIN_DIR, CALC_DIR, TEMP_DIR, BIN_DIR, XTB_BIN, CREST_BIN from .geometry import Atom, Geometry -from .calc import Calculation -from . import calc, conf, convert, format +from .calculate import Calculation +from . import calculate, configuration, convert, format logger = logging.getLogger(__name__) diff --git a/easyxtb/src/easyxtb/calc.py b/easyxtb/src/easyxtb/calculate.py similarity index 99% rename from easyxtb/src/easyxtb/calc.py rename to easyxtb/src/easyxtb/calculate.py index f9376ac..c09fa30 100644 --- a/easyxtb/src/easyxtb/calc.py +++ b/easyxtb/src/easyxtb/calculate.py @@ -20,7 +20,7 @@ from pathlib import Path from shutil import rmtree -from .conf import config, XTB_BIN, CREST_BIN, TEMP_DIR +from .configuration import config, XTB_BIN, CREST_BIN, TEMP_DIR from .geometry import Geometry from .parse import parse_energy, parse_g98_frequencies diff --git a/easyxtb/src/easyxtb/conf.py b/easyxtb/src/easyxtb/configuration.py similarity index 100% rename from easyxtb/src/easyxtb/conf.py rename to easyxtb/src/easyxtb/configuration.py diff --git a/easyxtb/tests/test_calc.py b/easyxtb/tests/test_calc.py index ccb2b78..0419261 100644 --- a/easyxtb/tests/test_calc.py +++ b/easyxtb/tests/test_calc.py @@ -3,7 +3,7 @@ from pathlib import Path -from easyxtb import Geometry, calc, parse +from easyxtb import Geometry, calculate, parse from . import equal_geom @@ -23,7 +23,7 @@ def test_opt_neutral_singlet(): for mol in ["acetic_acid", "acetone", "benzene"]: in_geom = Geometry.from_file(input_dir / f"{mol}.cjson") - out_geom = calc.optimize(in_geom) + out_geom = calculate.optimize(in_geom) ref_geom = Geometry.from_file(results_dir / f"{mol}_opt.xyz") print(f"Testing {mol}:") assert equal_geom(out_geom, ref_geom) @@ -32,7 +32,7 @@ def test_opt_neutral_singlet(): def test_opt_charged(): for mol in ["benzoate", "bu4n"]: in_geom = Geometry.from_file(input_dir / f"{mol}.cjson") - out_geom = calc.optimize(in_geom) + out_geom = calculate.optimize(in_geom) ref_geom = Geometry.from_file(results_dir / f"{mol}_opt.xyz") print(f"Testing {mol}:") assert equal_geom(out_geom, ref_geom) @@ -41,7 +41,7 @@ def test_opt_charged(): def test_opt_doublet(): for mol in ["tempo"]: in_geom = Geometry.from_file(input_dir / f"{mol}.cjson") - out_geom = calc.optimize(in_geom) + out_geom = calculate.optimize(in_geom) ref_geom = Geometry.from_file(results_dir / f"{mol}_opt.xyz") print(f"Testing {mol}:") assert equal_geom(out_geom, ref_geom) @@ -50,7 +50,7 @@ def test_opt_doublet(): def test_freq_neutral_singlet(): for mol in ["acetic_acid", "acetone", "benzene"]: opt_geom = Geometry.from_file(results_dir / f"{mol}_opt.xyz") - freqs = calc.frequencies(opt_geom) + freqs = calculate.frequencies(opt_geom) with open(results_dir / f"{mol}_g98.out", encoding="utf-8") as f: ref_freqs = parse.parse_g98_frequencies(f.read()) print(f"Testing {mol}:") @@ -60,7 +60,7 @@ def test_freq_neutral_singlet(): def test_freq_anion(): for mol in ["benzoate"]: opt_geom = Geometry.from_file(results_dir / f"{mol}_opt.xyz", charge=-1) - freqs = calc.frequencies(opt_geom) + freqs = calculate.frequencies(opt_geom) with open(results_dir / f"{mol}_g98.out", encoding="utf-8") as f: ref_freqs = parse.parse_g98_frequencies(f.read()) print(f"Testing {mol}:") @@ -70,7 +70,7 @@ def test_freq_anion(): def test_freq_cation(): for mol in ["bu4n"]: opt_geom = Geometry.from_file(results_dir / f"{mol}_opt.xyz", charge=1) - freqs = calc.frequencies(opt_geom) + freqs = calculate.frequencies(opt_geom) with open(results_dir / f"{mol}_g98.out", encoding="utf-8") as f: ref_freqs = parse.parse_g98_frequencies(f.read()) print(f"Testing {mol}:") @@ -80,7 +80,7 @@ def test_freq_cation(): def test_freq_doublet(): for mol in ["tempo"]: opt_geom = Geometry.from_file(results_dir / f"{mol}_opt.xyz", spin=1) - freqs = calc.frequencies(opt_geom) + freqs = calculate.frequencies(opt_geom) with open(results_dir / f"{mol}_g98.out", encoding="utf-8") as f: ref_freqs = parse.parse_g98_frequencies(f.read()) print(f"Testing {mol}:") diff --git a/energy.py b/energy.py index b5583cf..c5b0925 100644 --- a/energy.py +++ b/energy.py @@ -42,7 +42,7 @@ # Run calculation; returns energy as float in hartree logger.debug("avo_xtb is requesting a single point energy calculation") - energy_hartree = easyxtb.calc.energy( + energy_hartree = easyxtb.calculate.energy( geom, solvation=easyxtb.config["solvent"], method=easyxtb.config["method"], diff --git a/freq.py b/freq.py index eaf771b..f7fb9a4 100644 --- a/freq.py +++ b/freq.py @@ -42,7 +42,7 @@ # Run calculation; returns set of frequency data logger.debug("avo_xtb is requesting a frequency calculation") - freqs = easyxtb.calc.frequencies( + freqs = easyxtb.calculate.frequencies( geom, solvation=easyxtb.config["solvent"], method=easyxtb.config["method"], diff --git a/install.py b/install.py index d4c1f7a..c52c915 100644 --- a/install.py +++ b/install.py @@ -101,7 +101,7 @@ def link_xtb_bin(xtb_folder): # Add to config easyxtb.config["xtb_bin"] = str(easyxtb.XTB_BIN) # Save config - easyxtb.conf.save_config() + easyxtb.configuration.save_config() def link_crest_bin(crest_folder): @@ -116,7 +116,7 @@ def link_crest_bin(crest_folder): # Add to config easyxtb.config["crest_bin"] = str(easyxtb.CREST_BIN) # Save config - easyxtb.conf.save_config() + easyxtb.configuration.save_config() if __name__ == "__main__": @@ -157,7 +157,7 @@ def link_crest_bin(crest_folder): "install_dir": { "type": "string", "label": "Install in", - "default": str(easyxtb.conf.BIN_DIR), + "default": str(easyxtb.configuration.BIN_DIR), "order": 5.0, }, "notice": { diff --git a/ohess.py b/ohess.py index 33d5dec..ffb3902 100644 --- a/ohess.py +++ b/ohess.py @@ -43,7 +43,7 @@ # Run calculation; returns path to Gaussian file containing frequencies logger.debug("avo_xtb is requesting an opt+freq calculation") - opt_geom, freqs, calc = easyxtb.calc.opt_freq( + opt_geom, freqs, calc = easyxtb.calculate.opt_freq( geom, solvation=easyxtb.config["solvent"], method=easyxtb.config["method"], diff --git a/opt.py b/opt.py index f0ae138..bcdd181 100644 --- a/opt.py +++ b/opt.py @@ -61,7 +61,7 @@ def cleanup_after_opt(cjson: dict) -> dict: # Run calculation; returns optimized geometry as well as Calculation object logger.debug("avo_xtb is requesting a geometry optimization") - opt_geom, calc = easyxtb.calc.optimize( + opt_geom, calc = easyxtb.calculate.optimize( geom, solvation=easyxtb.config["solvent"], method=easyxtb.config["method"], diff --git a/orbitals.py b/orbitals.py index fd40cb0..010b84a 100644 --- a/orbitals.py +++ b/orbitals.py @@ -42,7 +42,7 @@ # Run calculation; returns Molden output file as string logger.debug("avo_xtb is requesting a molecular orbitals calculation") - molden_string = easyxtb.calc.orbitals( + molden_string = easyxtb.calculate.orbitals( geom, solvation=easyxtb.config["solvent"], method=easyxtb.config["method"], diff --git a/protonate.py b/protonate.py index 9d2f7b5..5f33021 100644 --- a/protonate.py +++ b/protonate.py @@ -55,7 +55,7 @@ def cleanup_after_taut(cjson: dict) -> dict: geom = easyxtb.Geometry.from_cjson(avo_input["cjson"]) # Run calculation; returns set of tautomers as well as Calculation object - tautomers, calc = easyxtb.calc.protonate( + tautomers, calc = easyxtb.calculate.protonate( geom, solvation=easyxtb.config["solvent"], method=2,