Open jiweiqi opened 3 years ago
That sound like a good ideal. I can add that for the thermo interface.
I think the naming "test_
Hi @TJP-Karpowski , I agree with you that we should make the top level of src being clean. Indeed, putting them into either ./test/ or ./src/test is a good idea.
As for the current test files, which are put at the level of src, the reason is that I haven't figured out a good pipeline for debugging code during the development phase. As you probably know, if I import Arrhenius.jl via using Arrhenius
, every time I change the source code, I will have to restart the Julia terminal. Instead, I currently import Arrhenius.jl by directly executing the module file as done in https://github.com/DENG-MIT/Arrhenius.jl/blob/3f7700709ad1092291c9d5e3d108f233f845a696/src/_transport_test.jl#L5-L43. I feel this is not a good way to do it. But at the current time being, I haven't tried other approaches.
Noting that, I have to call Arrhenius.R to access the member of the Arrhenius module. This is different from the standard test file, like https://github.com/DENG-MIT/Arrhenius.jl/blob/3f7700709ad1092291c9d5e3d108f233f845a696/test/runtests.jl#L1-L38.
I had the same problem with the Julia restart, luckily we are not the first to have that issue. You can use the revise package: https://timholy.github.io/Revise.jl/stable/ .
Just call using Revise
before using Arrhenius
and then revise will check for changes to the source files and will apply those changes in the running session :).
As the package becomes more and more complex, it is important to adopt unit testing. We can following the example of RMS.jl at https://github.com/ReactionMechanismGenerator/ReactionMechanismSimulator.jl/blob/ac2a3bd88504b86d5bc60dedc09533839a9c9cbb/src/Calculators/TestThermo.jl#L1-L60.
Some thoughts:
@test Cps ≈ Cpexplist rtol=1e-3
where 1e-3 is a good default value for tolerance.