Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
7b59511
Instruct Docker, Github Actions, and users to use 'for_rmg' branch of…
rwest Aug 9, 2023
e45239f
remove deprecated rule from makefile phony list
JacksonBurns Jul 22, 2023
c35fd63
move testing files to test dir
JacksonBurns Jul 22, 2023
b3f2a93
MOVE arkane tests, move database test
JacksonBurns Jul 22, 2023
a6fc1fa
move and rename files not following the naming convention
JacksonBurns Jul 22, 2023
6db3924
fix conflicting test file names
JacksonBurns Jul 22, 2023
b78090a
black formatting for all test files
JacksonBurns Jul 22, 2023
e1615b9
delete unnecessary name main statements
JacksonBurns Jul 22, 2023
93b5833
manually switch testdatabase to assert from yield generator
JacksonBurns Jul 22, 2023
b47d08c
yet more name conflicts and pytest warnings
JacksonBurns Jul 22, 2023
cbd0f48
remove nosetest asserts with nose2pytest
JacksonBurns Jul 22, 2023
9d40dbc
remove external software folder - no longer relevant bc of conda
JacksonBurns Jul 22, 2023
a402715
use bare assert statements (pytest style)
JacksonBurns Jul 22, 2023
06f9f5a
delete unmaintained requirements file
JacksonBurns Jul 22, 2023
fb1e742
update makefile, run all tests at once to avoid double aggregation time
JacksonBurns Jul 22, 2023
e61e0d5
multiple co-dependent changes, see extended description
JacksonBurns Jul 22, 2023
c518ecd
tests running, but not passing. Ran Black
JacksonBurns Jul 22, 2023
8c2c9b3
fix skippable tests
JacksonBurns Jul 22, 2023
304bad3
update the default filepath for `test_data` to its new location
JacksonBurns Jul 22, 2023
e01e68f
rename setup_class and teardown_class
JacksonBurns Jul 22, 2023
0ea86f1
run tests in parallel, remove unnecessary run files
JacksonBurns Jul 22, 2023
56ffc93
yet more setUp -> setup_class etc.
JacksonBurns Jul 22, 2023
1478709
parallel test execution does not work with Julia and pytest
JacksonBurns Jul 22, 2023
9e42d6b
fix use of np.float and np.bool
JacksonBurns Jul 22, 2023
e07f22d
consolidate test_data directories
JacksonBurns Jul 22, 2023
cf91b37
Fix np.int warning, by converting np.int into int
JacksonBurns Jul 22, 2023
2572771
Tiny fix to some setup_class and setup_method methods.
JacksonBurns Jul 22, 2023
76a4bf1
Fix how file paths are detected in some tests.
JacksonBurns Jul 22, 2023
6c9cff9
Fix gaussian executable detection in gaussianTest
JacksonBurns Jul 22, 2023
b554140
Use test-all target in Makefile during CI testing (and include database)
JacksonBurns Jul 22, 2023
779c99d
Fix file path detection in some tests.
JacksonBurns Jul 22, 2023
deba29f
Fix a couple more unit tests, and setup_class to setup_method
JacksonBurns Jul 22, 2023
b0be3b6
Removed spurious '\' from some test database comments.
JacksonBurns Jul 22, 2023
9f293be
more hacks for pytest compat, remove deprecated methods
JacksonBurns Jul 23, 2023
9dd258e
all tests running, fix numpy types compilation issue
JacksonBurns Jul 23, 2023
9eca933
Import HinderedRotor2D etc. from torsions. all tests running, fix nu…
JacksonBurns Jul 23, 2023
a648d8a
remove unittest self.fail syntax, fix more tests, remove more dep meths
JacksonBurns Jul 23, 2023
bb1bd51
multiple, see ext
JacksonBurns Jul 23, 2023
7addd84
fix pytest-check install issue
JacksonBurns Jul 23, 2023
26401d7
fix failed julia import warning
JacksonBurns Jul 23, 2023
e767885
Some changes that look like undoing previous changes.
JacksonBurns Jul 23, 2023
4dd0714
increased test verbosity for debuggin
JacksonBurns Jul 24, 2023
628bec4
remove deprecated methods from docs
JacksonBurns Jul 24, 2023
ae8db3a
remove gas phase warning - so much output it crashes runner
JacksonBurns Jul 24, 2023
3b19080
fix gitignore for example dir - explicitly include some examples/arka…
JacksonBurns Jul 24, 2023
da53d02
resolve #2489
JacksonBurns Jul 24, 2023
5b0cc3f
Configure pytest to use coverage (and other pytest config)
JacksonBurns Jul 24, 2023
038ecae
more test patches, arkane test was basically killing itself after run
JacksonBurns Jul 24, 2023
4cd9a85
more patches for failing arkane tests, fix coverage
JacksonBurns Jul 24, 2023
8ba3633
yet more deprecated documentation
JacksonBurns Jul 24, 2023
3930f34
yet more and more test patches - changed coverage settings
JacksonBurns Jul 24, 2023
848e4a1
final patches for fixing codecov, some np.float warnings
JacksonBurns Jul 24, 2023
ca9e6bd
update outdated rule in makefile
JacksonBurns Jul 24, 2023
82dcea9
combine tests which were reliant on shared global state
JacksonBurns Jul 24, 2023
a3eebc5
update makefile rule (don't run coverage) and .gitignore
JacksonBurns Jul 24, 2023
413aee9
fix implicit global state dependence in failing tests
JacksonBurns Jul 24, 2023
80bf0f6
skip the most dysfunctional tests
JacksonBurns Jul 25, 2023
2669cff
remove windows batch files we can't use anymore
JacksonBurns Jul 25, 2023
42f496d
Remove windows .bat files from examples folders
rwest Jul 28, 2023
9646eaf
skip the failing Toluene_Hindered_Rotor_SemiClassicalND example in ar…
JacksonBurns Jul 25, 2023
3a52829
initial review comments - see ext
JacksonBurns Jul 26, 2023
79dab1e
Q2DTor - see ext.
JacksonBurns Jul 25, 2023
332e36d
Convert some float to np.float64 in arkane/statmech.py
JacksonBurns Jul 25, 2023
84eb7c8
Convert setup_class to setup_method in arrheniusTest
rwest Jul 28, 2023
7335712
Disable a few lines in examples/arkane/species/thermo_demo
rwest Jul 28, 2023
f45b968
pytest requires skip reason to be a kwarg
JacksonBurns Jul 27, 2023
0c05f55
fix incorrect use of self in hinderedrotor2d test
JacksonBurns Jul 27, 2023
1fe0c7b
another useful option for running tests in `pytest.ini`
JacksonBurns Jul 27, 2023
09cbc87
Fix calcPath to calc_path in arkane and toluene example.
rwest Jul 28, 2023
16a0ab1
Black formatting and fixing line endings in an example.
rwest Jul 28, 2023
3c9abff
update makefile rule for unit tests
JacksonBurns Aug 1, 2023
73979b5
Adding another example output file to the .gitignore
rwest Aug 1, 2023
d4ceb8f
fix bad nosetest rounding conversion
JacksonBurns Aug 1, 2023
8b23001
Rename Toulene examples folders to Toluene.
rwest Aug 2, 2023
a59b598
Fix TestHinderedRotor2D tests
rwest Aug 2, 2023
8c8d70d
Install Q2DTor in unit test workflow
rwest Aug 2, 2023
594186d
Remove the hack that lets julia step fail in the CI workflow
rwest Aug 2, 2023
a394d0d
Fix a typo in a comment.
rwest Aug 3, 2023
f50f79a
Convert .format() into f-string
rwest Aug 3, 2023
ef802d8
Fixing Q2DTor paths.
rwest Aug 3, 2023
0995ae0
Convert a few stragling np.float64 into float
rwest Aug 3, 2023
b33c6fa
Replace deprecated np.float alias with float.
rwest Aug 3, 2023
2fa16f7
Arkane tests skips examples that aren't actual inputs.
rwest Aug 4, 2023
852ade4
Updating VSCode debug config test instructions for developers.
rwest Aug 8, 2023
57f836c
Updated developer documentation about debugging tests.
rwest Aug 9, 2023
d1dfb87
Added developer documentation about testing in VSCode.
rwest Aug 9, 2023
978dba2
A comment in the pytest.ini about running tests in parallel.
rwest Aug 9, 2023
0982b96
Added a test result to .gitignore
rwest Aug 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 0 additions & 7 deletions .conda/bld.bat

This file was deleted.

35 changes: 0 additions & 35 deletions .coveragerc

This file was deleted.

17 changes: 8 additions & 9 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,20 +149,19 @@ jobs:
make

# RMS installation and linking to Julia
# Allow these installs to 'fail' (as they do in RMG-Tests) with the command || True trick
- name: Install and link Julia dependencies
timeout-minutes: 120 # this usually takes 20-45 minutes (or hangs for 6+ hours).
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
python -c "import julia; julia.install(); import diffeqpy; diffeqpy.install()"
julia -e 'using Pkg; Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="for_rmg")); using ReactionMechanismSimulator'

- name: Install Q2DTor
run: echo "" | make q2dtor

# non-regression testing
- name: Unit tests
run: make test-unittests
- name: Functional tests
run: make test-functional
- name: Database tests
run: make test-database
- name: Run Unit, Functional, and Database Tests
# aggregate into one command so we only have to eat the collection time once
run: make test-all

# Regression Testing - Test Execution
- name: Regression Tests - Execution
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ jobs:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- name: Patch the environment file
run: |
echo -e "\n - libstdcxx-ng < 13\n" >> environment.yml
cat environment.yml
- name: Setup Mambaforge Python 3.7
uses: conda-incubator/setup-miniconda@v2
with:
Expand Down
31 changes: 26 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ documentation/build/*
# (These will be unique to each developer's setup)
make.inc

# Example output files
examples/*
!examples/*/input.py
!examples/**/*.ipynb
# output files
rmgpy/output/*

# NetBeans project files
nbproject/*
Expand Down Expand Up @@ -88,11 +86,34 @@ RMG_Py.egg-info/*
# RMG configuration file
rmgpy/rmgrc

# treegen log files
scripts/treegen.log

scripts/treegen_backup.log

# regression testing files - ignore everything but input and regression input
test/regression/*
!test/regression/*/input.py
!test/regression/*/regression_input.py

# testing files
test/arkane/data/two_parameter_arrhenius_fit/arkane.log
test/arkane/data/two_parameter_arrhenius_fit/output.py
test/arkane/data/two_parameter_arrhenius_fit/chem.inp
test/rmgpy/test_data/temp_dir_for_testing/cantera/chem001.yaml
rmgpy/test_data/copied_kinetic_lib/
testing/qm/*
test_log.txt

# example directory - save the inputs but not the outputs
# cantera input files
examples/**/chem.inp
# log files from the runs
examples/**/arkane.log
# results from the runs
examples/**/species_dictionary.txt
examples/**/output*py
examples/**/network*py
examples/**/dictionary.txt
examples/**/reactions.py
examples/**/RMG_libraries
examples/**/species
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ ENV PATH="$RUNNER_CWD/RMG-Py:$PATH"
# 1. Build RMG
# 2. Install and link Julia dependencies for RMS
RUN make && \
julia -e 'using Pkg; Pkg.add(PackageSpec(name="PyCall",rev="master")); Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="main")); using ReactionMechanismSimulator' && \
julia -e 'using Pkg; Pkg.add(PackageSpec(name="PyCall",rev="master")); Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="for_rmg")); using ReactionMechanismSimulator' && \
python -c "import julia; julia.install(); import diffeqpy; diffeqpy.install()"

# RMG-Py should now be installed and ready - trigger precompilation and test run
Expand Down
28 changes: 13 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
################################################################################

.PHONY : all minimal main solver check pycheck arkane clean install decython documentation mopac_travis test
.PHONY : all minimal main solver check pycheck arkane clean install decython documentation test q2dtor

all: pycheck main solver check

Expand Down Expand Up @@ -50,24 +50,25 @@ q2dtor:
and HinderedRotor2D within Arkane please cite: \n\nD. Ferro-Costas, M. N. D. S.Cordeiro, D. G. Truhlar, A.\
Fernández-Ramos, Comput. Phys. Commun. 232, 190-205, 2018.\n"
@ read -p "Press ENTER to continue" dummy
@ git clone https://github.com/mjohnson541/Q2DTor.git external/Q2DTor --branch arkanepy3

@ mkdir -p external
@ git clone https://github.com/cathedralpkg/Q2DTor external/Q2DTor

decython:
# de-cythonize all but the 'minimal'. Helpful for debugging in "pure python" mode.
find . -name *.so ! \( -name _statmech.so -o -name quantity.so -o -regex '.*rmgpy/solver/.*' \) -exec rm -f '{}' \;
find . -name *.pyc -exec rm -f '{}' \;

test-all:
nosetests --nocapture --nologcapture --all-modules --verbose --with-coverage --cover-inclusive --cover-erase --cover-html --cover-html-dir=testing/coverage --exe rmgpy arkane
python-jl -m pytest

test test-unittests:
nosetests --nocapture --nologcapture --all-modules -A 'not functional' --verbose --with-coverage --cover-inclusive --cover-erase --cover-html --cover-html-dir=testing/coverage --exe rmgpy arkane
python-jl -m pytest -m "not functional and not database"

test-functional:
nosetests --nologcapture --all-modules -A 'functional' --verbose --exe rmgpy arkane
python-jl -m pytest -m "functional"

test-database:
nosetests --nocapture --nologcapture --verbose --detailed-errors testing/databaseTest.py
python-jl -m pytest -m "database"

eg0: all
mkdir -p testing/eg0
Expand All @@ -85,25 +86,22 @@ eg1: all
coverage run rmg.py -p testing/eg1/input.py
coverage report
coverage html

eg2: all
mkdir -p testing/eg2
rm -rf testing/eg2/*
cp examples/rmg/1,3-hexadiene/input.py testing/eg2/input.py
coverage erase
@ echo "Running eg2: 1,3-hexadiene example with coverage tracking AND profiling"
coverage run rmg.py -p testing/eg2/input.py
coverage report
coverage html
@ echo "Running eg2: 1,3-hexadiene example with profiling"
python rmg.py -p testing/eg2/input.py

eg3: all
mkdir -p testing/eg3
rm -rf testing/eg3/*
cp examples/rmg/liquid_phase/input.py testing/eg3/input.py
coverage erase
@ echo "Running eg3: liquid_phase example with coverage tracking AND profiling"
coverage run rmg.py -p testing/eg3/input.py
coverage report
coverage html
@ echo "Running eg3: liquid_phase example with profiling"
python rmg.py -p testing/eg3/input.py

eg5: all
mkdir -p testing/eg5
Expand Down
6 changes: 3 additions & 3 deletions arkane/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def check_conformer_energy(energies, path):
is not 0.5 kcal/mol (or more) higher than any other energies in the scan. If so, print and
log a warning message.
"""
energies = np.array(energies, np.float64)
energies = np.array(energies, float)
e_diff = (energies[0] - np.min(energies)) * constants.E_h * constants.Na / 1000
if e_diff >= 2: # we choose 2 kJ/mol to be the critical energy
logging.warning(f'The species corresponding to {os.path.basename(path)} is different in energy from the '
Expand Down Expand Up @@ -628,7 +628,7 @@ def get_center_of_mass(coords, numbers=None, symbols=None):
raise IndexError('Either symbols or numbers must be given.')
if numbers is not None:
symbols = [symbol_by_number[number] for number in numbers]
center, total_mass = np.zeros(3, np.float64), 0
center, total_mass = np.zeros(3, float), 0
for coord, symbol in zip(coords, symbols):
mass = get_element_mass(symbol)[0]
center += mass * coord
Expand Down Expand Up @@ -661,7 +661,7 @@ def get_moment_of_inertia_tensor(coords, numbers=None, symbols=None):
if len(coords) != len(symbols):
raise InputError(f'The number of atoms ({len(symbols)}) is not equal to the number of '
f'atomic coordinates ({len(list(coords))})')
tensor = np.zeros((3, 3), np.float64)
tensor = np.zeros((3, 3), float)
center_of_mass = get_center_of_mass(coords=coords, numbers=numbers, symbols=symbols)
for symbol, coord in zip(symbols, coords):
mass = get_element_mass(symbol)[0]
Expand Down
Loading