No-op code & docs cleanups
These are rather trivial commits cherry-picked from #193 that don't change anything essential, but once they are in, it should be easier to manage the rest.
The changes are:
- code formatter whitespace fixes for the .md files
- move some
usingdirectives from the individual unit test .jl files to the parent .jl file - in
RAMSymbolicrenamexxx_functiontoxxx_eval!as that better follows Julia naming conventions and should make the code a bit more readable (and shorter) - cleanups to the fitmeasures that simplify some method signatures (remove unused type parameters).
This is a bit less trivial set of changes than the rest, but in the end it does not really change how the functions are calculated.
Except for switching p-values calculation to use
ccdf(x)instead of1 - cdf(x)-- this could potentially give more precise results for p-values close to 0.
Codecov Report
:x: Patch coverage is 86.79245% with 14 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 72.81%. Comparing base (8b0f880) to head (0c7d594).
:warning: Report is 46 commits behind head on devel.
Additional details and impacted files
@@ Coverage Diff @@
## devel #245 +/- ##
==========================================
- Coverage 72.94% 72.81% -0.14%
==========================================
Files 50 54 +4
Lines 2218 2218
==========================================
- Hits 1618 1615 -3
- Misses 600 603 +3
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
I've rebased the PR after the #253 got merged.
@Maximilian-Stefan-Ernst I have also noticed that you have implemented #246.
I am not sure I understand what was exactly the reason for these changes -- I guess it was related to running some examples/tests, but if that's the case we can fix it differently.
To me this change defeats the purpose of using extension mechanism for supporting different optimization engines as it moves the SemOptimizer subtypes back into the main package.
There is no strong reason to make engine-specific SemOptimizer subtypes public and recommend the user constructing them explicitly, especially since these constructors take all their input as keyword arguments.
Yes, before #246 the SemOptimizerEngine type was only available within the extension and was not exposed upon extension activation,
but SemOptimizer(engine = ...) => SemOptimizer{engine}(...) => SemOptimizerEngine(...) mechanism can handle SemOptimizerEngine construction just fine.
It is a standard pattern for implementing Julia extensions.
Also, I think for the user it is easier to memorize the SemOptimizer(engine = ...) construct, and it also makes it easier to switch the engines.
So I have added commits that revert #246 in this PR, but also updated the optimization documentation to be in sync with the actual opt. engine API:
SemOptimizationOptim(),SemOptimizationNLopt()etc in the docs are replaced withSemOptimizer(engine = <engine_name>, args...).- I have updated the fallback
SemOptimizer(engine = ...)constructor to inform the user, which packages should be loaded for NLopt and ProximalAlgorithms, if that was one of the reasons for #246. - For NLopt I have replaced
NLoptConstraint(f = func, tol = tol)withfunc => tol. That simplifies the syntax and avoids definingNLoptContrainttype, which is only really used forSemOptimizerNLoptconstruction. I have also allowed specifying just the function without the tolerance -- in that case the tolerance will be taken from theconstraint_tolparameter. - In the documentation I have changed the term "backend" into "engine" to match the
SemOptimizerkeyword, but if you have strong preference for "backend", I can revert it and rename the "engine" keyword into "backend". - I have also simplified the examples: since the optimizer is now separate from the model, we don't need to duplicate the model if we want to fit it with another optimizer.
Please let me know if you have any concerns regarding these changes, I will be happy to address them.
@Maximilian-Stefan-Ernst @brandmaier @aaronpeikert In the recent months the merging of some of the changes from my staging branch (PR #193) into the main branch was dormant. But I would be still interested in it, if you think it will be beneficial for the SEM.jl. I mention it, because I see there are new issues/PRs, which could at least partially be addressed in PR #193. Thank you!