From 246ffce743cb4056e93ce856b49f21e242c86c56 Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Tue, 14 Jan 2025 14:08:09 -0500 Subject: [PATCH 01/51] change rms branch to what it is on `main` --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 496b9834f1..3dfda1d784 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -140,7 +140,7 @@ jobs: # JULIA_CONDAPKG_EXE points to the existing conda/mamba to avoid JuliaCall from installing their own. See https://juliapy.github.io/PythonCall.jl/stable/pythoncall/#If-you-already-have-a-Conda-environment. run: | mamba install conda-forge::pyjuliacall - julia -e 'using Pkg; Pkg.add(Pkg.PackageSpec(name="ReactionMechanismSimulator", url="https://github.com/hwpang/ReactionMechanismSimulator.jl.git", rev="fix_installation")); using ReactionMechanismSimulator' + julia -e 'using Pkg; Pkg.add(Pkg.PackageSpec(name="ReactionMechanismSimulator", url="https://github.com/ReactionMechanismGenerator/ReactionMechanismSimulator.jl.git", rev="for_rmg")); using ReactionMechanismSimulator' - name: Install Q2DTor run: echo "" | make q2dtor From b360bd4bb22788a549a844dce2f70e57d300d4f1 Mon Sep 17 00:00:00 2001 From: Jackson Burns <33505528+JacksonBurns@users.noreply.github.com> Date: Wed, 15 Jan 2025 17:35:57 -0500 Subject: [PATCH 02/51] switch back to HWP's branch of RMS; update setting of vars --- .github/workflows/CI.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3dfda1d784..bf6c8e1d69 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -123,8 +123,10 @@ jobs: # echo "JULIA_CONDAPKG_EXE=$CONDA/condabin/mamba" >> $GITHUB_PATH # echo "JULIA_CONDAPKG_EXE=$CONDA/condabin/mamba" >> $GITHUB_ENV # echo "JULIA_CONDAPKG_EXE=$CONDA/condabin/mamba" >> $GITHUB_PATH - echo "JULIA_CONDAPKG_BACKEND=Current" >> $GITHUB_ENV + # echo "JULIA_CONDAPKG_BACKEND=Current" >> $GITHUB_ENV # echo "JULIA_CONDAPKG_BACKEND=Current" >> $GITHUB_PATH + echo "JULIA_CONDAPKG_BACKEND='System'" >> $GITHUB_ENV + echo "JULIA_CONDAPKG_EXE=$CONDA_EXE" >> $GITHUB_ENV - name: Setup Juliaup uses: julia-actions/install-juliaup@v2 @@ -140,7 +142,7 @@ jobs: # JULIA_CONDAPKG_EXE points to the existing conda/mamba to avoid JuliaCall from installing their own. See https://juliapy.github.io/PythonCall.jl/stable/pythoncall/#If-you-already-have-a-Conda-environment. run: | mamba install conda-forge::pyjuliacall - julia -e 'using Pkg; Pkg.add(Pkg.PackageSpec(name="ReactionMechanismSimulator", url="https://github.com/ReactionMechanismGenerator/ReactionMechanismSimulator.jl.git", rev="for_rmg")); using ReactionMechanismSimulator' + julia -e 'using Pkg; Pkg.add(Pkg.PackageSpec(name="ReactionMechanismSimulator", url="https://github.com/hwpang/ReactionMechanismSimulator.jl.git", rev="fix_installation")); using ReactionMechanismSimulator' - name: Install Q2DTor run: echo "" | make q2dtor From dfbe6756aaae0ba15e6af8a7d5a202c1d3a30870 Mon Sep 17 00:00:00 2001 From: Jackson Burns <33505528+JacksonBurns@users.noreply.github.com> Date: Wed, 15 Jan 2025 18:02:49 -0500 Subject: [PATCH 03/51] remove single quotes see https://github.com/JuliaPy/CondaPkg.jl/issues/19#issuecomment-1035287115 --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index bf6c8e1d69..d25a17558a 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -125,7 +125,7 @@ jobs: # echo "JULIA_CONDAPKG_EXE=$CONDA/condabin/mamba" >> $GITHUB_PATH # echo "JULIA_CONDAPKG_BACKEND=Current" >> $GITHUB_ENV # echo "JULIA_CONDAPKG_BACKEND=Current" >> $GITHUB_PATH - echo "JULIA_CONDAPKG_BACKEND='System'" >> $GITHUB_ENV + echo "JULIA_CONDAPKG_BACKEND=System" >> $GITHUB_ENV echo "JULIA_CONDAPKG_EXE=$CONDA_EXE" >> $GITHUB_ENV - name: Setup Juliaup From 6c99b44a02cb73a482774a4ff63b517e19bfc3cc Mon Sep 17 00:00:00 2001 From: Jackson Burns <33505528+JacksonBurns@users.noreply.github.com> Date: Wed, 15 Jan 2025 18:28:03 -0500 Subject: [PATCH 04/51] change env vars again the PYTHONCALL suggestion is here: https://discourse.julialang.org/t/how-to-use-pythoncall-with-a-previous-conda-environment/87419/8 changing to current will hopefully prevent condapkg from making a new environment --- .github/workflows/CI.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d25a17558a..ba763e34e6 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -125,8 +125,9 @@ jobs: # echo "JULIA_CONDAPKG_EXE=$CONDA/condabin/mamba" >> $GITHUB_PATH # echo "JULIA_CONDAPKG_BACKEND=Current" >> $GITHUB_ENV # echo "JULIA_CONDAPKG_BACKEND=Current" >> $GITHUB_PATH - echo "JULIA_CONDAPKG_BACKEND=System" >> $GITHUB_ENV + echo "JULIA_CONDAPKG_BACKEND=Current" >> $GITHUB_ENV echo "JULIA_CONDAPKG_EXE=$CONDA_EXE" >> $GITHUB_ENV + # echo "JULIA_PYTHONCALL_EXE=@PyCall" >> $GITHUB_ENV - name: Setup Juliaup uses: julia-actions/install-juliaup@v2 From 52a23cb6835e6e60c604ddfdc6c557a371ed9433 Mon Sep 17 00:00:00 2001 From: Jackson Burns <33505528+JacksonBurns@users.noreply.github.com> Date: Wed, 15 Jan 2025 20:50:31 -0500 Subject: [PATCH 05/51] LD_LIBRARY_PATH debugging --- .github/workflows/CI.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index ba763e34e6..d8759dcdfd 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -128,6 +128,9 @@ jobs: echo "JULIA_CONDAPKG_BACKEND=Current" >> $GITHUB_ENV echo "JULIA_CONDAPKG_EXE=$CONDA_EXE" >> $GITHUB_ENV # echo "JULIA_PYTHONCALL_EXE=@PyCall" >> $GITHUB_ENV + echo "AHHHHHHHHHHHHHHHH" + echo $LD_LIBRARY_PATH + echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/" >> $GITHUB_ENV - name: Setup Juliaup uses: julia-actions/install-juliaup@v2 From 4803c26fc79ed3aa4d01f36cb6b22858202c7ab9 Mon Sep 17 00:00:00 2001 From: Jackson Burns <33505528+JacksonBurns@users.noreply.github.com> Date: Thu, 16 Jan 2025 08:14:02 -0500 Subject: [PATCH 06/51] remove LD_LIBRARY_PATH debugging; do not set PYTHONPATH or modify PATH --- .github/workflows/CI.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d8759dcdfd..c1d91a5d0f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -100,11 +100,11 @@ jobs: git clone -b $RMG_DATABASE_BRANCH https://github.com/ReactionMechanismGenerator/RMG-database.git # modify env variables as directed in the RMG installation instructions - - name: Set Environment Variables - run: | - RUNNER_CWD=$(pwd) - echo "PYTHONPATH=$RUNNER_CWD/RMG-Py:$PYTHONPATH" >> $GITHUB_ENV - echo "$RUNNER_CWD/RMG-Py" >> $GITHUB_PATH + # - name: Set Environment Variables + # run: | + # RUNNER_CWD=$(pwd) + # echo "PYTHONPATH=$RUNNER_CWD/RMG-Py:$PYTHONPATH" >> $GITHUB_ENV + # echo "$RUNNER_CWD/RMG-Py" >> $GITHUB_PATH # RMG build step - name: make RMG @@ -128,9 +128,9 @@ jobs: echo "JULIA_CONDAPKG_BACKEND=Current" >> $GITHUB_ENV echo "JULIA_CONDAPKG_EXE=$CONDA_EXE" >> $GITHUB_ENV # echo "JULIA_PYTHONCALL_EXE=@PyCall" >> $GITHUB_ENV - echo "AHHHHHHHHHHHHHHHH" - echo $LD_LIBRARY_PATH - echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/" >> $GITHUB_ENV + # echo "AHHHHHHHHHHHHHHHH" + # echo $LD_LIBRARY_PATH + # echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/" >> $GITHUB_ENV - name: Setup Juliaup uses: julia-actions/install-juliaup@v2 From 7187cd4edf996308a70ad6651f4b2907305a8885 Mon Sep 17 00:00:00 2001 From: Jackson Burns <33505528+JacksonBurns@users.noreply.github.com> Date: Thu, 16 Jan 2025 09:54:29 -0500 Subject: [PATCH 07/51] try setting the PATH but not the PYTHONPATH --- .github/workflows/CI.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c1d91a5d0f..7031a0a8ef 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -100,11 +100,11 @@ jobs: git clone -b $RMG_DATABASE_BRANCH https://github.com/ReactionMechanismGenerator/RMG-database.git # modify env variables as directed in the RMG installation instructions - # - name: Set Environment Variables - # run: | - # RUNNER_CWD=$(pwd) - # echo "PYTHONPATH=$RUNNER_CWD/RMG-Py:$PYTHONPATH" >> $GITHUB_ENV - # echo "$RUNNER_CWD/RMG-Py" >> $GITHUB_PATH + - name: Set Environment Variables + run: | + RUNNER_CWD=$(pwd) + # echo "PYTHONPATH=$RUNNER_CWD/RMG-Py:$PYTHONPATH" >> $GITHUB_ENV + echo "$RUNNER_CWD/RMG-Py" >> $GITHUB_PATH # RMG build step - name: make RMG From 4ac1aa6652af3f531d6c5dd354dbdca8c261eac0 Mon Sep 17 00:00:00 2001 From: Jackson Burns <33505528+JacksonBurns@users.noreply.github.com> Date: Thu, 16 Jan 2025 09:56:56 -0500 Subject: [PATCH 08/51] [DEBUG] Don't set PYTHONPATH in pure-python action either The PYTHONPATH environment variable is an alternative method to just installing the package, which we are doing (?) - see: https://stackoverflow.com/questions/39363544/difference-between-adding-path-to-pythonpath-and-installing-your-own-module --- .github/workflows/pure_python_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pure_python_ci.yml b/.github/workflows/pure_python_ci.yml index 9cc0d88e10..7fd9471353 100644 --- a/.github/workflows/pure_python_ci.yml +++ b/.github/workflows/pure_python_ci.yml @@ -75,7 +75,7 @@ jobs: - name: Set Environment Variables run: | RUNNER_CWD=$(pwd) - echo "PYTHONPATH=$RUNNER_CWD/RMG-Py:$PYTHONPATH" >> $GITHUB_ENV + # echo "PYTHONPATH=$RUNNER_CWD/RMG-Py:$PYTHONPATH" >> $GITHUB_ENV echo "$RUNNER_CWD/RMG-Py" >> $GITHUB_PATH # RMG build step From 4e92189a907ca2e186ef89ab8137b6cacd16ab15 Mon Sep 17 00:00:00 2001 From: Jackson Burns <33505528+JacksonBurns@users.noreply.github.com> Date: Thu, 16 Jan 2025 10:25:13 -0500 Subject: [PATCH 09/51] explicitly set `PYTHON` to point toward the Python we want Julia to use; and... check that PYTHONHOME and PYTHONPATH are unset, both of which have a high likelihood of messing up the install process --- .github/workflows/CI.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 7031a0a8ef..d060d869b3 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -127,8 +127,11 @@ jobs: # echo "JULIA_CONDAPKG_BACKEND=Current" >> $GITHUB_PATH echo "JULIA_CONDAPKG_BACKEND=Current" >> $GITHUB_ENV echo "JULIA_CONDAPKG_EXE=$CONDA_EXE" >> $GITHUB_ENV + echo "PYTHON=$CONDA_PREFIX/bin/python" >> $GITHUB_ENV # echo "JULIA_PYTHONCALL_EXE=@PyCall" >> $GITHUB_ENV - # echo "AHHHHHHHHHHHHHHHH" + echo "AHHHHHHHHHHHHHHHH" + echo $PYTHONHOME + echo $PYTHONPATH # echo $LD_LIBRARY_PATH # echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/" >> $GITHUB_ENV From ef924f0d58fc904e91e40c057de691e1b962ff23 Mon Sep 17 00:00:00 2001 From: Jackson Burns <33505528+JacksonBurns@users.noreply.github.com> Date: Thu, 16 Jan 2025 10:28:49 -0500 Subject: [PATCH 10/51] increment upload-artifact version --- .github/workflows/CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d060d869b3..46e9a22906 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -331,14 +331,14 @@ jobs: - name: Upload regression summary artifact # the annotate workflow uses this artifact to add a comment to the PR - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if : ${{ github.event_name == 'pull_request' }} with: name: regression_summary path: summary.txt - name: Upload Comparison Results - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: regression_test_comparison_results path: | From 43c8a88a88a6d1b51efacf9e275f35a4a1fe06bc Mon Sep 17 00:00:00 2001 From: Jackson Burns <33505528+JacksonBurns@users.noreply.github.com> Date: Thu, 16 Jan 2025 10:30:23 -0500 Subject: [PATCH 11/51] leave note for future self --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 46e9a22906..3adfc936ce 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -127,7 +127,7 @@ jobs: # echo "JULIA_CONDAPKG_BACKEND=Current" >> $GITHUB_PATH echo "JULIA_CONDAPKG_BACKEND=Current" >> $GITHUB_ENV echo "JULIA_CONDAPKG_EXE=$CONDA_EXE" >> $GITHUB_ENV - echo "PYTHON=$CONDA_PREFIX/bin/python" >> $GITHUB_ENV + echo "PYTHON=$CONDA_PREFIX/bin/python" >> $GITHUB_ENV # JULIA_PYTHONCALL_EXE instead? # echo "JULIA_PYTHONCALL_EXE=@PyCall" >> $GITHUB_ENV echo "AHHHHHHHHHHHHHHHH" echo $PYTHONHOME From 76cac4c62bc574f38102ca014b0457f97ef4e3d8 Mon Sep 17 00:00:00 2001 From: Jackson Burns <33505528+JacksonBurns@users.noreply.github.com> Date: Thu, 16 Jan 2025 11:37:54 -0500 Subject: [PATCH 12/51] set JULIA_PYTHONCALL_EXE to point to our conda python --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3adfc936ce..dc5186407e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -127,7 +127,7 @@ jobs: # echo "JULIA_CONDAPKG_BACKEND=Current" >> $GITHUB_PATH echo "JULIA_CONDAPKG_BACKEND=Current" >> $GITHUB_ENV echo "JULIA_CONDAPKG_EXE=$CONDA_EXE" >> $GITHUB_ENV - echo "PYTHON=$CONDA_PREFIX/bin/python" >> $GITHUB_ENV # JULIA_PYTHONCALL_EXE instead? + echo "JULIA_PYTHONCALL_EXE=$CONDA_PREFIX/bin/python" >> $GITHUB_ENV # echo "JULIA_PYTHONCALL_EXE=@PyCall" >> $GITHUB_ENV echo "AHHHHHHHHHHHHHHHH" echo $PYTHONHOME From 78c502f6746f4ab04f4119cf8e8172e3515f0a3b Mon Sep 17 00:00:00 2001 From: Jackson Burns <33505528+JacksonBurns@users.noreply.github.com> Date: Thu, 16 Jan 2025 13:00:18 -0500 Subject: [PATCH 13/51] set pythonpath too --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index dc5186407e..3760438e0e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -103,7 +103,7 @@ jobs: - name: Set Environment Variables run: | RUNNER_CWD=$(pwd) - # echo "PYTHONPATH=$RUNNER_CWD/RMG-Py:$PYTHONPATH" >> $GITHUB_ENV + echo "PYTHONPATH=$RUNNER_CWD/RMG-Py:$PYTHONPATH" >> $GITHUB_ENV echo "$RUNNER_CWD/RMG-Py" >> $GITHUB_PATH # RMG build step From 7937eaea74b3a75b5f13610c5f573600757efa69 Mon Sep 17 00:00:00 2001 From: Jackson Burns <33505528+JacksonBurns@users.noreply.github.com> Date: Thu, 16 Jan 2025 21:42:07 -0500 Subject: [PATCH 14/51] ensure PYTHONHOME isn't set during RMS install --- .github/workflows/CI.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3760438e0e..75bbbcf3f3 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -154,6 +154,12 @@ jobs: - name: Install Q2DTor run: echo "" | make q2dtor + - name: Ensure PYTHONHOME isn't set, somehow + run: | + echo "AHHHHHHHHHHHHHHHH" + echo $PYTHONHOME + echo $PYTHONPATH + # non-regression testing - name: Run Unit, Functional, and Database Tests # aggregate into one command so we only have to eat the collection time once From 8fe65c151b8707e8065bee65b20ccf680b9a1554 Mon Sep 17 00:00:00 2001 From: Jackson Burns <33505528+JacksonBurns@users.noreply.github.com> Date: Fri, 17 Jan 2025 10:29:10 -0500 Subject: [PATCH 15/51] set `LD_LIBRARY_PATH` --- .github/workflows/CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 75bbbcf3f3..749d843a1d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -132,8 +132,8 @@ jobs: echo "AHHHHHHHHHHHHHHHH" echo $PYTHONHOME echo $PYTHONPATH - # echo $LD_LIBRARY_PATH - # echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/" >> $GITHUB_ENV + echo $LD_LIBRARY_PATH + echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/" >> $GITHUB_ENV - name: Setup Juliaup uses: julia-actions/install-juliaup@v2 From a60e01121c5fb95d7d965136af57031a3d7d32e7 Mon Sep 17 00:00:00 2001 From: Jackson Burns <33505528+JacksonBurns@users.noreply.github.com> Date: Fri, 17 Jan 2025 10:43:51 -0500 Subject: [PATCH 16/51] install rosetta to try and fix python x86 compat mode 'encodings' error --- .github/workflows/CI.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 749d843a1d..2deff70dd6 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -73,7 +73,9 @@ jobs: - name: Compel Arm-based Mac to use x86 if: matrix.os == 'macos-latest' - run: echo "CONDA_SUBDIR=osx-64" >> $GITHUB_ENV + run: | + echo "CONDA_SUBDIR=osx-64" >> $GITHUB_ENV + softwareupdate --install-rosetta --agree-to-license - name: Setup Miniforge Python ${{ matrix.python-version }} uses: conda-incubator/setup-miniconda@v3 From 84555555d10e965a9414963c9a3443ceb9275d0b Mon Sep 17 00:00:00 2001 From: Jackson Burns <33505528+JacksonBurns@users.noreply.github.com> Date: Fri, 17 Jan 2025 12:05:59 -0500 Subject: [PATCH 17/51] try just installing juliaup from conda forge, idek at this point also don't set those env vars that are meessing things up i think --- .github/workflows/CI.yml | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 2deff70dd6..7eec8ef415 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -75,7 +75,7 @@ jobs: if: matrix.os == 'macos-latest' run: | echo "CONDA_SUBDIR=osx-64" >> $GITHUB_ENV - softwareupdate --install-rosetta --agree-to-license + # softwareupdate --install-rosetta --agree-to-license # did not help with encodings issue - name: Setup Miniforge Python ${{ matrix.python-version }} uses: conda-incubator/setup-miniconda@v3 @@ -88,6 +88,7 @@ jobs: use-mamba: true show-channel-urls: true channels: conda-forge,cantera,rmg + conda-remove-defaults: "true" # list the environment for debugging purposes - name: mamba info @@ -101,12 +102,12 @@ jobs: cd .. git clone -b $RMG_DATABASE_BRANCH https://github.com/ReactionMechanismGenerator/RMG-database.git - # modify env variables as directed in the RMG installation instructions - - name: Set Environment Variables - run: | - RUNNER_CWD=$(pwd) - echo "PYTHONPATH=$RUNNER_CWD/RMG-Py:$PYTHONPATH" >> $GITHUB_ENV - echo "$RUNNER_CWD/RMG-Py" >> $GITHUB_PATH + # # modify env variables as directed in the RMG installation instructions + # - name: Set Environment Variables + # run: | + # RUNNER_CWD=$(pwd) + # echo "PYTHONPATH=$RUNNER_CWD/RMG-Py:$PYTHONPATH" >> $GITHUB_ENV + # echo "$RUNNER_CWD/RMG-Py" >> $GITHUB_PATH # RMG build step - name: make RMG @@ -135,22 +136,24 @@ jobs: echo $PYTHONHOME echo $PYTHONPATH echo $LD_LIBRARY_PATH - echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/" >> $GITHUB_ENV + # echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/" >> $GITHUB_ENV - - name: Setup Juliaup - uses: julia-actions/install-juliaup@v2 - with: - channel: '1.9' + # - name: Setup Juliaup + # uses: julia-actions/install-juliaup@v2 + # with: + # channel: '1.9' - - name: Check Julia version - run: julia --version + # - name: Check Julia version + # run: julia --version # RMS installation and linking to Julia - name: Install and link Julia dependencies timeout-minutes: 120 # this usually takes 20-45 minutes (or hangs for 6+ hours). # JULIA_CONDAPKG_EXE points to the existing conda/mamba to avoid JuliaCall from installing their own. See https://juliapy.github.io/PythonCall.jl/stable/pythoncall/#If-you-already-have-a-Conda-environment. run: | - mamba install conda-forge::pyjuliacall + mamba install conda-forge::pyjuliacall conda-forge::juliaup + echo "HERES WHERE JULIA IS BRO" + which julia julia -e 'using Pkg; Pkg.add(Pkg.PackageSpec(name="ReactionMechanismSimulator", url="https://github.com/hwpang/ReactionMechanismSimulator.jl.git", rev="fix_installation")); using ReactionMechanismSimulator' - name: Install Q2DTor From 8803c1f48c4eff0b01c44d05c86f83549fee2cf2 Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Fri, 17 Jan 2025 13:45:26 -0500 Subject: [PATCH 18/51] try actually installing rmg to avoid setting PYTHONPATH --- .github/workflows/CI.yml | 61 +++++++------------------------------ Makefile | 2 +- install_rms.sh | 13 ++++++++ setup.py | 65 +++++++++++++++++++++------------------- 4 files changed, 60 insertions(+), 81 deletions(-) create mode 100644 install_rms.sh diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 7eec8ef415..40949b21a5 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -102,69 +102,30 @@ jobs: cd .. git clone -b $RMG_DATABASE_BRANCH https://github.com/ReactionMechanismGenerator/RMG-database.git - # # modify env variables as directed in the RMG installation instructions - # - name: Set Environment Variables - # run: | - # RUNNER_CWD=$(pwd) - # echo "PYTHONPATH=$RUNNER_CWD/RMG-Py:$PYTHONPATH" >> $GITHUB_ENV - # echo "$RUNNER_CWD/RMG-Py" >> $GITHUB_PATH + # modify env variables as directed in the RMG installation instructions + - name: Set Environment Variables + run: | + RUNNER_CWD=$(pwd) + echo "$RUNNER_CWD/RMG-Py" >> $GITHUB_PATH # RMG build step - name: make RMG run: | - make clean - make + make install - # Setup Juliaup - - name: Set Julia paths - run: | - # echo "JULIAUP_DEPOT_PATH=$CONDA/envs/rmg_env/.julia" >> $GITHUB_ENV - # echo "JULIAUP_DEPOT_PATH=$CONDA/envs/rmg_env/.julia" >> $GITHUB_PATH - # echo "JULIA_DEPOT_PATH=$CONDA/envs/rmg_env/.julia" >> $GITHUB_ENV - # echo "JULIA_DEPOT_PATH=$CONDA/envs/rmg_env/.julia" >> $GITHUB_PATH - # echo "JULIA_CONDAPKG_EXE=$CONDA/condabin/mamba" >> $GITHUB_ENV - # echo "JULIA_CONDAPKG_EXE=$CONDA/condabin/mamba" >> $GITHUB_PATH - # echo "JULIA_CONDAPKG_EXE=$CONDA/condabin/mamba" >> $GITHUB_ENV - # echo "JULIA_CONDAPKG_EXE=$CONDA/condabin/mamba" >> $GITHUB_PATH - # echo "JULIA_CONDAPKG_BACKEND=Current" >> $GITHUB_ENV - # echo "JULIA_CONDAPKG_BACKEND=Current" >> $GITHUB_PATH - echo "JULIA_CONDAPKG_BACKEND=Current" >> $GITHUB_ENV - echo "JULIA_CONDAPKG_EXE=$CONDA_EXE" >> $GITHUB_ENV - echo "JULIA_PYTHONCALL_EXE=$CONDA_PREFIX/bin/python" >> $GITHUB_ENV - # echo "JULIA_PYTHONCALL_EXE=@PyCall" >> $GITHUB_ENV - echo "AHHHHHHHHHHHHHHHH" - echo $PYTHONHOME - echo $PYTHONPATH - echo $LD_LIBRARY_PATH - # echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/" >> $GITHUB_ENV - - # - name: Setup Juliaup - # uses: julia-actions/install-juliaup@v2 - # with: - # channel: '1.9' - - # - name: Check Julia version - # run: julia --version + - name: Setup Juliaup + uses: julia-actions/install-juliaup@v2 + with: + channel: '1.9' # RMS installation and linking to Julia - name: Install and link Julia dependencies timeout-minutes: 120 # this usually takes 20-45 minutes (or hangs for 6+ hours). - # JULIA_CONDAPKG_EXE points to the existing conda/mamba to avoid JuliaCall from installing their own. See https://juliapy.github.io/PythonCall.jl/stable/pythoncall/#If-you-already-have-a-Conda-environment. - run: | - mamba install conda-forge::pyjuliacall conda-forge::juliaup - echo "HERES WHERE JULIA IS BRO" - which julia - julia -e 'using Pkg; Pkg.add(Pkg.PackageSpec(name="ReactionMechanismSimulator", url="https://github.com/hwpang/ReactionMechanismSimulator.jl.git", rev="fix_installation")); using ReactionMechanismSimulator' + run: . install_rms.sh - name: Install Q2DTor run: echo "" | make q2dtor - - name: Ensure PYTHONHOME isn't set, somehow - run: | - echo "AHHHHHHHHHHHHHHHH" - echo $PYTHONHOME - echo $PYTHONPATH - # non-regression testing - name: Run Unit, Functional, and Database Tests # aggregate into one command so we only have to eat the collection time once diff --git a/Makefile b/Makefile index 06055daa3a..029f3c3275 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ clean-solver: install: @ python utilities.py check-pydas - python setup.py install + python -m pip install -vv . q2dtor: @ echo -e "\nInstalling Q2DTor...\n" diff --git a/install_rms.sh b/install_rms.sh new file mode 100644 index 0000000000..7fb9716018 --- /dev/null +++ b/install_rms.sh @@ -0,0 +1,13 @@ +# manual installation steps +# start by installing juliaup on your system globally +# curl -fsSL https://install.julialang.org | sh +# # restart shell +# juliaup add 1.9 +# juliaup default 1.9 + +# actual steps +conda install -y conda-forge::pyjuliacall +export JULIA_CONDAPKG_BACKEND=Current +export JULIA_CONDAPKG_EXE=$CONDA_EXE +export JULIA_PYTHONCALL_EXE=$CONDA_PREFIX/bin/python +julia -e 'using Pkg; Pkg.add(Pkg.PackageSpec(name="ReactionMechanismSimulator", url="https://github.com/hwpang/ReactionMechanismSimulator.jl.git", rev="fix_installation")); using ReactionMechanismSimulator' diff --git a/setup.py b/setup.py index 604a856eb1..3089e755c6 100644 --- a/setup.py +++ b/setup.py @@ -168,34 +168,40 @@ ################################################################################ ext_modules = [] -if 'install' in sys.argv: - # This is so users can still do simply `python setup.py install` - ext_modules.extend(main_ext_modules) - ext_modules.extend(solver_ext_modules) -if 'main' in sys.argv: - # This is for `python setup.py build_ext main` - sys.argv.remove('main') - ext_modules.extend(main_ext_modules) -if 'solver' in sys.argv: - # This is for `python setup.py build_ext solver` - sys.argv.remove('solver') - ext_modules.extend(solver_ext_modules) -if 'arkane' in sys.argv: - # This is for `python setup.py build_ext arkane` - sys.argv.remove('arkane') - ext_modules.extend(main_ext_modules) - ext_modules.extend(arkane_ext_modules) -if 'minimal' in sys.argv: - # This starts with the full install list, but removes anything that has a pure python mode - # i.e. in only includes things whose source is .pyx - sys.argv.remove('minimal') - temporary_list = [] - temporary_list.extend(main_ext_modules) - temporary_list.extend(solver_ext_modules) - for module in temporary_list: - for source in module.sources: - if os.path.splitext(source)[1] == '.pyx': - ext_modules.append(module) + +ext_modules.extend(main_ext_modules) +ext_modules.extend(solver_ext_modules) +ext_modules.extend(arkane_ext_modules) + + +# if 'install' in sys.argv: +# # This is so users can still do simply `python setup.py install` +# ext_modules.extend(main_ext_modules) +# ext_modules.extend(solver_ext_modules) +# if 'main' in sys.argv: +# # This is for `python setup.py build_ext main` +# sys.argv.remove('main') +# ext_modules.extend(main_ext_modules) +# if 'solver' in sys.argv: +# # This is for `python setup.py build_ext solver` +# sys.argv.remove('solver') +# ext_modules.extend(solver_ext_modules) +# if 'arkane' in sys.argv: +# # This is for `python setup.py build_ext arkane` +# sys.argv.remove('arkane') +# ext_modules.extend(main_ext_modules) +# ext_modules.extend(arkane_ext_modules) +# if 'minimal' in sys.argv: +# # This starts with the full install list, but removes anything that has a pure python mode +# # i.e. in only includes things whose source is .pyx +# sys.argv.remove('minimal') +# temporary_list = [] +# temporary_list.extend(main_ext_modules) +# temporary_list.extend(solver_ext_modules) +# for module in temporary_list: +# for source in module.sources: +# if os.path.splitext(source)[1] == '.pyx': +# ext_modules.append(module) # Remove duplicates while preserving order: ext_modules = list(OrderedDict.fromkeys(ext_modules)) @@ -215,7 +221,6 @@ 'scripts/standardizeModelSpeciesNames.py', 'scripts/thermoEstimator.py', 'scripts/isotopes.py', - 'testing/databaseTest.py', ] modules = [] @@ -250,6 +255,6 @@ packages=['rmgpy', 'arkane'], py_modules=modules, scripts=scripts, - ext_modules=cythonize(ext_modules, build_dir='build', compiler_directives=directives), + ext_modules=cythonize(ext_modules, compiler_directives=directives), include_dirs=['.', numpy.get_include()], ) From 6d82371afee74130052e0db1e5530421c5e8bc96 Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Fri, 17 Jan 2025 14:30:12 -0500 Subject: [PATCH 19/51] cleanup setup.py towards making rmg installable --- setup.py | 226 ++++++++++++++++--------------------------------------- 1 file changed, 65 insertions(+), 161 deletions(-) diff --git a/setup.py b/setup.py index 3089e755c6..921cd91fa6 100644 --- a/setup.py +++ b/setup.py @@ -27,10 +27,6 @@ # # ############################################################################### -import sys -import os -from collections import OrderedDict - try: from distutils.core import setup from distutils.extension import Extension @@ -51,6 +47,8 @@ print('NumPy (http://numpy.scipy.org/) is required to build or install RMG Py.') raise +from setuptools import find_packages + # Create annotated HTML files for each of the Cython modules Options.annotate = True @@ -63,149 +61,68 @@ # 'embedsignature': True, } -################################################################################ - -main_ext_modules = [ +ext_modules = [ # RMG - Extension('rmgpy.rmgobject', ['rmgpy/rmgobject.pyx']), + 'rmgpy/rmgobject.pyx', # Kinetics - Extension('rmgpy.kinetics.arrhenius', ['rmgpy/kinetics/arrhenius.pyx']), - Extension('rmgpy.kinetics.chebyshev', ['rmgpy/kinetics/chebyshev.pyx']), - Extension('rmgpy.kinetics.kineticsdata', ['rmgpy/kinetics/kineticsdata.pyx']), - Extension('rmgpy.kinetics.falloff', ['rmgpy/kinetics/falloff.pyx']), - Extension('rmgpy.kinetics.model', ['rmgpy/kinetics/model.pyx']), - Extension('rmgpy.kinetics.tunneling', ['rmgpy/kinetics/tunneling.pyx']), - Extension('rmgpy.kinetics.surface', ['rmgpy/kinetics/surface.pyx']), - Extension('rmgpy.kinetics.uncertainties', ['rmgpy/kinetics/uncertainties.pyx']), + 'rmgpy/kinetics/arrhenius.pyx', + 'rmgpy/kinetics/chebyshev.pyx', + 'rmgpy/kinetics/kineticsdata.pyx', + 'rmgpy/kinetics/falloff.pyx', + 'rmgpy/kinetics/model.pyx', + 'rmgpy/kinetics/tunneling.pyx', + 'rmgpy/kinetics/surface.pyx', + 'rmgpy/kinetics/uncertainties.pyx', # Molecules and molecular representations - Extension('rmgpy.molecule.atomtype', ['rmgpy/molecule/atomtype.py'], include_dirs=['.']), - Extension('rmgpy.molecule.element', ['rmgpy/molecule/element.py'], include_dirs=['.']), - Extension('rmgpy.molecule.graph', ['rmgpy/molecule/graph.pyx'], include_dirs=['.']), - Extension('rmgpy.molecule.group', ['rmgpy/molecule/group.py'], include_dirs=['.']), - Extension('rmgpy.molecule.molecule', ['rmgpy/molecule/molecule.py'], include_dirs=['.']), - Extension('rmgpy.molecule.symmetry', ['rmgpy/molecule/symmetry.py'], include_dirs=['.']), - Extension('rmgpy.molecule.vf2', ['rmgpy/molecule/vf2.pyx'], include_dirs=['.']), - Extension('rmgpy.molecule.converter', ['rmgpy/molecule/converter.py'], include_dirs=['.']), - Extension('rmgpy.molecule.translator', ['rmgpy/molecule/translator.py'], include_dirs=['.']), - Extension('rmgpy.molecule.util', ['rmgpy/molecule/util.py'], include_dirs=['.']), - Extension('rmgpy.molecule.inchi', ['rmgpy/molecule/inchi.py'], include_dirs=['.']), - Extension('rmgpy.molecule.resonance', ['rmgpy/molecule/resonance.py'], include_dirs=['.']), - Extension('rmgpy.molecule.pathfinder', ['rmgpy/molecule/pathfinder.py'], include_dirs=['.']), - Extension('rmgpy.molecule.kekulize', ['rmgpy/molecule/kekulize.pyx'], include_dirs=['.']), - # Pressure dependence - Extension('rmgpy.pdep.collision', ['rmgpy/pdep/collision.pyx']), - Extension('rmgpy.pdep.configuration', ['rmgpy/pdep/configuration.pyx']), - Extension('rmgpy.pdep.me', ['rmgpy/pdep/me.pyx']), - Extension('rmgpy.pdep.msc', ['rmgpy/pdep/msc.pyx']), - Extension('rmgpy.pdep.reaction', ['rmgpy/pdep/reaction.pyx']), - Extension('rmgpy.pdep.rs', ['rmgpy/pdep/rs.pyx']), - Extension('rmgpy.pdep.cse', ['rmgpy/pdep/cse.pyx']), - # Statistical mechanics - Extension('rmgpy.statmech.conformer', ['rmgpy/statmech/conformer.pyx']), - Extension('rmgpy.statmech.mode', ['rmgpy/statmech/mode.pyx']), - Extension('rmgpy.statmech.rotation', ['rmgpy/statmech/rotation.pyx']), - Extension('rmgpy.statmech.schrodinger', ['rmgpy/statmech/schrodinger.pyx']), - Extension('rmgpy.statmech.torsion', ['rmgpy/statmech/torsion.pyx']), - Extension('rmgpy.statmech.translation', ['rmgpy/statmech/translation.pyx']), - Extension('rmgpy.statmech.vibration', ['rmgpy/statmech/vibration.pyx']), - # Thermodynamics - Extension('rmgpy.thermo.thermodata', ['rmgpy/thermo/thermodata.pyx']), - Extension('rmgpy.thermo.model', ['rmgpy/thermo/model.pyx']), - Extension('rmgpy.thermo.nasa', ['rmgpy/thermo/nasa.pyx']), - Extension('rmgpy.thermo.wilhoit', ['rmgpy/thermo/wilhoit.pyx']), - # Miscellaneous - Extension('rmgpy.constants', ['rmgpy/constants.py'], include_dirs=['.']), - Extension('rmgpy.quantity', ['rmgpy/quantity.py'], include_dirs=['.']), - Extension('rmgpy.reaction', ['rmgpy/reaction.py'], include_dirs=['.']), - Extension('rmgpy.species', ['rmgpy/species.py'], include_dirs=['.']), - Extension('rmgpy.chemkin', ['rmgpy/chemkin.pyx'], include_dirs=['.']), -] - -solver_ext_modules = [ - Extension('rmgpy.solver.base', ['rmgpy/solver/base.pyx'], include_dirs=['.']), - Extension('rmgpy.solver.simple', ['rmgpy/solver/simple.pyx'], include_dirs=['.']), - Extension('rmgpy.solver.liquid', ['rmgpy/solver/liquid.pyx'], include_dirs=['.']), - Extension('rmgpy.solver.mbSampled', ['rmgpy/solver/mbSampled.pyx'], include_dirs=['.']), - Extension('rmgpy.solver.surface', ['rmgpy/solver/surface.pyx'], include_dirs=['.']), -] - -arkane_ext_modules = [ - # RMG - Extension('rmgpy.rmgobject', ['rmgpy/rmgobject.pyx']), - # Kinetics - Extension('rmgpy.kinetics.arrhenius', ['rmgpy/kinetics/arrhenius.pyx']), - Extension('rmgpy.kinetics.chebyshev', ['rmgpy/kinetics/chebyshev.pyx']), - Extension('rmgpy.kinetics.kineticsdata', ['rmgpy/kinetics/kineticsdata.pyx']), - Extension('rmgpy.kinetics.falloff', ['rmgpy/kinetics/falloff.pyx']), - Extension('rmgpy.kinetics.model', ['rmgpy/kinetics/model.pyx']), - Extension('rmgpy.kinetics.tunneling', ['rmgpy/kinetics/tunneling.pyx']), + 'rmgpy/molecule/atomtype.py', + 'rmgpy/molecule/element.py', + 'rmgpy/molecule/graph.pyx', + 'rmgpy/molecule/group.py', + 'rmgpy/molecule/molecule.py', + 'rmgpy/molecule/symmetry.py', + 'rmgpy/molecule/vf2.pyx', + 'rmgpy/molecule/converter.py', + 'rmgpy/molecule/translator.py', + 'rmgpy/molecule/util.py', + 'rmgpy/molecule/inchi.py', + 'rmgpy/molecule/resonance.py', + 'rmgpy/molecule/pathfinder.py', + 'rmgpy/molecule/kekulize.pyx', # Pressure dependence - Extension('rmgpy.pdep.collision', ['rmgpy/pdep/collision.pyx']), - Extension('rmgpy.pdep.configuration', ['rmgpy/pdep/configuration.pyx']), - Extension('rmgpy.pdep.me', ['rmgpy/pdep/me.pyx']), - Extension('rmgpy.pdep.msc', ['rmgpy/pdep/msc.pyx']), - Extension('rmgpy.pdep.reaction', ['rmgpy/pdep/reaction.pyx']), - Extension('rmgpy.pdep.rs', ['rmgpy/pdep/rs.pyx']), - Extension('rmgpy.pdep.cse', ['rmgpy/pdep/cse.pyx']), + 'rmgpy/pdep/collision.pyx', + 'rmgpy/pdep/configuration.pyx', + 'rmgpy/pdep/me.pyx', + 'rmgpy/pdep/msc.pyx', + 'rmgpy/pdep/reaction.pyx', + 'rmgpy/pdep/rs.pyx', + 'rmgpy/pdep/cse.pyx', # Statistical mechanics - Extension('rmgpy.statmech.conformer', ['rmgpy/statmech/conformer.pyx']), - Extension('rmgpy.statmech.mode', ['rmgpy/statmech/mode.pyx']), - Extension('rmgpy.statmech.rotation', ['rmgpy/statmech/rotation.pyx']), - Extension('rmgpy.statmech.schrodinger', ['rmgpy/statmech/schrodinger.pyx']), - Extension('rmgpy.statmech.torsion', ['rmgpy/statmech/torsion.pyx']), - Extension('rmgpy.statmech.translation', ['rmgpy/statmech/translation.pyx']), - Extension('rmgpy.statmech.vibration', ['rmgpy/statmech/vibration.pyx']), + 'rmgpy/statmech/conformer.pyx', + 'rmgpy/statmech/mode.pyx', + 'rmgpy/statmech/rotation.pyx', + 'rmgpy/statmech/schrodinger.pyx', + 'rmgpy/statmech/torsion.pyx', + 'rmgpy/statmech/translation.pyx', + 'rmgpy/statmech/vibration.pyx', # Thermodynamics - Extension('rmgpy.thermo.thermodata', ['rmgpy/thermo/thermodata.pyx']), - Extension('rmgpy.thermo.model', ['rmgpy/thermo/model.pyx']), - Extension('rmgpy.thermo.nasa', ['rmgpy/thermo/nasa.pyx']), - Extension('rmgpy.thermo.wilhoit', ['rmgpy/thermo/wilhoit.pyx']), + 'rmgpy/thermo/thermodata.pyx', + 'rmgpy/thermo/model.pyx', + 'rmgpy/thermo/nasa.pyx', + 'rmgpy/thermo/wilhoit.pyx', # Miscellaneous - Extension('rmgpy.constants', ['rmgpy/constants.py'], include_dirs=['.']), - Extension('rmgpy.quantity', ['rmgpy/quantity.py'], include_dirs=['.']), + 'rmgpy/constants.py', + 'rmgpy/quantity.py', + 'rmgpy/reaction.py', + 'rmgpy/species.py', + 'rmgpy/chemkin.pyx', + # solvers + 'rmgpy/solver/base.pyx', + 'rmgpy/solver/simple.pyx', + 'rmgpy/solver/liquid.pyx', + 'rmgpy/solver/mbSampled.pyx', + 'rmgpy/solver/surface.pyx', ] -################################################################################ - -ext_modules = [] - -ext_modules.extend(main_ext_modules) -ext_modules.extend(solver_ext_modules) -ext_modules.extend(arkane_ext_modules) - - -# if 'install' in sys.argv: -# # This is so users can still do simply `python setup.py install` -# ext_modules.extend(main_ext_modules) -# ext_modules.extend(solver_ext_modules) -# if 'main' in sys.argv: -# # This is for `python setup.py build_ext main` -# sys.argv.remove('main') -# ext_modules.extend(main_ext_modules) -# if 'solver' in sys.argv: -# # This is for `python setup.py build_ext solver` -# sys.argv.remove('solver') -# ext_modules.extend(solver_ext_modules) -# if 'arkane' in sys.argv: -# # This is for `python setup.py build_ext arkane` -# sys.argv.remove('arkane') -# ext_modules.extend(main_ext_modules) -# ext_modules.extend(arkane_ext_modules) -# if 'minimal' in sys.argv: -# # This starts with the full install list, but removes anything that has a pure python mode -# # i.e. in only includes things whose source is .pyx -# sys.argv.remove('minimal') -# temporary_list = [] -# temporary_list.extend(main_ext_modules) -# temporary_list.extend(solver_ext_modules) -# for module in temporary_list: -# for source in module.sources: -# if os.path.splitext(source)[1] == '.pyx': -# ext_modules.append(module) - -# Remove duplicates while preserving order: -ext_modules = list(OrderedDict.fromkeys(ext_modules)) - scripts = [ 'Arkane.py', 'rmg.py', @@ -223,38 +140,25 @@ 'scripts/isotopes.py', ] -modules = [] -for root, dirs, files in os.walk('rmgpy'): - if 'test_data' in root: - continue - for f in files: - if f.endswith('.py') or f.endswith('.pyx'): - if 'Test' not in f and '__init__' not in f: - module = 'rmgpy' + root.partition('rmgpy')[-1].replace('/', '.') + '.' + f.partition('.py')[0] - modules.append(module) -for root, dirs, files in os.walk('arkane'): - if 'data' in root: - continue - for f in files: - if f.endswith('.py') or f.endswith('.pyx'): - if 'Test' not in f and '__init__' not in f: - module = 'arkane' + root.partition('arkane')[-1].replace('/', '.') + '.' + f.partition('.py')[0] - modules.append(module) - # Read the version number exec(open('rmgpy/version.py').read()) # Initiate the build and/or installation setup( - name='RMG-Py', + name='reactionmechanismgenerator', version=__version__, description='Reaction Mechanism Generator', author='William H. Green and the RMG Team', author_email='rmg_dev@mit.edu', url='http://reactionmechanismgenerator.github.io', - packages=['rmgpy', 'arkane'], - py_modules=modules, + python_requires='>=3.9,<3.10', + packages=find_packages(["rmgpy", "arkane"]), scripts=scripts, - ext_modules=cythonize(ext_modules, compiler_directives=directives), - include_dirs=['.', numpy.get_include()], + include_package_data=True, + package_data={ + "rmgpy": ["*.pxd", "*.pyx", "*.c", "*.cpp"], + }, + ext_modules=cythonize(ext_modules, nthreads=8, compiler_directives=directives), + include_dirs=numpy.get_include(), + install_requires=["Cython", "numpy"], ) From aa7d7f23e12bbe251b4ad61743e00c479f6aa0cb Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Fri, 17 Jan 2025 14:34:35 -0500 Subject: [PATCH 20/51] dont dump c files --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 921cd91fa6..dcec9f7d87 100644 --- a/setup.py +++ b/setup.py @@ -156,7 +156,7 @@ scripts=scripts, include_package_data=True, package_data={ - "rmgpy": ["*.pxd", "*.pyx", "*.c", "*.cpp"], + "rmgpy": ["*.pxd"], }, ext_modules=cythonize(ext_modules, nthreads=8, compiler_directives=directives), include_dirs=numpy.get_include(), From fcc5fee1374641338510a4b118a8aac7f496e181 Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Fri, 17 Jan 2025 14:40:52 -0500 Subject: [PATCH 21/51] no html files --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index dcec9f7d87..b2912b3e7e 100644 --- a/setup.py +++ b/setup.py @@ -50,7 +50,7 @@ from setuptools import find_packages # Create annotated HTML files for each of the Cython modules -Options.annotate = True +Options.annotate = False directives = { # Set input language version to python 3 From 0a1fe0b4755892f38cf16d8dd19a1c39238a6121 Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Fri, 17 Jan 2025 15:48:30 -0500 Subject: [PATCH 22/51] openbabel stfu --- arkane/encorr/data.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arkane/encorr/data.py b/arkane/encorr/data.py index d96e292048..cb27decd2a 100644 --- a/arkane/encorr/data.py +++ b/arkane/encorr/data.py @@ -54,6 +54,8 @@ from arkane.exceptions import BondAdditivityCorrectionError from arkane.modelchem import LevelOfTheory, CompositeLevelOfTheory +pybel.ob.obErrorLog.SetOutputLevel(0) + # ######## Database loading ########## quantum_corrections_path = os.path.join(settings['database.directory'], 'quantum_corrections', 'data.py') spec = importlib.util.spec_from_file_location("quantum_calculations", quantum_corrections_path) From dae8a5686899738edb084dacdc90408f8054a07d Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Fri, 17 Jan 2025 15:48:59 -0500 Subject: [PATCH 23/51] make rmg locally installable with pip install --- .gitignore | 5 +++++ Makefile | 2 +- setup.py | 13 ++++--------- utilities.py | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 38d73e2bc1..723a18e5cb 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,9 @@ # ################################################################################ +# build dir +reactionmechanismgenerator.egg-info/ + # MacOS files .DS_Store @@ -11,6 +14,8 @@ *.pyc *.so *.pyd +# and intermediate source files +*.c # Image files generated by RMG *.png diff --git a/Makefile b/Makefile index 029f3c3275..dc9e10ccb6 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ clean-solver: install: @ python utilities.py check-pydas - python -m pip install -vv . + python -m pip install -vv --no-cache-dir -e . q2dtor: @ echo -e "\nInstalling Q2DTor...\n" diff --git a/setup.py b/setup.py index b2912b3e7e..4bebd5a556 100644 --- a/setup.py +++ b/setup.py @@ -27,12 +27,7 @@ # # ############################################################################### -try: - from distutils.core import setup - from distutils.extension import Extension -except ImportError: - print('The distutils package is required to build or install RMG Py.') - raise +from setuptools import setup try: from Cython.Build import cythonize @@ -152,13 +147,13 @@ author_email='rmg_dev@mit.edu', url='http://reactionmechanismgenerator.github.io', python_requires='>=3.9,<3.10', - packages=find_packages(["rmgpy", "arkane"]), + packages=find_packages(where='.', include=["rmgpy*"]) + find_packages(where='.', include=["arkane*"]), scripts=scripts, include_package_data=True, package_data={ - "rmgpy": ["*.pxd"], + "": ["*.pxd"], }, - ext_modules=cythonize(ext_modules, nthreads=8, compiler_directives=directives), + ext_modules=cythonize(ext_modules, compiler_directives=directives), include_dirs=numpy.get_include(), install_requires=["Cython", "numpy"], ) diff --git a/utilities.py b/utilities.py index 87d39e7384..757d678d97 100644 --- a/utilities.py +++ b/utilities.py @@ -253,7 +253,7 @@ def clean(subdirectory=''): if platform.system() == 'Windows': extensions = ['.pyd', '.pyc'] else: - extensions = ['.so', '.pyc'] + extensions = ['.so', '.pyc', ".c"] # Remove temporary build files print('Removing build directory...') From 7102ef51357ac7b56263c50c0479306093e57d14 Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Fri, 17 Jan 2025 15:51:07 -0500 Subject: [PATCH 24/51] don't modify PATH --- .github/workflows/CI.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 40949b21a5..48f17074ac 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -102,11 +102,11 @@ jobs: cd .. git clone -b $RMG_DATABASE_BRANCH https://github.com/ReactionMechanismGenerator/RMG-database.git - # modify env variables as directed in the RMG installation instructions - - name: Set Environment Variables - run: | - RUNNER_CWD=$(pwd) - echo "$RUNNER_CWD/RMG-Py" >> $GITHUB_PATH + # # modify env variables as directed in the RMG installation instructions + # - name: Set Environment Variables + # run: | + # RUNNER_CWD=$(pwd) + # echo "$RUNNER_CWD/RMG-Py" >> $GITHUB_PATH # I don't think this actually accomplishes anything # RMG build step - name: make RMG From 5cd1bd5c5d13df44c8dae74ca1f456b224b374d8 Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Fri, 17 Jan 2025 15:57:16 -0500 Subject: [PATCH 25/51] remove deprecated make targets, consolidate checks --- Makefile | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index dc9e10ccb6..996e600787 100644 --- a/Makefile +++ b/Makefile @@ -7,28 +7,14 @@ CC=gcc CXX=g++ -.PHONY : all minimal main solver check pycheck arkane clean install decython documentation test q2dtor +.PHONY : all check clean install decython documentation test q2dtor -all: pycheck main solver check - -minimal: - python setup.py build_ext minimal --inplace --build-temp . - -main: - python setup.py build_ext main --inplace --build-temp . - -solver: - @ python utilities.py check-pydas - python setup.py build_ext solver --inplace --build-temp . - -arkane: - python setup.py build_ext arkane --inplace --build-temp . +all: pycheck install check check: @ python utilities.py check-dependencies - -pycheck: @ python utilities.py check-python + @ python utilities.py check-pydas documentation: $(MAKE) -C documentation html From 934f68bcce35bea3836d24659a85691d763767e4 Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Fri, 17 Jan 2025 16:00:06 -0500 Subject: [PATCH 26/51] port some other changes from the full ci --- .github/workflows/pure_python_ci.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/pure_python_ci.yml b/.github/workflows/pure_python_ci.yml index 7fd9471353..80ab12b0b1 100644 --- a/.github/workflows/pure_python_ci.yml +++ b/.github/workflows/pure_python_ci.yml @@ -58,6 +58,7 @@ jobs: use-mamba: true show-channel-urls: true channels: conda-forge,cantera,rmg + conda-remove-defaults: "true" # list the environment for debugging purposes - name: mamba info @@ -71,13 +72,6 @@ jobs: cd .. git clone -b $RMG_DATABASE_BRANCH https://github.com/ReactionMechanismGenerator/RMG-database.git - # modify env variables as directed in the RMG installation instructions - - name: Set Environment Variables - run: | - RUNNER_CWD=$(pwd) - # echo "PYTHONPATH=$RUNNER_CWD/RMG-Py:$PYTHONPATH" >> $GITHUB_ENV - echo "$RUNNER_CWD/RMG-Py" >> $GITHUB_PATH - # RMG build step - name: make RMG run: | From 348059dfbe3db82e8f05a7c461ccbe2aa550e0d3 Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Fri, 17 Jan 2025 16:01:58 -0500 Subject: [PATCH 27/51] typo --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 996e600787..6ccdf07af8 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ CXX=g++ .PHONY : all check clean install decython documentation test q2dtor -all: pycheck install check +all: check install check check: @ python utilities.py check-dependencies From 50155d93f4ab7a4ec2f6b20d06db2c1f1a308210 Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Fri, 17 Jan 2025 16:32:42 -0500 Subject: [PATCH 28/51] switch back to conda --- .github/workflows/CI.yml | 10 +++++----- .github/workflows/pure_python_ci.yml | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 48f17074ac..e9871882a8 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -85,16 +85,16 @@ jobs: miniforge-version: latest python-version: ${{ matrix.python-version }} activate-environment: rmg_env - use-mamba: true + auto-update-conda: true show-channel-urls: true channels: conda-forge,cantera,rmg conda-remove-defaults: "true" # list the environment for debugging purposes - - name: mamba info + - name: conda info run: | - mamba info - mamba list + conda info + conda list # Clone RMG-database - name: Clone RMG-database @@ -320,7 +320,7 @@ jobs: - name: Code coverage install and run if: success() || ( failure() && steps.regression-execution.conclusion == 'success' ) run: | - mamba install -y -c conda-forge codecov + conda install -y -c conda-forge codecov codecov build-and-push-docker: diff --git a/.github/workflows/pure_python_ci.yml b/.github/workflows/pure_python_ci.yml index 80ab12b0b1..e40d42068f 100644 --- a/.github/workflows/pure_python_ci.yml +++ b/.github/workflows/pure_python_ci.yml @@ -55,16 +55,16 @@ jobs: miniforge-version: latest python-version: ${{ matrix.python-version }} activate-environment: rmg_env - use-mamba: true + auto-update-conda: true show-channel-urls: true channels: conda-forge,cantera,rmg conda-remove-defaults: "true" # list the environment for debugging purposes - - name: mamba info + - name: conda info run: | - mamba info - mamba list + conda info + conda list # Clone RMG-database - name: Clone RMG-database From 9ab6f75af9395c1abb809b3c2ef32f52e3ada082 Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Fri, 17 Jan 2025 16:55:42 -0500 Subject: [PATCH 29/51] [DEBUG] wtf is juliaup doing to my os? --- .github/workflows/CI.yml | 10 ++++++++++ install_rms.sh | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e9871882a8..5144470cfa 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -113,6 +113,11 @@ jobs: run: | make install + - name: PRE-JULIA ENVIRONMENT + run: | + printenv | sort + conda list + - name: Setup Juliaup uses: julia-actions/install-juliaup@v2 with: @@ -123,6 +128,11 @@ jobs: timeout-minutes: 120 # this usually takes 20-45 minutes (or hangs for 6+ hours). run: . install_rms.sh + - name: POST-JULIA ENVIRONMENT + run: | + printenv | sort + conda list + - name: Install Q2DTor run: echo "" | make q2dtor diff --git a/install_rms.sh b/install_rms.sh index 7fb9716018..1cac56a3b9 100644 --- a/install_rms.sh +++ b/install_rms.sh @@ -10,4 +10,4 @@ conda install -y conda-forge::pyjuliacall export JULIA_CONDAPKG_BACKEND=Current export JULIA_CONDAPKG_EXE=$CONDA_EXE export JULIA_PYTHONCALL_EXE=$CONDA_PREFIX/bin/python -julia -e 'using Pkg; Pkg.add(Pkg.PackageSpec(name="ReactionMechanismSimulator", url="https://github.com/hwpang/ReactionMechanismSimulator.jl.git", rev="fix_installation")); using ReactionMechanismSimulator' +julia -t 1 -e 'using Pkg; Pkg.add(Pkg.PackageSpec(name="ReactionMechanismSimulator", url="https://github.com/hwpang/ReactionMechanismSimulator.jl.git", rev="fix_installation")); using ReactionMechanismSimulator' From 7d817219e3553ed12751ea51f471a9c929463486 Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Tue, 21 Jan 2025 13:25:09 -0500 Subject: [PATCH 30/51] Multiprocessing `fork` instead of `spawn`, see extended see: https://github.com/ReactionMechanismGenerator/RMG-Py/pull/2749#issuecomment-2593918527 --- test/rmgpy/rmg/modelTest.py | 6 ++++++ test/rmgpy/rmg/reactTest.py | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/test/rmgpy/rmg/modelTest.py b/test/rmgpy/rmg/modelTest.py index 8c460f5df4..02f21d1a1c 100644 --- a/test/rmgpy/rmg/modelTest.py +++ b/test/rmgpy/rmg/modelTest.py @@ -321,6 +321,9 @@ def test_add_new_surface_objects(self): """ basic test that surface movement object management works properly """ + import multiprocessing + + multiprocessing.set_start_method('fork') # create object with ReactionSystem behavior class rsys: @@ -448,6 +451,9 @@ def test_make_new_reaction(self): """ Test that CoreEdgeReactionModel.make_new_reaction method correctly works. """ + import multiprocessing + + multiprocessing.set_start_method('fork') procnum = 2 spcA = Species().from_smiles("[OH]") diff --git a/test/rmgpy/rmg/reactTest.py b/test/rmgpy/rmg/reactTest.py index 8c4d77e1a7..2c2ea2513e 100644 --- a/test/rmgpy/rmg/reactTest.py +++ b/test/rmgpy/rmg/reactTest.py @@ -89,6 +89,9 @@ def test_react_parallel(self): Test that the ``react`` function works in parallel using Python multiprocessing """ import rmgpy.rmg.main + import multiprocessing + + multiprocessing.set_start_method('fork') rmgpy.rmg.main.maxproc = 2 procnum = 2 @@ -133,6 +136,9 @@ def test_react_all_parallel(self): Test that the ``react_all`` function works in parallel using Python multiprocessing """ import rmgpy.rmg.main + import multiprocessing + + multiprocessing.set_start_method('fork') rmgpy.rmg.main.maxproc = 2 procnum = 2 From eecf41cbddb46f171be3e537052e17b694e2b0a3 Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Tue, 21 Jan 2025 13:32:03 -0500 Subject: [PATCH 31/51] re-build rmg after RMS install to ensure deps arent' broken --- .github/workflows/CI.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 5144470cfa..3634735bb8 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -133,6 +133,11 @@ jobs: printenv | sort conda list + - name: Rebuild RMG + run: | + make clean + make + - name: Install Q2DTor run: echo "" | make q2dtor From 9dd89267a03366da7f3f4f63309394df704521c5 Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Tue, 21 Jan 2025 14:54:37 -0500 Subject: [PATCH 32/51] move setting start method to conftest.py to run it once --- test/conftest.py | 3 +++ test/rmgpy/rmg/modelTest.py | 6 ------ test/rmgpy/rmg/reactTest.py | 6 ------ 3 files changed, 3 insertions(+), 12 deletions(-) create mode 100644 test/conftest.py diff --git a/test/conftest.py b/test/conftest.py new file mode 100644 index 0000000000..e31c2d0649 --- /dev/null +++ b/test/conftest.py @@ -0,0 +1,3 @@ +import multiprocessing + +multiprocessing.set_start_method('fork') diff --git a/test/rmgpy/rmg/modelTest.py b/test/rmgpy/rmg/modelTest.py index 02f21d1a1c..8c460f5df4 100644 --- a/test/rmgpy/rmg/modelTest.py +++ b/test/rmgpy/rmg/modelTest.py @@ -321,9 +321,6 @@ def test_add_new_surface_objects(self): """ basic test that surface movement object management works properly """ - import multiprocessing - - multiprocessing.set_start_method('fork') # create object with ReactionSystem behavior class rsys: @@ -451,9 +448,6 @@ def test_make_new_reaction(self): """ Test that CoreEdgeReactionModel.make_new_reaction method correctly works. """ - import multiprocessing - - multiprocessing.set_start_method('fork') procnum = 2 spcA = Species().from_smiles("[OH]") diff --git a/test/rmgpy/rmg/reactTest.py b/test/rmgpy/rmg/reactTest.py index 2c2ea2513e..8c4d77e1a7 100644 --- a/test/rmgpy/rmg/reactTest.py +++ b/test/rmgpy/rmg/reactTest.py @@ -89,9 +89,6 @@ def test_react_parallel(self): Test that the ``react`` function works in parallel using Python multiprocessing """ import rmgpy.rmg.main - import multiprocessing - - multiprocessing.set_start_method('fork') rmgpy.rmg.main.maxproc = 2 procnum = 2 @@ -136,9 +133,6 @@ def test_react_all_parallel(self): Test that the ``react_all`` function works in parallel using Python multiprocessing """ import rmgpy.rmg.main - import multiprocessing - - multiprocessing.set_start_method('fork') rmgpy.rmg.main.maxproc = 2 procnum = 2 From 67385ae47a4717db08518b30298f5644113de4bb Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Tue, 21 Jan 2025 14:56:32 -0500 Subject: [PATCH 33/51] finish the incomplete setting of x86 emulation https://stackoverflow.com/a/71554275 --- .github/workflows/CI.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3634735bb8..fb0ea5345f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -89,6 +89,11 @@ jobs: show-channel-urls: true channels: conda-forge,cantera,rmg conda-remove-defaults: "true" + + - name: Continue to Coerce Arm-Mac + if: matrix.os == 'macos-latest' + run: | + conda config --env --set subdir osx-64 # list the environment for debugging purposes - name: conda info From 77e501386bf177e7e15e58414d83e15c6e3b1c9c Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Tue, 21 Jan 2025 14:58:17 -0500 Subject: [PATCH 34/51] try and make julia leave the compilers alone --- .github/workflows/CI.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index fb0ea5345f..cb2982305f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -122,6 +122,10 @@ jobs: run: | printenv | sort conda list + + - name: Try and Make Julia stop ruining the Compilers + run: | + echo "LD_PRELOAD=$CONDA_PREFIX/lib/libstdc++.so.6" >> $GITHUB_ENV - name: Setup Juliaup uses: julia-actions/install-juliaup@v2 From c92c837f5e85a82bc15e6e8697ffc89bc799ff58 Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Tue, 21 Jan 2025 15:04:45 -0500 Subject: [PATCH 35/51] this should not be required --- .github/workflows/CI.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index cb2982305f..78464023cb 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -142,10 +142,10 @@ jobs: printenv | sort conda list - - name: Rebuild RMG - run: | - make clean - make + # - name: Rebuild RMG + # run: | + # make clean + # make - name: Install Q2DTor run: echo "" | make q2dtor From b1fbe5c65fb4fcda70983757b03f3803cd262a5b Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Tue, 21 Jan 2025 15:50:43 -0500 Subject: [PATCH 36/51] try incrementing Julia version, IDEK at this point --- .github/workflows/CI.yml | 2 +- install_rms.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 78464023cb..44558f88fa 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -130,7 +130,7 @@ jobs: - name: Setup Juliaup uses: julia-actions/install-juliaup@v2 with: - channel: '1.9' + channel: '1.11' # RMS installation and linking to Julia - name: Install and link Julia dependencies diff --git a/install_rms.sh b/install_rms.sh index 1cac56a3b9..ebab5c5e72 100644 --- a/install_rms.sh +++ b/install_rms.sh @@ -2,8 +2,8 @@ # start by installing juliaup on your system globally # curl -fsSL https://install.julialang.org | sh # # restart shell -# juliaup add 1.9 -# juliaup default 1.9 +# juliaup add 1.11 +# juliaup default 1.11 # actual steps conda install -y conda-forge::pyjuliacall From d1186706ca4d58d54d20ac2c761e3d6ab8c9e0cb Mon Sep 17 00:00:00 2001 From: jonwzheng Date: Tue, 21 Jan 2025 16:37:23 -0500 Subject: [PATCH 37/51] revert Julia version increment, set back to 1.9 --- .github/workflows/CI.yml | 2 +- install_rms.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 44558f88fa..78464023cb 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -130,7 +130,7 @@ jobs: - name: Setup Juliaup uses: julia-actions/install-juliaup@v2 with: - channel: '1.11' + channel: '1.9' # RMS installation and linking to Julia - name: Install and link Julia dependencies diff --git a/install_rms.sh b/install_rms.sh index ebab5c5e72..1cac56a3b9 100644 --- a/install_rms.sh +++ b/install_rms.sh @@ -2,8 +2,8 @@ # start by installing juliaup on your system globally # curl -fsSL https://install.julialang.org | sh # # restart shell -# juliaup add 1.11 -# juliaup default 1.11 +# juliaup add 1.9 +# juliaup default 1.9 # actual steps conda install -y conda-forge::pyjuliacall From 0d615e69e4ae6c2882a772198882134a620beb5d Mon Sep 17 00:00:00 2001 From: jonwzheng Date: Tue, 21 Jan 2025 16:39:25 -0500 Subject: [PATCH 38/51] try setting LD_LIBRARY_PATH rather than LD_PRELOAD --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 78464023cb..15cd1b773c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -125,7 +125,7 @@ jobs: - name: Try and Make Julia stop ruining the Compilers run: | - echo "LD_PRELOAD=$CONDA_PREFIX/lib/libstdc++.so.6" >> $GITHUB_ENV + export LD_LIBRARY_PATH=$CONDA_PREFIX/lib - name: Setup Juliaup uses: julia-actions/install-juliaup@v2 From 733d2c40dc52896bd930b4a5d9c0bde6619d896d Mon Sep 17 00:00:00 2001 From: jonwzheng Date: Tue, 21 Jan 2025 16:42:03 -0500 Subject: [PATCH 39/51] typo --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 15cd1b773c..c36e5d4451 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -125,7 +125,7 @@ jobs: - name: Try and Make Julia stop ruining the Compilers run: | - export LD_LIBRARY_PATH=$CONDA_PREFIX/lib + echo "LD_LIBRARY_PATH=$CONDA_PREFIX/lib" >> $GITHUB_ENV - name: Setup Juliaup uses: julia-actions/install-juliaup@v2 From 32c899c205ee5a4a7ddc36af1a176036eef6168a Mon Sep 17 00:00:00 2001 From: jonwzheng Date: Tue, 21 Jan 2025 16:42:30 -0500 Subject: [PATCH 40/51] whoopsie - another typo --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c36e5d4451..bdbeee0a97 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -125,7 +125,7 @@ jobs: - name: Try and Make Julia stop ruining the Compilers run: | - echo "LD_LIBRARY_PATH=$CONDA_PREFIX/lib" >> $GITHUB_ENV + echo "export LD_LIBRARY_PATH=$CONDA_PREFIX/lib" >> $GITHUB_ENV - name: Setup Juliaup uses: julia-actions/install-juliaup@v2 From aea0a011c4aaedc70e28affbc0c67b2b7b7d0841 Mon Sep 17 00:00:00 2001 From: jonwzheng Date: Tue, 21 Jan 2025 17:08:17 -0500 Subject: [PATCH 41/51] put Juliaup before path update and add more print statements --- .github/workflows/CI.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index bdbeee0a97..d29768af1b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -122,16 +122,26 @@ jobs: run: | printenv | sort conda list - - - name: Try and Make Julia stop ruining the Compilers - run: | - echo "export LD_LIBRARY_PATH=$CONDA_PREFIX/lib" >> $GITHUB_ENV - name: Setup Juliaup uses: julia-actions/install-juliaup@v2 with: channel: '1.9' + - name: POST JULIAUP + run: | + printenv | sort + conda list + + - name: Try and Make Julia stop ruining the Compilers + run: | + echo "export LD_LIBRARY_PATH=$CONDA_PREFIX/lib" >> $GITHUB_ENV + + - name: POST LIBRARY PATH UPDATE + run: | + printenv | sort + conda list + # RMS installation and linking to Julia - name: Install and link Julia dependencies timeout-minutes: 120 # this usually takes 20-45 minutes (or hangs for 6+ hours). From fb11cb71f19edd8f6851960415a9f922c33eae7b Mon Sep 17 00:00:00 2001 From: jonwzheng Date: Tue, 21 Jan 2025 17:38:22 -0500 Subject: [PATCH 42/51] try without export --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d29768af1b..307745f06b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -135,7 +135,7 @@ jobs: - name: Try and Make Julia stop ruining the Compilers run: | - echo "export LD_LIBRARY_PATH=$CONDA_PREFIX/lib" >> $GITHUB_ENV + echo "LD_LIBRARY_PATH=$CONDA_PREFIX/lib" >> $GITHUB_ENV - name: POST LIBRARY PATH UPDATE run: | From cc0f895d665cc89052b7e738e97dd2ed1643a111 Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Wed, 22 Jan 2025 10:32:01 -0500 Subject: [PATCH 43/51] this is not needed, pure python mode works without it --- .github/workflows/CI.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 307745f06b..e7027933fc 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -90,10 +90,10 @@ jobs: channels: conda-forge,cantera,rmg conda-remove-defaults: "true" - - name: Continue to Coerce Arm-Mac - if: matrix.os == 'macos-latest' - run: | - conda config --env --set subdir osx-64 + # - name: Continue to Coerce Arm-Mac # pure python mode works without this, so it isn't required + # if: matrix.os == 'macos-latest' + # run: | + # conda config --env --set subdir osx-64 # list the environment for debugging purposes - name: conda info From ab2f40893955f304f544d3167b343909d5316157 Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Wed, 22 Jan 2025 10:39:02 -0500 Subject: [PATCH 44/51] don't allow rms to install anything in the conda environment; we have --- install_rms.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/install_rms.sh b/install_rms.sh index 1cac56a3b9..df1ac18855 100644 --- a/install_rms.sh +++ b/install_rms.sh @@ -7,7 +7,12 @@ # actual steps conda install -y conda-forge::pyjuliacall -export JULIA_CONDAPKG_BACKEND=Current -export JULIA_CONDAPKG_EXE=$CONDA_EXE +# export JULIA_CONDAPKG_BACKEND=Current +# export JULIA_CONDAPKG_EXE=$CONDA_EXE +# export JULIA_PYTHONCALL_EXE=$CONDA_PREFIX/bin/python + +# https://juliapy.github.io/PythonCall.jl/stable/pythoncall/#If-you-already-have-Python-and-required-Python-packages-installed +export JULIA_CONDAPKG_BACKEND=Null export JULIA_PYTHONCALL_EXE=$CONDA_PREFIX/bin/python + julia -t 1 -e 'using Pkg; Pkg.add(Pkg.PackageSpec(name="ReactionMechanismSimulator", url="https://github.com/hwpang/ReactionMechanismSimulator.jl.git", rev="fix_installation")); using ReactionMechanismSimulator' From 8f713d39b71fb93d5971ea1f2a05900ac73b9c74 Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Wed, 22 Jan 2025 11:26:17 -0500 Subject: [PATCH 45/51] soft revert --- .github/workflows/CI.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e7027933fc..3c99d5d25f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -133,14 +133,14 @@ jobs: printenv | sort conda list - - name: Try and Make Julia stop ruining the Compilers - run: | - echo "LD_LIBRARY_PATH=$CONDA_PREFIX/lib" >> $GITHUB_ENV + # - name: Try and Make Julia stop ruining the Compilers + # run: | + # echo "LD_LIBRARY_PATH=$CONDA_PREFIX/lib" >> $GITHUB_ENV - - name: POST LIBRARY PATH UPDATE - run: | - printenv | sort - conda list + # - name: POST LIBRARY PATH UPDATE + # run: | + # printenv | sort + # conda list # RMS installation and linking to Julia - name: Install and link Julia dependencies From e844d15a21c323472ac2a1f30d4d6a3383231b4c Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Wed, 22 Jan 2025 13:57:41 -0500 Subject: [PATCH 46/51] more comprehensize debugging info for failed Julia imports --- rmgpy/rmg/reactionmechanismsimulator_reactors.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rmgpy/rmg/reactionmechanismsimulator_reactors.py b/rmgpy/rmg/reactionmechanismsimulator_reactors.py index f40ba703d6..8436eab70f 100644 --- a/rmgpy/rmg/reactionmechanismsimulator_reactors.py +++ b/rmgpy/rmg/reactionmechanismsimulator_reactors.py @@ -46,8 +46,8 @@ Main.seval("using ReactionMechanismSimulator") Main.seval("using ReactionMechanismSimulator.Sundials") NO_JULIA = False -except: - logging.warning("Julia import failed, RMS reactors not available.") +except Exception as e: + logging.warning(f"Julia import failed, RMS reactors not available.\nException: {str(e)}\nStacktrace:\n{e.__traceback__}") from rmgpy import constants from rmgpy.data.kinetics.depository import DepositoryReaction From 5268688e19558c9a1b5c1ebeed626e1c62fabec2 Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Wed, 22 Jan 2025 15:52:28 -0500 Subject: [PATCH 47/51] try and make sure juliacall uses the correct julia --- install_rms.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/install_rms.sh b/install_rms.sh index df1ac18855..86bdbd770e 100644 --- a/install_rms.sh +++ b/install_rms.sh @@ -4,9 +4,10 @@ # # restart shell # juliaup add 1.9 # juliaup default 1.9 +# juliaup remove release # actual steps -conda install -y conda-forge::pyjuliacall +conda install -y conda-forge::pyjuliacall # conda-forge::pyside2 # export JULIA_CONDAPKG_BACKEND=Current # export JULIA_CONDAPKG_EXE=$CONDA_EXE # export JULIA_PYTHONCALL_EXE=$CONDA_PREFIX/bin/python @@ -14,5 +15,9 @@ conda install -y conda-forge::pyjuliacall # https://juliapy.github.io/PythonCall.jl/stable/pythoncall/#If-you-already-have-Python-and-required-Python-packages-installed export JULIA_CONDAPKG_BACKEND=Null export JULIA_PYTHONCALL_EXE=$CONDA_PREFIX/bin/python +# export MPLBACKEND=qt5agg # supported backend for PythonPlot.jl, needed by RMS -julia -t 1 -e 'using Pkg; Pkg.add(Pkg.PackageSpec(name="ReactionMechanismSimulator", url="https://github.com/hwpang/ReactionMechanismSimulator.jl.git", rev="fix_installation")); using ReactionMechanismSimulator' +julia -e 'using Pkg; Pkg.add(Pkg.PackageSpec(name="ReactionMechanismSimulator", url="https://github.com/hwpang/ReactionMechanismSimulator.jl.git", rev="fix_installation")); using ReactionMechanismSimulator; Pkg.instantiate()' + +# ensure that juliacall in Python uses the correct julia executable: https://github.com/JuliaPy/PyJuliaPkg?tab=readme-ov-file#which-julia-gets-used +export PYTHON_JULIAPKG_EXE=$(which julia) From 028ce647d90b97dd54bc53353f46afb686aad8f2 Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Wed, 22 Jan 2025 16:25:08 -0500 Subject: [PATCH 48/51] allow rms install to 'fail', see extended see: https://github.com/ReactionMechanismGenerator/RMG-Py/pull/2749#issuecomment-2608298989 --- install_rms.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_rms.sh b/install_rms.sh index 86bdbd770e..b8eb69af9a 100644 --- a/install_rms.sh +++ b/install_rms.sh @@ -15,9 +15,9 @@ conda install -y conda-forge::pyjuliacall # conda-forge::pyside2 # https://juliapy.github.io/PythonCall.jl/stable/pythoncall/#If-you-already-have-Python-and-required-Python-packages-installed export JULIA_CONDAPKG_BACKEND=Null export JULIA_PYTHONCALL_EXE=$CONDA_PREFIX/bin/python -# export MPLBACKEND=qt5agg # supported backend for PythonPlot.jl, needed by RMS +# export MPLBACKEND=tkagg # supported backend for PythonPlot.jl, needed by RMS -julia -e 'using Pkg; Pkg.add(Pkg.PackageSpec(name="ReactionMechanismSimulator", url="https://github.com/hwpang/ReactionMechanismSimulator.jl.git", rev="fix_installation")); using ReactionMechanismSimulator; Pkg.instantiate()' +julia -e 'using Pkg; Pkg.add(Pkg.PackageSpec(name="ReactionMechanismSimulator", url="https://github.com/hwpang/ReactionMechanismSimulator.jl.git", rev="fix_installation")); using ReactionMechanismSimulator; Pkg.instantiate()' | echo "RMS install error - continuing anyway ¯\_(ツ)_/¯" # ensure that juliacall in Python uses the correct julia executable: https://github.com/JuliaPy/PyJuliaPkg?tab=readme-ov-file#which-julia-gets-used export PYTHON_JULIAPKG_EXE=$(which julia) From cc2c9ba2ae361f1dcec4756b1108011e54343612 Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Wed, 22 Jan 2025 22:40:30 -0500 Subject: [PATCH 49/51] make juliapackage use our globally installed RMS package --- install_rms.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install_rms.sh b/install_rms.sh index b8eb69af9a..ee64604f7e 100644 --- a/install_rms.sh +++ b/install_rms.sh @@ -19,5 +19,6 @@ export JULIA_PYTHONCALL_EXE=$CONDA_PREFIX/bin/python julia -e 'using Pkg; Pkg.add(Pkg.PackageSpec(name="ReactionMechanismSimulator", url="https://github.com/hwpang/ReactionMechanismSimulator.jl.git", rev="fix_installation")); using ReactionMechanismSimulator; Pkg.instantiate()' | echo "RMS install error - continuing anyway ¯\_(ツ)_/¯" -# ensure that juliacall in Python uses the correct julia executable: https://github.com/JuliaPy/PyJuliaPkg?tab=readme-ov-file#which-julia-gets-used +# ensure that juliacall in Python uses the correct julia executable and packages: https://github.com/JuliaPy/PyJuliaPkg?tab=readme-ov-file#which-julia-gets-used export PYTHON_JULIAPKG_EXE=$(which julia) +export PYTHON_JULIAPKG_PROJECT=$HOME/.julia/packages From b2686e66fa2a4f983d63a6ba887ced34defa136e Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Thu, 23 Jan 2025 09:38:06 -0500 Subject: [PATCH 50/51] persist the environment variables changes needed when installing RMS --- .github/workflows/CI.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3c99d5d25f..bb3b8ca2f3 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -142,11 +142,24 @@ jobs: # printenv | sort # conda list + - name: Set some env vars + run: | + echo "JULIA_CONDAPKG_BACKEND=Null" >> $GITHUB_ENV + echo "JULIA_PYTHONCALL_EXE=$CONDA_PREFIX/bin/python" >> $GITHUB_ENV + # RMS installation and linking to Julia - name: Install and link Julia dependencies timeout-minutes: 120 # this usually takes 20-45 minutes (or hangs for 6+ hours). run: . install_rms.sh + - name: Where is RMS? + run: julia -E "using ReactionMechanismSimulator; pathof(ReactionMechanismSimulator)" + + - name: Set some other env vars + run: | + echo "PYTHON_JULIAPKG_EXE=$(which julia)" >> $GITHUB_ENV + echo "PYTHON_JULIAPKG_PROJECT=$HOME/.julia/packages" >> $GITHUB_ENV + - name: POST-JULIA ENVIRONMENT run: | printenv | sort From 8486fb7996c3a4ba044a856694abacc266a6ac13 Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Thu, 23 Jan 2025 11:27:20 -0500 Subject: [PATCH 51/51] incorrect rebase fixup --- .../reactionmechanismsimulator_reactors.py | 47 +++++-------------- 1 file changed, 11 insertions(+), 36 deletions(-) diff --git a/rmgpy/rmg/reactionmechanismsimulator_reactors.py b/rmgpy/rmg/reactionmechanismsimulator_reactors.py index 8436eab70f..77b0ffb8b0 100644 --- a/rmgpy/rmg/reactionmechanismsimulator_reactors.py +++ b/rmgpy/rmg/reactionmechanismsimulator_reactors.py @@ -32,32 +32,13 @@ """ import itertools import logging -import sys import numpy as np -import rmgpy.constants as constants - -NO_JULIA = True -try: - import juliacall - from juliacall import Main - Main.seval("using PythonCall") - Main.seval("using ReactionMechanismSimulator") - Main.seval("using ReactionMechanismSimulator.Sundials") - NO_JULIA = False -except Exception as e: - logging.warning(f"Julia import failed, RMS reactors not available.\nException: {str(e)}\nStacktrace:\n{e.__traceback__}") - -from rmgpy import constants -from rmgpy.data.kinetics.depository import DepositoryReaction -from rmgpy.data.kinetics.family import TemplateReaction from rmgpy.data.solvation import SolventData from rmgpy.kinetics.arrhenius import ( Arrhenius, - ArrheniusBM, ArrheniusChargeTransfer, - ArrheniusEP, Marcus, MultiArrhenius, MultiPDepArrhenius, @@ -65,7 +46,6 @@ ) from rmgpy.kinetics.chebyshev import Chebyshev from rmgpy.kinetics.falloff import Lindemann, ThirdBody, Troe -from rmgpy.kinetics.kineticsdata import KineticsData from rmgpy.kinetics.surface import StickingCoefficient, SurfaceChargeTransfer from rmgpy.molecule.fragment import Fragment from rmgpy.reaction import Reaction @@ -77,7 +57,17 @@ from rmgpy.species import Species from rmgpy.thermo.nasa import NASA, NASAPolynomial from rmgpy.thermo.thermodata import ThermoData -from rmgpy.thermo.wilhoit import Wilhoit + + +NO_JULIA = True +try: + from juliacall import Main + Main.seval("using PythonCall") + Main.seval("using ReactionMechanismSimulator") + Main.seval("using ReactionMechanismSimulator.Sundials") + NO_JULIA = False +except Exception as e: + logging.warning(f"Julia import failed, RMS reactors not available.\nException: {str(e)}\nStacktrace:\n{e.__traceback__}") def to_julia(obj): @@ -104,21 +94,6 @@ def to_julia(obj): else: # Other native Python project does not need special conversion. return obj -NO_JULIA = False -try: - if __debug__: - from os.path import abspath, dirname, exists, join - - from julia.api import Julia - path_rms = dirname(dirname(dirname(abspath(__file__)))) - jl = Julia(sysimage=join(path_rms, "rms.so")) if exists(join(path_rms, "rms.so")) else Julia(compiled_modules=False) - from diffeqpy import de - from julia import Main - from pyrms import rms -except Exception as e: - logging.info("Unable to import Julia dependencies, original error: " + str(e) + ". RMS features will not be available on this execution.") - NO_JULIA = True - class PhaseSystem: """