JuliaManifolds / Manopt.jl

🏔️Manopt. jl – Optimization on Manifolds in Julia
http://manoptjl.org
Other
314 stars 40 forks source link

Rework presentation of keywords #393

Closed kellertuer closed 3 weeks ago

kellertuer commented 2 months ago

This is heavily WIP (just had a bit on time on the train with not so much concentration).

This aims to

🛣️ Roadmap

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 99.71014% with 1 line in your changes missing coverage. Please review.

Project coverage is 99.76%. Comparing base (489da96) to head (65d6381).

Files Patch % Lines
src/solvers/adaptive_regularization_with_cubics.jl 66.66% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #393 +/- ## ========================================== - Coverage 99.78% 99.76% -0.02% ========================================== Files 76 77 +1 Lines 8226 8256 +30 ========================================== + Hits 8208 8237 +29 - Misses 18 19 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

kellertuer commented 2 months ago

I think I found a good format by now and with the snippets we also avoid “stringduplication” – that is for example the “first parameter is a manifold” text will soon be the same in all doc strings.

kellertuer commented 2 months ago

I think I have converged to a nice new format, and with a bit of rewriting how the doc string is defined, this allows to reuse parts as well – for example prominent keywords like evaluation=

Format

* `keyword=default`:
  description

is nice, since the = also indicates that what follows is the default. All doc strings will be reformulated as “non-raw” to allow for interpolation. this means raw parts, like formulae, should be defined before.

Now that this is clear, this PR is really just a large work to check all doc strings and reform them. But the benefit is, that this reduces a lot of duplication in the strings as well, since common tens are now defined in plans/docstring_snippets.jl both lines – the keyword=default and the description are possible strings to be collected, whenever used more than once or twice.

Still a bit of work to do, where I will try to work on a doc string every day.

kellertuer commented 3 weeks ago

So now this should be good to go. Not sure it is worth its own version, since I will not activate vale (basically text style check) for now, since they have too often breaking changes and though I implemented Julia code stuff for them the newest version reports, .jl files are not allowed in checks.

kellertuer commented 3 weeks ago

Since this is really just involving doc string rewrites, I will merge this now and include it in the next release (the other PR still open). It will hence already reside on master for a while then (without a new version).