|
24 | 24 | from arc.species.species import ARCSpecies |
25 | 25 |
|
26 | 26 |
|
27 | | -RMG_DB_PATH, RMG_PATH = settings['RMG_DB_PATH'], settings['RMG_PATH'] |
| 27 | +RMG_DB_PATH = settings['RMG_DB_PATH'] |
| 28 | +RMG_ENV_NAME = settings.get('RMG_ENV_NAME', 'rmg_env') |
28 | 29 | logger = get_logger() |
29 | 30 |
|
30 | 31 |
|
@@ -445,12 +446,16 @@ def parse_arkane_thermo_output(self, statmech_dir: str) -> None: |
445 | 446 | clean_output_directory(os.path.join(self.output_directory, 'Species', species.label)) |
446 | 447 |
|
447 | 448 | script_path = os.path.join(ARC_PATH, 'arc', 'scripts', 'save_arkane_thermo.py') |
| 449 | + env_name = RMG_ENV_NAME |
| 450 | + rmg_db_path = RMG_DB_PATH or "" |
448 | 451 | commands = [f'cd {statmech_dir}', |
449 | 452 | 'bash -lc "set -euo pipefail; ' |
| 453 | + f'export RMG_DB_PATH=\\"{rmg_db_path}\\"; ' |
| 454 | + f'export RMG_DATABASE=\\"{rmg_db_path}\\"; ' |
450 | 455 | 'if command -v micromamba >/dev/null 2>&1; then ' |
451 | | - f' micromamba run -n rmg_env python {script_path}; ' |
| 456 | + f' micromamba run -n {env_name} python {script_path}; ' |
452 | 457 | 'elif command -v conda >/dev/null 2>&1 || command -v mamba >/dev/null 2>&1; then ' |
453 | | - f' conda run -n rmg_env python {script_path}; ' |
| 458 | + f' conda run -n {env_name} python {script_path}; ' |
454 | 459 | 'else ' |
455 | 460 | ' echo \'❌ Micromamba/Mamba/Conda required\' >&2; exit 1; ' |
456 | 461 | 'fi"', |
@@ -514,11 +519,14 @@ def run_arkane(statmech_dir: str) -> None: |
514 | 519 | if not os.path.isfile(input_file): |
515 | 520 | logger.error(f'Cannot run Arkane in {statmech_dir} because it does not contain an input.py file.') |
516 | 521 | return |
517 | | - env_name = 'rmg_env' |
518 | | - arkane_cmd = f'python "{RMG_PATH}/Arkane.py" input.py' |
| 522 | + env_name = RMG_ENV_NAME |
| 523 | + rmg_db_path = RMG_DB_PATH or "" |
| 524 | + arkane_cmd = 'python -m arkane input.py' |
519 | 525 | arkane_cmd += ' 2> >(tee -a stderr.log >&2) | tee -a stdout.log' |
520 | 526 | shell_script = rf'''bash -lc 'set -euo pipefail |
521 | 527 | cd "{statmech_dir}" |
| 528 | +export RMG_DB_PATH="{rmg_db_path}" |
| 529 | +export RMG_DATABASE="{rmg_db_path}" |
522 | 530 |
|
523 | 531 | if command -v micromamba >/dev/null 2>&1; then |
524 | 532 | micromamba run -n {env_name} {arkane_cmd} |
@@ -710,6 +718,8 @@ def get_arkane_model_chemistry(sp_level: 'Level', |
710 | 718 | return f"LevelOfTheory(method='{sp_level.method}',software='gaussian')" |
711 | 719 |
|
712 | 720 | qm_corr_file = os.path.join(RMG_DB_PATH, 'input', 'quantum_corrections', 'data.py') |
| 721 | + if not os.path.isfile(qm_corr_file): |
| 722 | + qm_corr_file = os.path.join(RMG_DB_PATH, 'quantum_corrections', 'data.py') |
713 | 723 |
|
714 | 724 | atom_energies_start = "atom_energies = {" |
715 | 725 | atom_energies_end = "pbac = {" |
@@ -768,6 +778,8 @@ def check_arkane_bacs(sp_level: 'Level', |
768 | 778 | bool: True if both AECs and BACs are available, False otherwise. |
769 | 779 | """ |
770 | 780 | qm_corr_file = os.path.join(RMG_DB_PATH, 'input', 'quantum_corrections', 'data.py') |
| 781 | + if not os.path.isfile(qm_corr_file): |
| 782 | + qm_corr_file = os.path.join(RMG_DB_PATH, 'quantum_corrections', 'data.py') |
771 | 783 |
|
772 | 784 | atom_energies_start = "atom_energies = {" |
773 | 785 | atom_energies_end = "pbac = {" |
|
0 commit comments