Closed GPMueller closed 1 year ago
Note: the new API input checkers are proving quite useful in debugging test code as well:
2023-02-13 13:19:51 [ ERROR ] [API ] [01] [01] -----------------------------------------------------
2023-02-13 13:19:51 [ ERROR ] [API ] [01] [01] Caught exception in API function 'Simulation_LLG_Start' (at /home/runner/work/spirit/spirit/core/src/Spirit/Simulation.cpp:218)
Exception backtrace:
2023-02-13 13:19:51 [ ERROR ] [API ] [--] [--] /home/runner/work/spirit/spirit/core/include/data/State.hpp:73 in function 'throw_if_nullptr':
Got passed a null pointer for 'info'
2023-02-13 13:19:51 [ ERROR ] [API ] [01] [01] -----------------------------------------------------
Merging #628 (ff41d9a) into develop (24c4cc3) will increase coverage by
0.56%
. The diff coverage is47.01%
.
It seems that mixing single and double precision in the unit tests is a bad idea! The results are very tricky to predict correctly and it would be far preferable to fix the API to provide adaptible precision using the scalar
alias, see issue #477.
The only drawback of using the scalar
alias would be that the web-UI that goes through the C API would have to be built with single precision, because the API needs to be single precision.
Not totally sure yet, but is looks like this PR might be a good place to do this work and fix issue #477.
This PR now fixes issue #477. The UI code is now somewhat inconsistent in terms of using float vs double vs scalar
(for both the ImGui and Qt UIs), but I believe it's good enough.
@MSallermann this significantly breaks API compatibility, so if you'd prefer I can pull out the API changes into a separate PR, so that a new release can be made before breaking the API and bumping the major version number. On the other hand, while a quick diff between develop and master didn't show notable API breakage, we did already upgrade to C++14 since the last release, which IMO warrants a new major version anyways).
Cleaning up some untidy code and try to make tests more readable and easier to understand.
TODO
scalar
==float
) build to the CI tests