diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 0ad3b615a9..4366394177 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -94,7 +94,6 @@ jobs: run: | python -c "import julia; julia.install(); import diffeqpy; diffeqpy.install()" || true julia -e 'using Pkg; Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="main")); using ReactionMechanismSimulator' || true - ln -sfn $(which python-jl) $(which python) # non-regression testing - name: Unit tests diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 98ec98eedd..45cebad46d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -36,7 +36,6 @@ jobs: julia -e "using Pkg; Pkg.add(PackageSpec(url=\"https://github.com/ReactionMechanismGenerator/ReactionMechanismSimulator.jl\", rev=\"main\"))" julia -e "using Pkg; Pkg.add(\"PyCall\"); Pkg.add(\"DifferentialEquations\")" python -c "import julia; julia.install()" - ln -sfn $(which python-jl) $(which python) - name: Install and compile RMG run: | cd .. diff --git a/Dockerfile b/Dockerfile index 4d0482b525..619bc30de7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -56,7 +56,6 @@ RUN make # Install and link Julia dependencies for RMS RUN python -c "import julia; julia.install(); import diffeqpy; diffeqpy.install()" || true RUN julia -e 'using Pkg; Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="main")); using ReactionMechanismSimulator' || true -RUN ln -sfn $(which python-jl) $(which python) # RMG-Py should now be installed and ready RUN python-jl rmg.py --help diff --git a/documentation/source/users/rmg/installation/anacondaDeveloper.rst b/documentation/source/users/rmg/installation/anacondaDeveloper.rst index 2b3edb6f0a..d0f211dbe3 100644 --- a/documentation/source/users/rmg/installation/anacondaDeveloper.rst +++ b/documentation/source/users/rmg/installation/anacondaDeveloper.rst @@ -141,6 +141,77 @@ Installation by Source Using Anaconda Environment for Unix-based Systems: Linux You may now use RMG-Py, Arkane, as well as any of the :ref:`Standalone Modules ` included in the RMG-Py package. +Debugging +========= + +If you wish to debug using the (very helpful) debugger in `VSCode `_, +here is an example launch configuration to put in your launch.json file, +which can be found in the .vscode folder. +You might have to edit them slightly to match your exact paths. Specifically, +you will need ``/opt/miniconda3/envs/rmg_env`` to point to where your conda environment is located. + +This configuration will allow you to debug the rms_constant_V example, running through +python-jl. :: + + { + "name": "Python: rmg.py rms_constant_V", + "type": "python", + "request": "launch", + "cwd": "${workspaceFolder}/", + "program": "rmg.py", + "python": "/opt/miniconda3/envs/rmg_env/bin/python-jl", + "args": [ + "examples/rmg/rms_constant_V/input.py", + ], + "console": "integratedTerminal", + "env": { + "PATH": "/opt/miniconda3/envs/rmg_env/bin:${env:PATH}", + "PYTHONPATH": "${workspaceFolder}/", + } + }, + +This configuration will allow you to debug a subset of the unit tests. +Open one of the many test files named `*Test.py` before you launch it:: + + { + "name": "Python: nosetest Current File", + "type": "python", + "request": "launch", + "program": "/opt/miniconda3/envs/rmg_env/bin/nosetests", + "args": [ + "--nologcapture", + "--nocapture", + "--verbose", + "${file}" + ], + "console": "integratedTerminal", + "env": { + "PATH": "/opt/miniconda3/envs/rmg_env/bin:${env:PATH}", + "PYTHONPATH": "${workspaceFolder}/", + }, + }, + +This configuration will allow you to debug running all the database tests.:: + + { + "name": "Test RMG-database", + "type": "python", + "request": "launch", + "program": "/opt/miniconda3/envs/rmg_env/bin/nosetests", + "args": [ + "--nologcapture", + "--nocapture", + "--verbose", + "--detailed-errors", + "${workspaceFolder}/testing/databaseTest.py" + ], + "console": "integratedTerminal", + "env": { + "PATH": "/opt/miniconda3/envs/rmg_env/bin:${env:PATH}", + "PYTHONPATH": "${workspaceFolder}/", + }, + }, + Test Suite ========== @@ -188,3 +259,15 @@ A number of basic examples can be run immediately. Additional example input fil cd RMG-Py make eg4 + + +Building Documentation +====================== +To build the documentation (to test that you have it right before pushing to GitHub) you will need to install sphinx:: + + conda activate rmg_env + conda install sphinx + +Then you can build the documentation:: + + make documentation diff --git a/documentation/source/users/rmg/running.rst b/documentation/source/users/rmg/running.rst index aa28563a89..0bb21b80a6 100755 --- a/documentation/source/users/rmg/running.rst +++ b/documentation/source/users/rmg/running.rst @@ -10,7 +10,7 @@ Running a basic RMG job is straightforward, as shown in the example below. Howev Basic run:: - python rmg.py input.py + python-jl rmg.py input.py .. _inputflags: @@ -19,7 +19,7 @@ Input flags The options for input flags can be found in ``/RMG-Py/rmgpy/util.py``. Running :: - python rmg.py -h + python-jl rmg.py -h at the command line will print the documentation from ``util.py``, which is reproduced below for convenience:: @@ -63,23 +63,23 @@ Some representative example usages are shown below. Run by restarting from a seed mechanism:: - python rmg.py -r path/to/seed/ input.py + python-jl rmg.py -r path/to/seed/ input.py Run with CPU time profiling:: - python rmg.py -p input.py + python-jl rmg.py -p input.py Run with multiprocessing for reaction generation and QMTP:: - python rmg.py -n input.py + python-jl rmg.py -n input.py Run with setting a limit on the maximum execution time:: - python rmg.py -t input.py + python-jl rmg.py -t input.py Run with setting a limit on the maximum number of iterations:: - python rmg.py -i input.py + python-jl rmg.py -i input.py Details on the multiprocessing implementation diff --git a/environment.yml b/environment.yml index 13de5a5a8a..f0b8db780e 100644 --- a/environment.yml +++ b/environment.yml @@ -47,6 +47,7 @@ dependencies: # general-purpose external software tools - conda-forge::julia>=1.8.5 + - conda-forge::pyjulia >=0.6 # Python tools - python >=3.7 @@ -94,16 +95,6 @@ dependencies: # We should use the official channel, not sure how difficult this # change will be. - - rmg::pyjulia - # This is identical to the conda-forge package, except that we run - # a hard to decipher sed command during the build process: - # https://github.com/ReactionMechanismGenerator/conda-recipes/blob/rmg-deps/pyjulia/build.sh#LL15C69-L15C69 - # - # We should either remove the need to use this command or add this - # to the installation steps - # - # Both pyrms and diffeqpy depend on this package. - # conda mutex metapackage - nomkl diff --git a/utilities.py b/utilities.py index 1a014e9d7a..c8e7425818 100644 --- a/utilities.py +++ b/utilities.py @@ -310,7 +310,7 @@ def update_headers(): start of each file, be sure to double-check the results to make sure important lines aren't accidentally overwritten. """ - shebang = """#!/usr/bin/env python3 + shebang = """#!/usr/bin/env python-jl """