Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1911 +/- ##
==========================================
+ Coverage 75.04% 75.43% +0.39%
==========================================
Files 450 450
Lines 56236 56276 +40
Branches 9302 9302
==========================================
+ Hits 42201 42453 +252
+ Misses 10898 10687 -211
+ Partials 3137 3136 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9a6a562 to
f8ebb67
Compare
There was a problem hiding this comment.
@ssun30 ... thanks for addressing!
Out of curiosity: for the Python API, all examples are tested as part of a CI job, see run-examples in .github/workflows/main.yml.
The relevant code is:
- name: Run the examples
# See https://unix.stackexchange.com/a/392973 for an explanation of the -exec part.
run: |
ln -s libcantera_shared.so build/lib/libcantera_shared.so.3
export LD_LIBRARY_PATH=build/lib
find samples/python -type f -iname "*.py" \
-exec sh -c 'for n; do echo "$n" | tee -a results.txt && python3 "$n" >> results.txt || exit 1; done' sh {} +I believe it's possible to do something similar here as it's possible to run MATLAB scripts from the command line:
matlab -r "try, run('rankine.m'), catch, exit(1), end, exit(0)"
where I had set matlab to
alias matlab="/Applications/MATLAB_R2023b.app/bin/matlab -nojvm -nodesktop"
on macOS (fwiw, I just ran a quick test so the options may not be the greatest selection)
182f7b9 to
bb891cb
Compare
f6520e5 to
4863f99
Compare
36f788e to
123e0e8
Compare
0aec705 to
fc5bd71
Compare
There was a problem hiding this comment.
@ssun30 ... thanks for pushing the MATLAB toolbox closer to the finishing line. Changes to the samples are ok, but I do have comments regarding the updated approach for folder management:
- The
ctPathsinterface is too complicated - it should be sufficient to provide the root location, and use logic based on known relative paths - Except for unit tests, compiled Cantera should use the installed location
- Unit tests don't need to be installed or distributed with the MLTBX
At this juncture, it also makes sense to start testing all operating systems in CI jobs, i.e., Windows, macOS, and Linux. This can likely be done as a standard matrix job. Further, examples should be run as part of the CI jobs as pointed out in a comment above.
fc5bd71 to
1493921
Compare
1493921 to
79fb01a
Compare
79fb01a to
26ab152
Compare
ischoegl
left a comment
There was a problem hiding this comment.
Thanks @ssun30. Thanks for addressing the ctPaths issue which to me was the biggest concern. There are some remaining issues that should be easy to address.
I'm 👍 with deferring some decisions regarding installation and CI runs, but hope that you'll address that feedback in other PRs. Both should be addressed before the 'experimental' suffix can be removed.
26ab152 to
7c00e73
Compare
speth
left a comment
There was a problem hiding this comment.
I think there's a fair bit of improvement still needed with how paths are set up, but I would suggest that we hold off on that for now in the interest of getting the main feature of this PR in place, which is to have the Matlab CI job run successfully and include running the examples as part of the testing in that job.
| % It assumes that the ``gas`` object represents a reacting ideal gas mixture. | ||
|
|
||
| % Set the state of the gas, based on the current solution vector. | ||
| gas.basis = 'mass'; |
There was a problem hiding this comment.
The default basis should already be "mass", which would be consistent with the Python interface, though I see that the behavior defined in ThermoPhase.m is in fact to default to molar properties.
There was a problem hiding this comment.
I agree that default behaviors across interfaces should be consistent. The mass/mole switching is unfortunately handled by the interfaces, see Cantera/enhancements#219. Obviously not something that should be addressed here.
I will defer to @speth for the final approval.
bryanwweber
left a comment
There was a problem hiding this comment.
I'm likewise interested in resolving the installation question, but I also feel fine with deferring that to after this work. I just had a few simple fixes for consistency and maybe some cleanup.
b20f051 to
837625c
Compare
bryanwweber
left a comment
There was a problem hiding this comment.
Thanks @ssun30 this looks good to me now
Changed refine criteria for Diff_flame
Modified several samples to include this change
Replaced ctRoot with ctPaths, this will allow the user to set paths to the shared libraries, header files, and toolboxes more freely, instead of relying on relative paths to a fixed path for a certain conda environment.
to how paths are set
Currently Func1 may have a partially constructed object that gets destructed when checks for the types of input arguments fail, a warning will pop up when the destructor is called.
Now it only uses relative paths to the environment where cantera is installed.
The test_examples script can still be used to run all examples by the user, but it's not necessary for the unit test suite.
for installing the MATLAB toolbox
Fixed some formatting with cell markers
Now the unit test suite has its own set up methods to handle the paths
1f2b74a to
c70683f
Compare
speth
left a comment
There was a problem hiding this comment.
This is definitely progress in the right direction. Looking forward to more in additional PRs.
There are numerous changes to class structures to the MATLAB interface that necessitate modifications to our current collection of MATLAB samples.
Changes proposed in this pull request
If applicable, fill in the issue number this pull request is fixing
Not a fix to #1722Flame fixes have been deferred to a later PR.Checklist
scons build&scons test) and unit tests address code coverage