ReactionMechanismGenerator / RMG-Py

Python version of the amazing Reaction Mechanism Generator (RMG).
http://reactionmechanismgenerator.github.io/RMG-Py/
Other
397 stars 228 forks source link

[Python 3.9] Improve isodesmic and add element balance constraints #2695

Closed JacksonBurns closed 3 months ago

JacksonBurns commented 3 months ago

This PR replaces #2596 as described in this comment: https://github.com/ReactionMechanismGenerator/RMG-Py/pull/2687#issuecomment-2248642608

hwpang commented 3 months ago

It seems that the tests for ubuntu have proceeded pretty far and mostly need some syntax updates?

JacksonBurns commented 3 months ago

@hwpang yes, this PR is almost working. There are test failures caused by the changes here, test failures from the resonance changes, and test failures from the original python 3.9 upgrade. I am going to try and find all the failures that are strictly this branch and fix them, merge this PR into the resonance branch, and then start tackling those (will probably need your help on that part!).

JacksonBurns commented 3 months ago

@hwpang I am trying to build locally so I can debug faster - which of these env variables are actually required?

          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
JacksonBurns commented 3 months ago

The current test failures status:

=========================== short test summary info ============================
FAILED test/arkane/arkaneMainTest.py::TestArkaneExamples::test_arkane_examples - AttributeError: module 'numpy' has no attribute 'warnings'
FAILED test/arkane/arkaneOutputTest.py::OutputTest::test_prettify - AttributeError: module 'numpy' has no attribute 'warnings'
FAILED test/arkane/commonTest.py::TestArkaneSpecies::test_dump_yaml - AttributeError: module 'numpy' has no attribute 'warnings'
FAILED test/arkane/commonTest.py::TestArkaneSpecies::test_create_and_load_yaml - AttributeError: module 'numpy' has no attribute 'warnings'
FAILED test/arkane/statmechTest.py::TestStatmech::test_specifying_absolute_file_paths - AttributeError: module 'numpy' has no attribute 'warnings'
FAILED test/arkane/statmechTest.py::TestStatmech::test_hinder_rotor_from_1d_array - AttributeError: module 'numpy' has no attribute 'warnings'
FAILED test/arkane/statmechTest.py::TestStatmech::test_hindered_rotor_from_scan_logs - AttributeError: module 'numpy' has no attribute 'warnings'
FAILED test/arkane/encorr/isodesmicTest.py::TestSpeciesConstraints::test_calculating_constraints - TypeError: not all arguments converted during string formatting
FAILED test/arkane/encorr/isodesmicTest.py::TestErrorCancelingScheme::test_find_error_canceling_reaction - TypeError: 'int' object is not iterable
FAILED test/arkane/encorr/isodesmicTest.py::TestErrorCancelingScheme::test_multiple_error_canceling_reactions - TypeError: 'int' object is not iterable
FAILED test/arkane/encorr/isodesmicTest.py::TestErrorCancelingScheme::test_calculate_target_enthalpy - TypeError: 'int' object is not iterable
FAILED test/rmgpy/reactionTest.py::TestReactionToCantera::test_pdep_arrhenius - AttributeError: 'cantera.reaction.Reaction' object has no attribute 'rates'
FAILED test/rmgpy/reactionTest.py::TestReactionToCantera::test_multi_pdep_arrhenius - AttributeError: 'cantera.reaction.Reaction' object has no attribute 'rates'
FAILED test/rmgpy/reactionTest.py::TestReactionToCantera::test_falloff - TypeError: __cinit__() got an unexpected keyword argument 'tbody'
FAILED test/rmgpy/speciesTest.py::TestSpecies::test_cantera - AttributeError: type object 'cantera.thermo.Species' has no attribute 'fromCti'
FAILED test/rmgpy/transportDataTest.py::TestTransportData::test_to_cantera - AttributeError: type object 'cantera.thermo.Species' has no attribute 'fromCti'
FAILED test/rmgpy/data/solvationTest.py::TestSoluteDatabase::test_saturation_density - AssertionError: assert 1.93 == 0
 +  where 1.93 = round(1.9298279226322848, 2)
 +    where 1.9298279226322848 = abs((6385.1498279226325 - 6383.22))
 +      where 6385.1498279226325 = get_liquid_saturation_density('Hexane', 400)
FAILED test/rmgpy/data/thermoTest.py::TestThermoDatabase::test_thermo_for_aromatic_radicals - ValueError: need more than 0 values to unpack
FAILED test/rmgpy/data/thermoTest.py::TestCyclicThermo::test_add_poly_ring_correction_thermo_data_from_heuristic_using_pyrene - AssertionError: assert 'Benzene' in []
FAILED test/rmgpy/data/thermoTest.py::TestMolecularManipulationInvolvedInThermoEstimation::test_bicyclic_decomposition_for_polyring_using_pyrene - assert [0, 0, 0, 0, 0] == [0, 6, 6, 6, 6]
  At index 1 diff: 0 != 6
  Full diff:
  - [0, 6, 6, 6, 6]
  + [0, 0, 0, 0, 0]
FAILED test/rmgpy/data/kinetics/familyTest.py::TestTreeGeneration::test_f_rules - ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (7, 6) + inhomogeneous part.
FAILED test/rmgpy/data/kinetics/familyTest.py::TestTreeGeneration::test_d_regularization_dims - Exception: Unable to calculate free energy for species 'C6H6-5': no thermo or statmech data available.
FAILED test/rmgpy/molecule/moleculeTest.py::TestMolecule::test_count_aromatic_rings - assert [2, 0] == [2, 1, 0]
  At index 1 diff: 0 != 1
  Right contains one more item: 0
  Full diff:
  - [2, 1, 0]
  ?     ---
  + [2, 0]
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_naphthyl - assert 2 == 4
 +  where 2 = len([Molecule(smiles="[c]1cccc2ccccc12"), Molecule(smiles="[C]1=C2C=CC=CC2=CC=C1")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_methyl_napthalene - assert 2 == 4
 +  where 2 = len([Molecule(smiles="Cc1cccc2ccccc12"), Molecule(smiles="CC1=CC=CC2=CC=CC=C12")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_methyl_phenanthrene - assert 2 == 3
 +  where 2 = len([Molecule(smiles="Cc1cccc2c1ccc1ccccc12"), Molecule(smiles="CC1=CC=CC2=C1C=CC1=CC=CC=C12")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_methyl_phenanthrene_radical - assert 2 == 9
 +  where 2 = len([Molecule(smiles="[CH2]c1cccc2c1ccc1ccccc12"), Molecule(smiles="[CH2]C1=CC=CC2=C1C=CC1=CC=CC=C12")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_c13h11_rad - assert 2 == 6
 +  where 2 = len([Molecule(smiles="Cc1ccc([CH]c2ccccc2)cc1"), Molecule(smiles="CC1=CC=C([CH]C2=CC=CC=C2)C=C1")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_aryne_3_rings - assert 4 == 5
 +  where 4 = len([Molecule(smiles="C1#Cc2c(ccc3ccccc23)C=C1"), Molecule(smiles="C1=C=C2C(=CC=1)C=Cc1ccccc12"), Molecule(smiles="C1#CC2=C(C=C1)C=Cc1ccccc12"), Molecule(smiles="C1#CC2=C(C=C1)C=CC1=C2C=CC=C1")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_polycyclic_aromatic_with_non_aromatic_ring2 - assert 2 == 4
 +  where 2 = len([Molecule(smiles="C=C1C=Cc2cc3c(ccc4cc5ccccc5cc43)cc2C1=C"), Molecule(smiles="C=C1C=CC2=CC3=C(C=CC4=CC5=CC=CC=C5C=C43)C=C2C1=C")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_false_negative_polycyclic_aromaticity_perception - ValueError: need more than 0 values to unpack
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_false_negative_polycylic_aromaticity_perception2 - ValueError: need more than 0 values to unpack
FAILED test/rmgpy/molecule/resonanceTest.py::ClarTest::test_clar_optimization - ValueError: not enough values to unpack (expected 4, got 2)
FAILED test/rmgpy/molecule/resonanceTest.py::ClarTest::test_phenanthrene - assert 0 == 1
 +  where 0 = len([])
FAILED test/rmgpy/molecule/resonanceTest.py::ClarTest::test_phenalene - assert 0 == 2
 +  where 0 = len([])
FAILED test/rmgpy/molecule/resonanceTest.py::ClarTest::test_corannulene - assert 0 == 5
 +  where 0 = len([])
FAILED test/rmgpy/qm/mopacTest.py::TestMopacMolPM3::test_generate_thermo_data - IndexError: list index out of range
FAILED test/rmgpy/qm/mopacTest.py::TestMopacMolPM3::test_load_thermo_data - IndexError: list index out of range
FAILED test/rmgpy/qm/mopacTest.py::TestMopacMolPM6::test_generate_thermo_data - IndexError: list index out of range
FAILED test/rmgpy/qm/mopacTest.py::TestMopacMolPM6::test_load_thermo_data - IndexError: list index out of range
FAILED test/rmgpy/qm/mopacTest.py::TestMopacMolPM7::test_generate_thermo_data - IndexError: list index out of range
FAILED test/rmgpy/qm/mopacTest.py::TestMopacMolPM7::test_load_thermo_data - IndexError: list index out of range
FAILED test/rmgpy/qm/qmMainTest.py::TestQMCalculator::test_get_thermo_data_mopac - IndexError: list index out of range
FAILED test/rmgpy/qm/qmMainTest.py::TestQMCalculator::test_run_jobs - IndexError: list index out of range
FAILED test/rmgpy/rmg/mainTest.py::TestRestartWithFilters::test_restart_with_filters - AttributeError: 'list' object has no attribute 'getattr'
FAILED test/rmgpy/rmg/mainTest.py::TestRestartNoFilters::test_restart_no_filters - AttributeError: 'list' object has no attribute 'getattr'
FAILED test/rmgpy/rmg/modelTest.py::TestCoreEdgeReactionModel::test_thermo_filter_species - AttributeError: 'list' object has no attribute 'getattr'
FAILED test/rmgpy/rmg/modelTest.py::TestCoreEdgeReactionModel::test_thermo_filter_down - AttributeError: 'list' object has no attribute 'getattr'
FAILED test/rmgpy/rmg/modelTest.py::TestCoreEdgeReactionModel::test_check_for_existing_reaction_eliminates_identical_reactions - AttributeError: 'list' object has no attribute 'getattr'
FAILED test/rmgpy/rmg/modelTest.py::TestCoreEdgeReactionModel::test_check_for_existing_reaction_keeps_identical_reactions_with_duplicate_flag - AttributeError: 'list' object has no attribute 'getattr'
FAILED test/rmgpy/rmg/modelTest.py::TestCoreEdgeReactionModel::test_check_for_existing_reaction_eliminates_identical_reactions_without_duplicate_flag - AttributeError: 'list' object has no attribute 'getattr'
FAILED test/rmgpy/rmg/modelTest.py::TestEnlarge::test_enlarge_3_react_edge - AttributeError: 'list' object has no attribute 'getattr'
FAILED test/rmgpy/statmech/ndTorsionsTest.py::TestHinderedRotorClassicalND::test_hindered_rotor_nd - assert 4e-05 == 0
 +  where 4e-05 = round((2.8993250143510836 - 2.899287634962152), 5)
 +    where 2.8993250143510836 = abs(2.8993250143510836)
 +      where 2.8993250143510836 = <bound method HinderedRotorClassicalND.calc_partition_function of Mode(quantum=False)>(300.0)
 +        where <bound method HinderedRotorClassicalND.calc_partition_function of Mode(quantum=False)> = Mode(quantum=False).calc_partition_function
FAILED test/rmgpy/tools/generatereactionsTest.py::GenerateReactionsTest::test - AttributeError: 'list' object has no attribute 'getattr'
FAILED test/rmgpy/tools/generatereactionsTest.py::GenerateReactionsTest::test_duplicate_reaction - AttributeError: 'list' object has no attribute 'getattr'
FAILED test/rmgpy/tools/generatereactionsTest.py::GenerateReactionsTest::test_library_reaction_enters_core - AttributeError: 'list' object has no attribute 'getattr'
ERROR test/database/databaseTest.py::TestDatabase::test_kinetics - ValueError: need more than 0 values to unpack
ERROR test/database/databaseTest.py::TestDatabase::test_thermo - ValueError: need more than 0 values to unpack
ERROR test/database/databaseTest.py::TestDatabase::test_solvation - ValueError: need more than 0 values to unpack
ERROR test/database/databaseTest.py::TestDatabase::test_statmech - ValueError: need more than 0 values to unpack
ERROR test/database/databaseTest.py::TestDatabase::test_transport - ValueError: need more than 0 values to unpack
ERROR test/database/databaseTest.py::TestDatabase::test_metal_libraries - ValueError: need more than 0 values to unpack
ERROR test/rmgpy/rmg/mainTest.py::TestMain::test_rmg_execute - AttributeError: 'list' object has no attribute 'getattr'
ERROR test/rmgpy/rmg/mainTest.py::TestMain::test_rmg_increases_reactions - AttributeError: 'list' object has no attribute 'getattr'
ERROR test/rmgpy/rmg/mainTest.py::TestMain::test_rmg_seed_mechanism_creation - AttributeError: 'list' object has no attribute 'getattr'
ERROR test/rmgpy/rmg/mainTest.py::TestMain::test_rmg_seed_edge_mechanism_creation - AttributeError: 'list' object has no attribute 'getattr'
ERROR test/rmgpy/rmg/mainTest.py::TestMain::test_rmg_seed_library_creation - AttributeError: 'list' object has no attribute 'getattr'
ERROR test/rmgpy/rmg/mainTest.py::TestMain::test_rmg_seed_edge_library_creation - AttributeError: 'list' object has no attribute 'getattr'
ERROR test/rmgpy/rmg/mainTest.py::TestMain::test_rmg_seed_works - AttributeError: 'list' object has no attribute 'getattr'
ERROR test/rmgpy/rmg/mainTest.py::TestMain::test_rmg_memory - AttributeError: 'list' object has no attribute 'getattr'
ERROR test/rmgpy/rmg/mainTest.py::TestMain::test_make_cantera_input_file - AttributeError: 'list' object has no attribute 'getattr'
ERROR test/rmgpy/rmg/mainTest.py::TestMainFunctions::test_save_seed_modulus - FileExistsError: [Errno 17] File exists: '/home/runner/work/RMG-Py/RMG-Py/rmgpy/../test/rmgpy/test_data/mainTest/output'
ERROR test/rmgpy/rmg/mainTest.py::TestMainFunctions::test_max_iter - FileExistsError: [Errno 17] File exists: '/home/runner/work/RMG-Py/RMG-Py/rmgpy/../test/rmgpy/test_data/mainTest/output'
ERROR test/rmgpy/tools/canteramodelTest.py::RMGToCanteraTest::test_species_conversion - TypeError: __cinit__() got an unexpected keyword argument 'tbody'
ERROR test/rmgpy/tools/canteramodelTest.py::RMGToCanteraTest::test_reaction_conversion - TypeError: __cinit__() got an unexpected keyword argument 'tbody'
= 56 failed, 1826 passed, 36 skipped, 2080058 warnings, 19 errors in 1204.42s (0:20:04) =
make: *** [Makefile:65: test-all] Error 1
JacksonBurns commented 3 months ago

This batch of commits should resolve a great number of these, hopefully

JacksonBurns commented 3 months ago

Down to 25 failures:

=========================== short test summary info ============================
FAILED test/arkane/arkaneMainTest.py::TestArkaneExamples::test_arkane_examples - TypeError: concatenate() got an unexpected keyword argument 'lb'
FAILED test/arkane/encorr/isodesmicTest.py::TestSpeciesConstraints::test_calculating_constraints - TypeError: not all arguments converted during string formatting
FAILED test/arkane/encorr/isodesmicTest.py::TestErrorCancelingScheme::test_find_error_canceling_reaction - TypeError: concatenate() got an unexpected keyword argument 'lb'
FAILED test/arkane/encorr/isodesmicTest.py::TestErrorCancelingScheme::test_multiple_error_canceling_reactions - TypeError: concatenate() got an unexpected keyword argument 'lb'
FAILED test/arkane/encorr/isodesmicTest.py::TestErrorCancelingScheme::test_calculate_target_enthalpy - TypeError: concatenate() got an unexpected keyword argument 'lb'
FAILED test/rmgpy/data/solvationTest.py::TestSoluteDatabase::test_saturation_density - AssertionError: assert 1.93 == 0
 +  where 1.93 = round(1.9298279226322848, 2)
 +    where 1.9298279226322848 = abs((6385.1498279226325 - 6383.22))
 +      where 6385.1498279226325 = get_liquid_saturation_density('Hexane', 400)
FAILED test/rmgpy/data/thermoTest.py::TestCyclicThermo::test_add_poly_ring_correction_thermo_data_from_heuristic_using_pyrene - AssertionError: assert 'Benzene' in []
FAILED test/rmgpy/data/thermoTest.py::TestMolecularManipulationInvolvedInThermoEstimation::test_bicyclic_decomposition_for_polyring_using_pyrene - assert [0, 0, 0, 0, 0] == [0, 6, 6, 6, 6]
  At index 1 diff: 0 != 6
  Full diff:
  - [0, 6, 6, 6, 6]
  + [0, 0, 0, 0, 0]
FAILED test/rmgpy/data/kinetics/familyTest.py::TestTreeGeneration::test_f_rules - ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (7, 6) + inhomogeneous part.
FAILED test/rmgpy/data/kinetics/familyTest.py::TestTreeGeneration::test_d_regularization_dims - Exception: Unable to calculate free energy for species 'C6H6-5': no thermo or statmech data available.
FAILED test/rmgpy/molecule/moleculeTest.py::TestMolecule::test_count_aromatic_rings - assert [2, 0] == [2, 1, 0]
  At index 1 diff: 0 != 1
  Right contains one more item: 0
  Full diff:
  - [2, 1, 0]
  ?     ---
  + [2, 0]
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_naphthyl - assert 2 == 4
 +  where 2 = len([Molecule(smiles="[c]1cccc2ccccc12"), Molecule(smiles="[C]1=C2C=CC=CC2=CC=C1")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_methyl_napthalene - assert 2 == 4
 +  where 2 = len([Molecule(smiles="Cc1cccc2ccccc12"), Molecule(smiles="CC1=CC=CC2=CC=CC=C12")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_methyl_phenanthrene - assert 2 == 3
 +  where 2 = len([Molecule(smiles="Cc1cccc2c1ccc1ccccc12"), Molecule(smiles="CC1=CC=CC2=C1C=CC1=CC=CC=C12")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_methyl_phenanthrene_radical - assert 2 == 9
 +  where 2 = len([Molecule(smiles="[CH2]c1cccc2c1ccc1ccccc12"), Molecule(smiles="[CH2]C1=CC=CC2=C1C=CC1=CC=CC=C12")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_c13h11_rad - assert 2 == 6
 +  where 2 = len([Molecule(smiles="Cc1ccc([CH]c2ccccc2)cc1"), Molecule(smiles="CC1=CC=C([CH]C2=CC=CC=C2)C=C1")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_aryne_3_rings - assert 4 == 5
 +  where 4 = len([Molecule(smiles="C1#Cc2c(ccc3ccccc23)C=C1"), Molecule(smiles="C1=C=C2C(=CC=1)C=Cc1ccccc12"), Molecule(smiles="C1#CC2=C(C=C1)C=Cc1ccccc12"), Molecule(smiles="C1#CC2=C(C=C1)C=CC1=C2C=CC=C1")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_polycyclic_aromatic_with_non_aromatic_ring2 - assert 2 == 4
 +  where 2 = len([Molecule(smiles="C=C1C=Cc2cc3c(ccc4cc5ccccc5cc43)cc2C1=C"), Molecule(smiles="C=C1C=CC2=CC3=C(C=CC4=CC5=CC=CC=C5C=C43)C=C2C1=C")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_false_negative_polycyclic_aromaticity_perception - assert 2 == 6
 +  where 2 = len([Molecule(smiles="[CH2]c1cccc2ccccc12"), Molecule(smiles="C=C1C=CC=C2C=C[CH]C=C12")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_false_negative_polycylic_aromaticity_perception2 - assert 6 == 7
 +  where 6 = len([Molecule(smiles="[CH2]C=C1C=CC(=C)c2ccccc21"), Molecule(smiles="[CH2]c1ccc(C=C)c2ccccc12"), Molecule(smiles="C=C[C]1C=CC(=C)c2ccccc21"), Molecule(smiles="C=CC1=C[CH]C(=C)c2ccccc21"), Molecule(smiles="[CH2]C1=CC=C(C=C)c2ccccc21"), Molecule(smiles="[CH2]C=C1C=CC(=C)C2=C1C=CC=C2")])
FAILED test/rmgpy/molecule/resonanceTest.py::ClarTest::test_clar_optimization - ValueError: not enough values to unpack (expected 4, got 2)
FAILED test/rmgpy/molecule/resonanceTest.py::ClarTest::test_phenanthrene - assert 0 == 1
 +  where 0 = len([])
FAILED test/rmgpy/molecule/resonanceTest.py::ClarTest::test_phenalene - assert 0 == 2
 +  where 0 = len([])
FAILED test/rmgpy/molecule/resonanceTest.py::ClarTest::test_corannulene - assert 0 == 5
 +  where 0 = len([])
FAILED test/rmgpy/statmech/ndTorsionsTest.py::TestHinderedRotorClassicalND::test_hindered_rotor_nd - assert 4e-05 == 0
 +  where 4e-05 = round((2.8993250143510827 - 2.899287634962152), 5)
 +    where 2.8993250143510827 = abs(2.8993250143510827)
 +      where 2.8993250143510827 = <bound method HinderedRotorClassicalND.calc_partition_function of Mode(quantum=False)>(300.0)
 +        where <bound method HinderedRotorClassicalND.calc_partition_function of Mode(quantum=False)> = Mode(quantum=False).calc_partition_function
== 25 failed, 1876 passed, 36 skipped, 2083535 warnings in 1696.85s (0:28:16) ==
make: *** [Makefile:65: test-all] Error 1
JacksonBurns commented 3 months ago

These are the remaining test failures:

=========================== short test summary info ============================
FAILED test/arkane/encorr/isodesmicTest.py::TestSpeciesConstraints::test_calculating_constraints - TypeError: not all arguments converted during string formatting
FAILED test/arkane/encorr/isodesmicTest.py::TestErrorCancelingScheme::test_calculate_target_enthalpy - AttributeError: 'TestErrorCancelingScheme' object has no attribute 'pyo'
FAILED test/rmgpy/data/solvationTest.py::TestSoluteDatabase::test_saturation_density - AssertionError: assert 1.93 == 0
 +  where 1.93 = round(1.9298279226322848, 2)
 +    where 1.9298279226322848 = abs((6385.1498279226325 - 6383.22))
 +      where 6385.1498279226325 = get_liquid_saturation_density('Hexane', 400)
FAILED test/rmgpy/data/thermoTest.py::TestCyclicThermo::test_add_poly_ring_correction_thermo_data_from_heuristic_using_pyrene - AssertionError: assert 'Benzene' in []
FAILED test/rmgpy/data/thermoTest.py::TestMolecularManipulationInvolvedInThermoEstimation::test_bicyclic_decomposition_for_polyring_using_pyrene - assert [0, 0, 0, 0, 0] == [0, 6, 6, 6, 6]
  At index 1 diff: 0 != 6
  Full diff:
  - [0, 6, 6, 6, 6]
  + [0, 0, 0, 0, 0]
FAILED test/rmgpy/data/kinetics/familyTest.py::TestTreeGeneration::test_f_rules - ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (7, 6) + inhomogeneous part.
FAILED test/rmgpy/data/kinetics/familyTest.py::TestTreeGeneration::test_d_regularization_dims - Exception: Unable to calculate free energy for species 'C6H6-5': no thermo or statmech data available.
FAILED test/rmgpy/molecule/moleculeTest.py::TestMolecule::test_count_aromatic_rings - assert [2, 0] == [2, 1, 0]
  At index 1 diff: 0 != 1
  Right contains one more item: 0
  Full diff:
  - [2, 1, 0]
  ?     ---
  + [2, 0]
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_naphthyl - assert 2 == 4
 +  where 2 = len([Molecule(smiles="[c]1cccc2ccccc12"), Molecule(smiles="[C]1=C2C=CC=CC2=CC=C1")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_methyl_napthalene - assert 2 == 4
 +  where 2 = len([Molecule(smiles="Cc1cccc2ccccc12"), Molecule(smiles="CC1=CC=CC2=CC=CC=C12")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_methyl_phenanthrene - assert 2 == 3
 +  where 2 = len([Molecule(smiles="Cc1cccc2c1ccc1ccccc12"), Molecule(smiles="CC1=CC=CC2=C1C=CC1=CC=CC=C12")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_methyl_phenanthrene_radical - assert 2 == 9
 +  where 2 = len([Molecule(smiles="[CH2]c1cccc2c1ccc1ccccc12"), Molecule(smiles="[CH2]C1=CC=CC2=C1C=CC1=CC=CC=C12")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_c13h11_rad - assert 2 == 6
 +  where 2 = len([Molecule(smiles="Cc1ccc([CH]c2ccccc2)cc1"), Molecule(smiles="CC1=CC=C([CH]C2=CC=CC=C2)C=C1")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_aryne_3_rings - assert 4 == 5
 +  where 4 = len([Molecule(smiles="C1#Cc2c(ccc3ccccc23)C=C1"), Molecule(smiles="C1=C=C2C(=CC=1)C=Cc1ccccc12"), Molecule(smiles="C1#CC2=C(C=C1)C=Cc1ccccc12"), Molecule(smiles="C1#CC2=C(C=C1)C=CC1=C2C=CC=C1")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_polycyclic_aromatic_with_non_aromatic_ring2 - assert 2 == 4
 +  where 2 = len([Molecule(smiles="C=C1C=Cc2cc3c(ccc4cc5ccccc5cc43)cc2C1=C"), Molecule(smiles="C=C1C=CC2=CC3=C(C=CC4=CC5=CC=CC=C5C=C43)C=C2C1=C")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_false_negative_polycyclic_aromaticity_perception - assert 2 == 6
 +  where 2 = len([Molecule(smiles="[CH2]c1cccc2ccccc12"), Molecule(smiles="C=C1C=CC=C2C=C[CH]C=C12")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_false_negative_polycylic_aromaticity_perception2 - assert 6 == 7
 +  where 6 = len([Molecule(smiles="[CH2]C=C1C=CC(=C)c2ccccc21"), Molecule(smiles="[CH2]c1ccc(C=C)c2ccccc12"), Molecule(smiles="C=C[C]1C=CC(=C)c2ccccc21"), Molecule(smiles="C=CC1=C[CH]C(=C)c2ccccc21"), Molecule(smiles="[CH2]C1=CC=C(C=C)c2ccccc21"), Molecule(smiles="[CH2]C=C1C=CC(=C)C2=C1C=CC=C2")])
FAILED test/rmgpy/molecule/resonanceTest.py::ClarTest::test_clar_optimization - ValueError: not enough values to unpack (expected 4, got 2)
FAILED test/rmgpy/molecule/resonanceTest.py::ClarTest::test_phenanthrene - assert 0 == 1
 +  where 0 = len([])
FAILED test/rmgpy/molecule/resonanceTest.py::ClarTest::test_phenalene - assert 0 == 2
 +  where 0 = len([])
FAILED test/rmgpy/molecule/resonanceTest.py::ClarTest::test_corannulene - assert 0 == 5
 +  where 0 = len([])
FAILED test/rmgpy/statmech/ndTorsionsTest.py::TestHinderedRotorClassicalND::test_hindered_rotor_nd - assert 4e-05 == 0
 +  where 4e-05 = round((2.8993250143510827 - 2.899287634962152), 5)
 +    where 2.8993250143510827 = abs(2.8993250143510827)
 +      where 2.8993250143510827 = <bound method HinderedRotorClassicalND.calc_partition_function of Mode(quantum=False)>(300.0)
 +        where <bound method HinderedRotorClassicalND.calc_partition_function of Mode(quantum=False)> = Mode(quantum=False).calc_partition_function
== 22 failed, 1879 passed, 36 skipped, 3939723 warnings in 2297.49s (0:38:17) ==
make: *** [Makefile:65: test-all] Error 1

@hwpang I think these test failures are because of the changes in this PR, could you take a look?

FAILED test/arkane/encorr/isodesmicTest.py::TestSpeciesConstraints::test_calculating_constraints - TypeError: not all arguments converted during string formatting
FAILED test/arkane/encorr/isodesmicTest.py::TestErrorCancelingScheme::test_calculate_target_enthalpy - AttributeError: 'TestErrorCancelingScheme' object has no attribute 'pyo'

@xiaoruiDong I think these test failures are due to the changes in the resonance calculation. I will list the here, but we should resolve them in #2694.

FAILED test/rmgpy/data/solvationTest.py::TestSoluteDatabase::test_saturation_density - AssertionError: assert 1.93 == 0
 +  where 1.93 = round(1.9298279226322848, 2)
 +    where 1.9298279226322848 = abs((6385.1498279226325 - 6383.22))
 +      where 6385.1498279226325 = get_liquid_saturation_density('Hexane', 400)
FAILED test/rmgpy/data/thermoTest.py::TestCyclicThermo::test_add_poly_ring_correction_thermo_data_from_heuristic_using_pyrene - AssertionError: assert 'Benzene' in []
FAILED test/rmgpy/data/thermoTest.py::TestMolecularManipulationInvolvedInThermoEstimation::test_bicyclic_decomposition_for_polyring_using_pyrene - assert [0, 0, 0, 0, 0] == [0, 6, 6, 6, 6]
  At index 1 diff: 0 != 6
  Full diff:
  - [0, 6, 6, 6, 6]
  + [0, 0, 0, 0, 0]

...

FAILED test/rmgpy/molecule/moleculeTest.py::TestMolecule::test_count_aromatic_rings - assert [2, 0] == [2, 1, 0]
  At index 1 diff: 0 != 1
  Right contains one more item: 0
  Full diff:
  - [2, 1, 0]
  ?     ---
  + [2, 0]
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_naphthyl - assert 2 == 4
 +  where 2 = len([Molecule(smiles="[c]1cccc2ccccc12"), Molecule(smiles="[C]1=C2C=CC=CC2=CC=C1")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_methyl_napthalene - assert 2 == 4
 +  where 2 = len([Molecule(smiles="Cc1cccc2ccccc12"), Molecule(smiles="CC1=CC=CC2=CC=CC=C12")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_methyl_phenanthrene - assert 2 == 3
 +  where 2 = len([Molecule(smiles="Cc1cccc2c1ccc1ccccc12"), Molecule(smiles="CC1=CC=CC2=C1C=CC1=CC=CC=C12")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_methyl_phenanthrene_radical - assert 2 == 9
 +  where 2 = len([Molecule(smiles="[CH2]c1cccc2c1ccc1ccccc12"), Molecule(smiles="[CH2]C1=CC=CC2=C1C=CC1=CC=CC=C12")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_c13h11_rad - assert 2 == 6
 +  where 2 = len([Molecule(smiles="Cc1ccc([CH]c2ccccc2)cc1"), Molecule(smiles="CC1=CC=C([CH]C2=CC=CC=C2)C=C1")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_aryne_3_rings - assert 4 == 5
 +  where 4 = len([Molecule(smiles="C1#Cc2c(ccc3ccccc23)C=C1"), Molecule(smiles="C1=C=C2C(=CC=1)C=Cc1ccccc12"), Molecule(smiles="C1#CC2=C(C=C1)C=Cc1ccccc12"), Molecule(smiles="C1#CC2=C(C=C1)C=CC1=C2C=CC=C1")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_polycyclic_aromatic_with_non_aromatic_ring2 - assert 2 == 4
 +  where 2 = len([Molecule(smiles="C=C1C=Cc2cc3c(ccc4cc5ccccc5cc43)cc2C1=C"), Molecule(smiles="C=C1C=CC2=CC3=C(C=CC4=CC5=CC=CC=C5C=C43)C=C2C1=C")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_false_negative_polycyclic_aromaticity_perception - assert 2 == 6
 +  where 2 = len([Molecule(smiles="[CH2]c1cccc2ccccc12"), Molecule(smiles="C=C1C=CC=C2C=C[CH]C=C12")])
FAILED test/rmgpy/molecule/resonanceTest.py::ResonanceTest::test_false_negative_polycylic_aromaticity_perception2 - assert 6 == 7
 +  where 6 = len([Molecule(smiles="[CH2]C=C1C=CC(=C)c2ccccc21"), Molecule(smiles="[CH2]c1ccc(C=C)c2ccccc12"), Molecule(smiles="C=C[C]1C=CC(=C)c2ccccc21"), Molecule(smiles="C=CC1=C[CH]C(=C)c2ccccc21"), Molecule(smiles="[CH2]C1=CC=C(C=C)c2ccccc21"), Molecule(smiles="[CH2]C=C1C=CC(=C)C2=C1C=CC=C2")])
FAILED test/rmgpy/molecule/resonanceTest.py::ClarTest::test_clar_optimization - ValueError: not enough values to unpack (expected 4, got 2)
FAILED test/rmgpy/molecule/resonanceTest.py::ClarTest::test_phenanthrene - assert 0 == 1
 +  where 0 = len([])
FAILED test/rmgpy/molecule/resonanceTest.py::ClarTest::test_phenalene - assert 0 == 2
 +  where 0 = len([])
FAILED test/rmgpy/molecule/resonanceTest.py::ClarTest::test_corannulene - assert 0 == 5
 +  where 0 = len([])

There are a handful of other failures which we can resolve in #2687

xiaoruiDong commented 3 months ago

@JacksonBurns Will take a look

JacksonBurns commented 3 months ago

Above commits are intended to resolve the two outstanding test failures unique to this PR. If successful, will merge this PR and resolve the resonance issues in the base.

JacksonBurns commented 3 months ago

@hwpang I think I have fixed the errors that were unique to this PR. Going to merge.

@xiaoruiDong I will tag you in the next PR and we pick this up from there.