Skip to content

Commit 552bcb3

Browse files
authored
Implement the molecule module internally (#789)
This is a large PR that fundamentally adds the Molecule class internally in ARC. Now ARC is compatible with Py 3.12 This PR follows the work done in #754 where ARC were given capabilities to work directly with the RMG-database without using the RMG API. Now, finally, ARC does not depend on Julia. The major change made in this PR required additional modifications. Although we appreciate small and smart PR's it is very hard to decouple these changes. The main modifications are as follows: 1. Naturally, the interface to Arkane had to be modified since now RMG is not a direct dependency. We now use Arkane only as a subprocess for statmech. 2. ESS paersing was previously somewhat facilitated through Arkane, now there's a new `parser` module in ARC with adapters for each ESS. 3. Bugs were discovered in our two perception algorithms (we used to have `species/xyz_to_2d` and `species/xyz_to_smiles`, falling back to a single bond version of the molecule if it cannot be perceived). Now we have a new `species/perceive` algorithm, with a fallback to `species/xyz_to_smiles` if needed. Success rates are higher, and we always return a molecule with bond orders. This might be the end of the `allow_nonisomorphic_2d` flag in ARC. We'll keep it around for a while, but may deprecate it in the future. 4. QCElemental was removed as a dependency. Combined with the removal of Arkane's API, this means that now we provide translations from atomic numbers to atomic mass. this is done in common.py with data stored under `data/elements.yml`. 5. The removal of QCElemental also impacted our atom mapping algorithm. It turns our that we used this as a fall back quite often for isomerization. The atom mapping engine and driver were updated, which is another positive outcome of this PR. 6. Better and automated installation scripts were added under `devtools` for all the external dependencies, and the CI was updated as well, along with the Makefile. A big thanks to @calvinp0 for the endless hours he invested in this. 7. ZMatrices and the H Abstraction heuristics modules were updated as well. 8. The TS NMD checks have been updated, incorporating #768 into this PR. Tests were of course added. We still need to updated the docs, specifically for the installation instructions, and check the installation scripts again, they were mainly tested in the context of the CI. With this merged, we should soon tag a new version of ARC.
2 parents 71c254d + e735393 commit 552bcb3

File tree

223 files changed

+59596
-25919
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

223 files changed

+59596
-25919
lines changed

.bettercodehub.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

.coveragerc

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,12 @@ omit =
1212
*/logo/*
1313

1414
[report]
15-
show_missing = False
15+
show_missing = True
1616
exclude_lines =
1717
pragma: no cover
1818
def __repr__
1919
logger.warning
2020
if __name__ == .__main__.:
21-
omit =
22-
*Test.py
23-
*/scripts/*
24-
*/testing/*
25-
*/docs/*
26-
*/examples/*
27-
*/ipython/*
28-
*/logo/*
2921

3022
[html]
3123
directory = testing/coverage

.github/workflows/ci.yml

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
name: CI
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches: [main]
7+
types: [opened, synchronize, reopened]
8+
schedule:
9+
- cron: '0 0 * * *'
10+
11+
jobs:
12+
build-and-test:
13+
name: CI and Functional Tests
14+
runs-on: ubuntu-latest
15+
defaults:
16+
run:
17+
shell: bash -el {0}
18+
19+
steps:
20+
- name: Checkout ARC
21+
uses: actions/checkout@v4
22+
with:
23+
path: ARC
24+
25+
- name: Clean Ubuntu Image
26+
uses: kfir4444/free-disk-space@main
27+
with:
28+
tool-cache: true
29+
android: true
30+
dotnet: true
31+
haskell: true
32+
large-packages: true
33+
swap-storage: true
34+
35+
- name: Set up micromamba (arc_env)
36+
uses: mamba-org/setup-micromamba@v2
37+
with:
38+
environment-name: arc_env
39+
environment-file: ARC/environment.yml
40+
cache-environment: true
41+
cache-downloads: true
42+
generate-run-shell: true
43+
44+
- name: Install conda in micromamba base
45+
shell: micromamba-shell {0}
46+
run: |
47+
echo "::group::Install conda in micromamba base"
48+
micromamba install -n base -c conda-forge conda
49+
echo "::endgroup::"
50+
51+
- name: Export ARC paths
52+
shell: micromamba-shell {0}
53+
working-directory: ARC
54+
run: |
55+
echo "PATH=$PATH:$PWD" >> "$GITHUB_ENV"
56+
echo "PYTHONPATH=$PYTHONPATH:$PWD" >> "$GITHUB_ENV"
57+
58+
- name: Install Julia 1.10
59+
shell: micromamba-shell {0}
60+
run: |
61+
echo "::group::Install juliaup + Julia 1.10"
62+
# 1) Bootstrap juliaup non-interactively (-y)
63+
curl -fsSL https://install.julialang.org | sh -s -- -y
64+
# 2) Make juliaup visible *now* (CI shells won’t re-source rc files)
65+
export PATH="$HOME/.juliaup/bin:$PATH"
66+
# 3) Install & select Julia 1.10
67+
juliaup add 1.10
68+
juliaup default 1.10
69+
# 4) Persist for subsequent steps
70+
echo "PATH=$HOME/.juliaup/bin:$PATH" >> "$GITHUB_ENV"
71+
echo "::endgroup::"
72+
julia --version # Check that Julia is installed correctly
73+
74+
- name: Set RMG-Py + database in PATH and PYTHONPATH
75+
shell: micromamba-shell {0}
76+
working-directory: ARC
77+
run: |
78+
# bash devtools/install_rmg.sh
79+
echo "RMG_PY_PATH=$(realpath ../RMG-Py)" >> $GITHUB_ENV
80+
echo "RMG_DB_PATH=$(realpath ../RMG-database)" >> $GITHUB_ENV
81+
echo "PATH=$(realpath ../RMG-Py):$PATH" >> $GITHUB_ENV
82+
echo "PYTHONPATH=$(realpath ../RMG-Py):$PYTHONPATH" >> $GITHUB_ENV
83+
84+
- name: Cache RMG-Py source
85+
uses: actions/cache@v4
86+
with:
87+
path: RMG-Py
88+
key: ${{ runner.os }}-rmgpy-${{ hashFiles('ARC/devtools/install_rmg.sh') }}
89+
restore-keys: ${{ runner.os }}-rmgpy-
90+
91+
- name: Install all extras - CI
92+
shell: micromamba-shell {0}
93+
working-directory: ARC
94+
run: make install-ci
95+
96+
- name: Set TS-GCN and AutoTST in PYTHONPATH
97+
shell: micromamba-shell {0}
98+
working-directory: ARC
99+
run: |
100+
echo "PYTHONPATH=$(realpath ../TS-GCN):$(realpath ../AutoTST):$PYTHONPATH" >> $GITHUB_ENV
101+
102+
- name: Compile ARC molecule
103+
shell: micromamba-shell {0}
104+
working-directory: ARC
105+
run: |
106+
make compile
107+
108+
- name: Run Unit Tests
109+
shell: micromamba-shell {0}
110+
working-directory: ARC
111+
run: |
112+
echo "Running Unit Tests..."
113+
export PYTHONPATH="${{ github.workspace }}/AutoTST:${{ github.workspace }}/KinBot:$PYTHONPATH"
114+
pytest arc/ --cov --cov-report=xml -ra -vv
115+
116+
- name: Run Functional Tests
117+
shell: micromamba-shell {0}
118+
working-directory: ${{ github.workspace }}/ARC
119+
run: |
120+
echo "Running Functional Tests from $(pwd)..."
121+
export PYTHONPATH="${{ github.workspace }}/AutoTST:${{ github.workspace }}/KinBot:$PYTHONPATH"
122+
pytest functional/ -ra -vv
123+
124+
- name: Upload coverage data
125+
uses: codecov/codecov-action@v3
126+
with:
127+
token: ${{ secrets.CODECOV_TOKEN }}
128+
file: ARC/coverage.xml
129+
flags: unittests,functionaltests
130+
name: codecov-umbrella
131+
verbose: true
132+
fail_ci_if_error: false

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ jobs:
2727
uses: actions/checkout@v3
2828

2929
- name: Initialize CodeQL
30-
uses: github/codeql-action/init@v2
30+
uses: github/codeql-action/init@v3
3131
with:
3232
languages: ${{ matrix.language }}
3333
queries: +security-and-quality
3434

3535
- name: Autobuild
36-
uses: github/codeql-action/autobuild@v2
36+
uses: github/codeql-action/autobuild@v3
3737

3838
- name: Perform CodeQL Analysis
39-
uses: github/codeql-action/analyze@v2
39+
uses: github/codeql-action/analyze@v3
4040
with:
4141
category: "/language:${{ matrix.language }}"

0 commit comments

Comments
 (0)