Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce algorithms boilerplate #47

Merged
merged 13 commits into from
Jun 15, 2021

Conversation

lostella
Copy link
Member

@lostella lostella commented Jun 11, 2021

This is a breaking change, mainly aiming at significantly reducing the boilerplate around algorithms (500+ lines are gone from the algorithms implementations), and making the iterable types more usable directly, by having docstrings and default parameters.

Please refer to the changes in tests to get a feeling for the level of breakage (but not everything is covered there).

Most relevant changes:

  • iterable types implementing algorithms have been renamed <AlgorithmName>Iteration
  • iterable types have now a keyword-only constructor thanks to the Base.@kwdef macro
  • thanks to the same macro, default settings within iterables are now straightforward to read
  • the "solver" interface is now much simpler in its implementation (to the point where all look the same, we could almost have a macro defining them)
  • some fields have been renamed
  • some iterables where fixed to avoid in-place modifying the initial iterate (and this is now tested)
  • package version is bumped to 0.5.0 because of the breaking changes
  • Julia requirement is bumped to 1.1 (because of Base.@kwdef)
  • tests were updated

@lostella lostella requested review from nantonel and pylat June 11, 2021 22:00
@codecov
Copy link

codecov bot commented Jun 11, 2021

Codecov Report

Merging #47 (24b61a5) into master (263a83a) will increase coverage by 0.80%.
The diff coverage is 89.83%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #47      +/-   ##
==========================================
+ Coverage   87.15%   87.96%   +0.80%     
==========================================
  Files          18       18              
  Lines         841      748      -93     
==========================================
- Hits          733      658      -75     
+ Misses        108       90      -18     
Impacted Files Coverage Δ
src/algorithms/primaldual.jl 64.40% <82.75%> (-2.02%) ⬇️
src/algorithms/davisyin.jl 94.73% <88.88%> (+2.73%) ⬆️
src/algorithms/lilin.jl 77.58% <88.88%> (-1.29%) ⬇️
src/algorithms/douglasrachford.jl 95.65% <90.00%> (+5.99%) ⬆️
src/algorithms/forwardbackward.jl 95.52% <91.66%> (+2.10%) ⬆️
src/algorithms/panoc.jl 94.94% <91.66%> (+1.19%) ⬆️
src/algorithms/zerofpr.jl 94.04% <91.66%> (+1.26%) ⬆️
src/algorithms/drls.jl 96.49% <94.73%> (+3.63%) ⬆️
src/utilities/iterationtools.jl 83.78% <100.00%> (+1.83%) ⬆️
src/compat.jl 0.00% <0.00%> (-100.00%) ⬇️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 263a83a...24b61a5. Read the comment docs.

@pylat
Copy link
Contributor

pylat commented Jun 14, 2021

This is a breaking change, mainly aiming at significantly reducing the boilerplate around algorithms (500+ lines are gone from the algorithms implementations), and making the iterable types more usable directly, by having docstrings and default parameters.

Please refer to the changes in tests to get a feeling for the level of breakage (but not everything is covered there).

Most relevant changes:

  • iterable types implementing algorithms have been renamed <AlgorithmName>Iteration
  • iterable types have now a keyword-only constructor thanks to the Base.@kwdef macro
  • thanks to the same macro, default settings within iterables are now straightforward to read
  • the "solver" interface is now much simpler in its implementation (to the point where all look the same, we could almost have a macro defining them)
  • some fields have been renamed
  • some iterables where fixed to avoid in-place modifying the initial iterate (and this is now tested)
  • package version is bumped to 0.5.0 because of the breaking changes
  • Julia requirement is bumped to 1.1 (because of Base.@kwdef)
  • tests were updated

Very interesting macro. (Not to be found in the manual!) It looks good to me. Thanks Stella.

@lostella lostella merged commit d1d2b49 into JuliaFirstOrder:master Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants