Migrate "test_problems" tests to use YAML input files#1062
Migrate "test_problems" tests to use YAML input files#1062ischoegl merged 21 commits intoCantera:mainfrom
Conversation
The relevant phase for determining whether or not a reaction occurs on an interface is not necessarily the first phase in the Kinetics object.
Set the 'reactions' field of the YAML phase definition for such input files to 'none'. Modify co2_RK_example.* input files so that they can be used for testing.
This makes it possible to define the phase list in-line when calling newKinetics.
Retain runs with the existing CTI and XML input files until those formats are removed.
Includes tests for classes IdealSolidSolnPhase and IdealSolnGasVPSS
Compare to the list of aliases defined in the ThermoFactory constructor
This test used only the the most trivial interface kinetics functionality, which is more thoroughly covered by other tests such as surfSolver in C++ and the TestReaction.test_interface and TestSofcKinetics in Python.
Basic gas-phase equilibrium is more thoroughly exercised by the GTest and Python test suites.
Codecov Report
@@ Coverage Diff @@
## main #1062 +/- ##
==========================================
+ Coverage 72.92% 73.04% +0.11%
==========================================
Files 357 357
Lines 47120 46925 -195
==========================================
- Hits 34363 34277 -86
+ Misses 12757 12648 -109
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Thanks for taking this on - this takes the transition from CTI/XML to YAML a big step forward. I took a cursory look at the changes, and most of them are mainly replacing input files (i.e. cumbersome, but straight-forward).
I do have two comments, though: documentation on some of the tests is relatively sparse. While it's certainly beyond the scope of this PR to make major changes, leaving very brief statements at the top may be helpful in the future (you are probably the one person who has the best overview).
There was a comment about Interface in one of the test problems - this is obviously deprecated in 2.5 and currently removed in 2.6. There were also recent questions about this on the UG. While I am not advocating on a reversal of this particular deprecation, do you see a way to introduce a new class that represents a collection of multiple C++ SolutionBase objects? (I don't think it's needed, but an inherited class that simplifies loading may be nice).
Poor/incorrect documentation is one of many faults of the |
Fair point. I think getting the |
There was a problem hiding this comment.
Overall, those changes all look good to me. The only things I am not absolutely sure about are the surface solver tests where you ”removed unused tests” (ed00efe), with associated code removals. If these indeed weren’t used at all, I’m ok to approve this PR.
On the other hand, there’s Cantera/enhancements#103, where a resolution may simplify some of the work here. (But I’m not a fan of leaving large PR’s lingering).
The code removed in that commit falls into two categories:
You can tell that these changes didn't have an impact on what's actually tested from the fact that the "blessed" output files for these tests haven't changed. |
ischoegl
left a comment
There was a problem hiding this comment.
Poor/incorrect documentation is one of many faults of the test_problems test suite. Ultimately, I think it should be eliminated in favor of using the more explicit and expressive GTest and Python test suites.
I agree that it would be preferable to eliminate those tests long-term. In the meantime, I am approving these changes.
|
@ischoegl If you approve on behalf of @Cantera/committers then feel free to merge after ~24-48 hours from PR creation. |
In preparation for the removal of the CTI and XML formats, this updates all of the tests in the
test_problemsdirectory to use the YAML format (with the exception of a few tests that are run for each input format).Changes proposed in this pull request
test_problemstests to use YAML inputInputFileErrorto improve error messages related to sticking reactionsnewReactionto always use the correct phasereactionArraynode in XML filesctml2yamlsurfkinandsilane_equiltests, which weren't adding anything that wasn't better covered by other tests.Checklist
scons build&scons test) and unit tests address code coverage